summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/glsl_to_tgsi: use glsl_type::sampler_index()Samuel Pitoiset2017-03-301-66/+2
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: improve error messages and fix security warningNicolai Hähnle2017-03-301-2/+2
| | | | | | | | | | | | | | | | Debian, Ubuntu set default build flag: -Werror=format-security CC state_tracker/st_cb_texturebarrier.lo state_tracker/st_cb_eglimage.c: In function ‘st_egl_image_get_surface’: state_tracker/st_cb_eglimage.c:64:7: error: format not a string literal and no format arguments [-Werror=format-security] _mesa_error(ctx, GL_INVALID_VALUE, error); ^~~~~~~~~~~ state_tracker/st_cb_eglimage.c:71:7: error: format not a string literal and no format arguments [-Werror=format-security] _mesa_error(ctx, GL_INVALID_OPERATION, error); ^~~~~~~~~~~ Reported-by: Krzysztof Kolasa <[email protected]> Fixes: 83e9de25f325 ("st/mesa: EGLImageTarget* error handling")
* i965: Combine intel_batchbuffer_reloc and intel_batchbuffer_reloc64Kenneth Graunke2017-03-303-53/+19
| | | | | | | | | | | These two functions do the exact same thing. One returns a uint64_t, and the other takes the same uint64_t and truncates it to a uint32_t. We only need the uint64_t variant - the caller can truncate if it wants. This patch gives us one function, intel_batchbuffer_reloc, that does the 64-bit thing. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Use WARN_ONCE instead of open coding it.Kenneth Graunke2017-03-301-9/+4
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* android: pass sse4.1 flag as appropriateHarish Krupo2017-03-301-0/+3
| | | | | | | | | We have functions which depend on sse4.1 support but we didnt pass the right compile flag for it. This patch fixes it. Signed-off-by: Kalyan Kondapally <[email protected]> Signed-off-by: Harish Krupo <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/glthread: print out syncs when MARSHAL_MAX_CMD_SIZE is exceededTimothy Arceri2017-03-301-0/+13
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: EGLImageTarget* error handlingPhilipp Zabel2017-03-291-4/+19
| | | | | | | | | | | | | | | | | | | Stop trying to specify texture or renderbuffer objects for unsupported EGL images. Generate the error codes specified in the OES_EGL_image extension. EGLImageTargetTexture2D and EGLImageTargetRenderbuffer would call the pipe driver's create_surface callback without ever checking that the given EGL image is actually compatible with the chosen target texture or renderbuffer. This patch adds a call to the pipe driver's is_format_supported callback and generates an INVALID_OPERATION error for unsupported EGL images. If the EGL image handle does not describe a valid EGL image, an INVALID_VALUE error is generated. v2: fixed get_surface to actually use the usage and error parameters Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move st_manager_get_egl_image_surface into st_cb_eglimage.cPhilipp Zabel2017-03-293-37/+34
| | | | | | | | | | The only callers are here, and we will add generation of GL errors in the following patch. Rename the function to st_egl_image_get_surface, pass the gl_context instead of st_context, and move the cast from GLeglImageOES to void* into st_egl_image_get_surface. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove dd_function_table::BindProgramMarek Olšák2017-03-296-66/+7
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* r200: remove BindProgramMarek Olšák2017-03-292-16/+5
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i915: remove BindProgramMarek Olšák2017-03-291-25/+0
| | | | | | | | | The same thing is done in i915_update_program called by i915InvalidateState. Why do it twice. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't use _NEW_TEXTURE mainly in mesa/mainMarek Olšák2017-03-295-14/+17
| | | | | | | | v2: add missing %s Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: split _NEW_TEXTURE into _NEW_TEXTURE_OBJECT & _NEW_TEXTURE_STATEMarek Olšák2017-03-2915-48/+50
| | | | | | | | | | | | No performance testing has been done, because it makes sense to make this change regardless of that. Also, _NEW_TEXTURE is still used in many places, but the obvious occurences are replaced here. It's now possible to split _NEW_TEXTURE_OBJECT further. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: inline _mesa_update_textureMarek Olšák2017-03-293-22/+14
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st_cb_bitmap: check NULL return from u_upload_allocJulien Isorce2017-03-281-0/+6
| | | | | | Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Delete tile resource mode codeAnuj Phogat2017-03-275-267/+35
| | | | | | | | | | | Yf/Ys tiling never got used in i965 due to not delivering the expected performance benefits. So, this patch is deleting this dead code in favor of adding it later in ISL when we actually find it useful. ISL can then share this code between vulkan and GL. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Delete fast copy blit codeAnuj Phogat2017-03-272-185/+48
| | | | | | | | | | | | | | | Fast copy blit was primarily added to support Yf/Ys detiling. But, Yf/Ys tiling never got used in i965 due to not delivering the expected performance benefits. Also, replacing legacy blits with fast copy blit didn't help the benchmarking numbers. This is probably due to a h/w restriction that says "start pixel for Fast Copy blit should be on an OWord boundary". This restriction causes many blit operations to skip fast copy blit and use legacy blits. So, this patch is deleting this dead code in favor of adding it later when we actually find it useful. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Require Kernel 3.6 for Gen4-5 platforms.Kenneth Graunke2017-03-272-3/+3
| | | | | | | | | | | | | | We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013, commit 92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable to require it for Gen4-5 as well, bumping the requirement from 2.6.39. This is necessary for glClientWaitSync with a timeout to work, which is a feature we expose on Gen4-5. Without it, we would fall back to an infinite wait, which is pretty bad. See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+. Reviewed-by: Matt Turner <[email protected]>
* mesa/tests: Link main-test with CLOCK_LIB.Vinson Lee2017-03-271-1/+2
| | | | | | | | | | Fix 'make check' linking error with glibc < 2.17. CXXLD main-test ../../../../src/mesa/.libs/libmesa.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]>
* mesa: simplify code around 'variable_data' in marshal.cBrian Paul2017-03-271-12/+7
| | | | | | | Remove needless pointer increments, unneeded vars, etc. Untested. Plus, fix a couple comments. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: move duplicated st_ws_framebuffer() function into header fileBrian Paul2017-03-273-28/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* glsl, st/shader_cache: check the whole sha1 for zeroGrazvydas Ignotas2017-03-271-1/+2
| | | | | | | | | | | | The checks were only looking at the first byte, while the intention seems to be to check if the whole sha1 is zero. This prevented all shaders with first byte zero in their sha1 from being saved. This shaves around a second from Deus Ex load time on a hot cache. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* scons: Fix dependencies of marshal_generated.[ch].Jose Fonseca2017-03-261-2/+2
| | | | | | | | | | | These generated source files depend not only upon gl_and_es_API.xml, but all other XML files that are included by it. This change updates the generation rules to depend on all gen/*.xml files, like done for other SCons generation rules, and should fix incremental broken SCons builds due to missing dependencies. Trivial.
* mesa/glthread: add custom marshalling for ClearBufferfv()Timothy Arceri2017-03-252-0/+83
| | | | | | This is one of the main causes of syncs in Civ6. Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: Fix symbolic size of next_offset[] array.Kenneth Graunke2017-03-241-1/+1
| | | | | | | It's indexed by buffer, not stream. BRW_MAX_SOL_BUFFERS and MAX_VERTEX_STREAMS happen to both be 4, so there's no actual bug. Reviewed-by: Matt Turner <[email protected]>
* i965: Remove pointless NULL check from Gen6 primitive counting code.Kenneth Graunke2017-03-241-2/+3
| | | | | | | | | We create the BO when creating a transform feedback object, and only destroy it when deleting that object. So it won't be NULL. CID: 1401410 Reviewed-by: Matt Turner <[email protected]>
* glsl_to_tgsi: don't rely on glsl types when visiting tex instructionsSamuel Pitoiset2017-03-241-7/+6
| | | | | | | Instead add is_cube_shadow like is_cube_array. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/marshal: add custom BufferData/BufferSubData marshallingTimothy Arceri2017-03-242-0/+143
| | | | | | | | | | GL_AMD_pinned_memory requires memory to be aligned correctly, so we skip marshalling in this case. Also copying the data defeats the purpose of EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD. Fixes GL_AMD_pinned_memory piglit tests when glthread is enabled. Acked-by: Edward O'Callaghan <[email protected]>
* mesa: set thread name for glthreadMiklós Máté2017-03-241-0/+3
| | | | | Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Return progress from brw_nir_lower_uniforms().Matt Turner2017-03-231-3/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* android: i965: generate code for OA counter queriesMauro Rossi2017-03-231-0/+17
| | | | | | | | | | | | | | Automake generation rules are replicated for android. $* macro was expected to return "hsw" but instead gives "hsw.{h,c}" so $(basename $*) is used as a workaround to set the correct --chipset option for brw_oa.py script. Build tested with nougat-x86 Fixes: e565505 "i965: Add script to gen code for OA counter queries" Reviewed-by: Tapani Pälli <[email protected]> Acked-by: Robert Bragg <[email protected]> Acked-by: Emil Velikov <[email protected]>
* drirc: add force_glsl_abs_sqrt() for "Spec Ops: The Line"Samuel Pitoiset2017-03-221-0/+8
| | | | | | | | | | | | Game ported from D3D9 which expects sqrt() to compute the absolute value as explained in the spec. This gets rid of the NaN values as well as the black squares with RadeonSI. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97338 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: enable lower_sqrt() conditionallySamuel Pitoiset2017-03-221-0/+1
| | | | | | | It relies on the force_glsl_abs_sqrt driconf option. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* driconf: add force_glsl_abs_sqrt optionSamuel Pitoiset2017-03-225-0/+17
| | | | | | | | | This will allow to force computing the absolute value for sqrt() and inversesqrt() in order to follow D3D9 behaviour for buggy apps that rely on it. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* Android: drop Android 4.4 (KitKat) supportRob Herring2017-03-222-10/+0
| | | | | | | | | | | Any users of KitKat are likely using an older version of Mesa and KitKat support adds complexity to the make files. Dropping support allows removing the MESA_LOLLIPOP_BUILD make variable in various make files. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa/main: remove unused strndup.h includeEmil Velikov2017-03-221-1/+0
| | | | | | | | | No longer needed as of commit ac257f1070a ("glsl: calculate TOP_LEVEL_ARRAY_SIZE and STRIDE when adding resources") Reported-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* mesa/program: consistently use ifndef guards over pragma onceEmil Velikov2017-03-224-4/+9
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* mesa/main: consistently use ifndef guards over pragma onceEmil Velikov2017-03-225-3/+11
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* i965: consistently use ifndef guards over pragma onceEmil Velikov2017-03-224-3/+15
| | | | | | | | | | | The only remaining case is the brw_oa.py generator which pipes the generated file to stdout. That will be resolved with later commits. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* i965: make brw_setup_image_uniform_values staticEmil Velikov2017-03-221-1/+1
| | | | | | | | | | Used only internally. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* mesa: more unused linux/version.h includeEmil Velikov2017-03-221-3/+0
| | | | | | | The header provides the LINUX_VERSION_CODE and KERNEL_VERSION macros. With neither of which being used by any part of mesa. Signed-off-by: Emil Velikov <[email protected]>
* mesa/main: fix MultiDrawElements[BaseVertex] validation of primcountNicolai Hähnle2017-03-222-3/+23
| | | | | | | | | | | | | | | | | | | | | | | primcount must be a GLsizei as in the signature for MultiDrawElements or bad things can happen. Furthermore, an error should be flagged when primcount is negative. Curiously, this code used to work somewhat correctly even when primcount was negative, because the loop that checks count[i] would iterate out of bounds and almost certainly hit a negative value at some point. Found by an ASAN error in GL45-CTS.gtf32.GL3Tests.draw_elements_base_vertex.draw_elements_base_vertex_primcount Note that the OpenGL spec seems to have s/primcount/drawcount/ at some point, and the code still reflects the old language. v2: provide the correct spec quotes (pointed out by Ian) Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]>
* mesa: Avoid out-of-bounds stack read via _mesa_MaterialiNicolai Hähnle2017-03-221-2/+3
| | | | | | | | | | | | | | MATERIALFV may end up reading up to 4 floats from the passed parameter. This should really set a GL_INVALID_ENUM error in the cases where it matters, but does anybody really care? Found by ASAN in piglit gl-1.0-beginend-coverage. v2: fix a trivial compiler warning Reviewed-by: Marek Olšák <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]> (v1)
* i965/dri: Turn on support for image modifiersBen Widawsky2017-03-211-1/+1
| | | | | | | | All the plumbing is in place so the extension just needs to be advertised. Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/dri: Handle X-tiled modifierBen Widawsky2017-03-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't really "do" anything because the default tiling for the winsys buffer is X tiled. We do however want the X tiled modifier to work correctly from the API perspective, which would imply that if you set this modifier, and later do a get_modifier, you get back at least X tiled. Running with a modified kmscube, here are the bandwidth measurements. Linear: Read bandwidth: 1039.31 MiB/s Write bandwidth: 1453.56 MiB/s Y-tiled: Read bandwidth: 458.29 MiB/s Write bandwidth: 542.12 MiB/s X-tiled: Read bandwidth: 575.01 MiB/s Write bandwidth: 606.25 MiB/s Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/dri: Handle Y-tiled modifierBen Widawsky2017-03-211-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch begins introducing how we'll actually handle the potentially many modifiers coming in from the API, how we'll store them, and the structure in the code to support it. Prior to this patch, the Y-tiled modifier would be entirely ignored. It shouldn't actually be used until this point because we've not bumped the DRIimage extension version (which is a requirement to use modifiers). Measuring later in the series with kmscube: Linear: Read bandwidth: 1048.44 MiB/s Write bandwidth: 1483.17 MiB/s Y-tiled: Read bandwidth: 471.13 MiB/s Write bandwidth: 589.10 MiB/s Similar functionality was introduced and then reverted here: commit 6a0d036483caf87d43ebe2edd1905873446c9589 Author: Ben Widawsky <[email protected]> Date: Thu Apr 21 20:14:58 2016 -0700 i965: Always use Y-tiled buffers on SKL+ v2: Use last set bit instead of first set bit in modifiers to address bug found by Daniel Stone. v3: Use the new priority modifier selection thing. This nullifies the bug fixed by v2 also. v4: Get rid of modifier compaction which originally served another purpose and now serves none (Jason) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/dri: Handle the linear fb modifierBen Widawsky2017-03-211-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | At image creation create a path for dealing with the linear modifier. This works exactly like the old usage flags where __DRI_IMAGE_USE_LINEAR was specified. During development of this patch series, it was decided that a lack of modifier was an insufficient way to express the required modifiers. As a result, 0 was repurposed to mean a modifier for a LINEAR layout. NOTE: This patch was added for v3 of the patch series. v2: Rework the algorithm for modifier selection to go from a bitmask based selection to this priority value. v3: Make DRM_FORMAT_MOD_INVALID allowed at selection as a way of identifying no modifiers found (because 0 is LINEAR) (Jason) v4: Remove the logic to prune unknown modifiers (like those from other vendors) and simply handle is in select_best_modifier (Jason) Requested-by: Jason Ekstrand <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/dri: Enable modifier queriesBen Widawsky2017-03-212-0/+7
| | | | | | | | | | | | | | | | | | New to the patch series after reordering things for landing smaller chunks. This will essentially enable modifiers from clients that were just enabled in previous patches. A client could use the modifiers by setting all of them at create, but had no way to actually query them after creating the surface (ie. stupid clients could be broken before this patch, but in more ways than this). Obviously, there are no modifiers being actually stored yet - so this patch shouldn't do anything other than allow the API to get back 0 (or the LINEAR modifier). Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/dri: Store the screen associated with the imageBen Widawsky2017-03-212-6/+11
| | | | | | | | | | | | | | I intend to need to get to the devinfo structure, and storing the screen is an easy way to do that. It seems to be the consensus that you cannot share an image between multiple screens. Scape-goat: Rob Clark <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/dri: Disallow image with INVALID modifierBen Widawsky2017-03-211-0/+3
| | | | | Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>