aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* i965: Support images with aux buffersBen Widawsky2017-08-141-0/+6
| | | | | | | | | | | | | | Previously images did not support any auxiliary compression surfaces (CCS, MCS, or HiZ). That's about to change. This patch just adds the fields to __DRIimageRec to make auxiliary surfaces possible. v2 (Jason Ekstrand): - Add an aux_pitch parameter as well as aux_offset Signed-off-by: Ben Widawsky <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel/isl: Add support for I915_FORMAT_MOD_Y_TILED_CCSJason Ekstrand2017-08-142-0/+8
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/screen: Stop redefining DRM_FORMAT_MOD_(INVALID|LINEAR)Jason Ekstrand2017-08-141-8/+0
| | | | Reviewed-by: Ben Widawsky <[email protected]>
* drm-uapi/forcc: Pull in new modifiersJason Ekstrand2017-08-141-0/+31
| | | | Reviewed-by: Ben Widawsky <[email protected]>
* i965/blorp: Correct type of src_format in call to ↵Scott D Phillips2017-08-141-1/+2
| | | | | | | | | | | | | | | | | | intel_miptree_texture_aux_usage intel_miptree_texture_aux_usage() takes an isl_format, but we are passing a mesa_format. clang warns: brw_blorp.c:305:52: warning: implicit conversion from enumeration type 'mesa_format' to different enumeration type 'enum isl_format' [-Wenum-conversion] intel_miptree_texture_aux_usage(brw, src_mt, src_format); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~ Fixes: fc1639e46d ("i965/blorp: Use texture/render_aux_usage for blits") Cc: "17.2" <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* st/va: change frame_idx from array to hash tableJulien Isorce2017-08-144-6/+31
| | | | | | | | | | | | | | | | | | | | | | | The picture_id was assumed to be a frame number so in 0-31. But the vaapi client gstreamer-vaapi uses the surfaces handles as identifier which are unsigned int. This bug can happen when using a lot of vaapi surfaces within the same process. Indeed Mesa/st/va increments a counter for the surface ID: mesa/util/u_handle_table.c::handle_table_add which starts from 0 and incremented by 1 at each call. So creating more than 32 surfaces was a problem. The following bug contains a test that reproduces the problem by running a couple of vaapih264enc in the same process. The above also explains why there was no pb when running them in separated processes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102006 Signed-off-by: Julien Isorce <[email protected]> Tested-by: Tomas Rataj <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-and-tested-by: Boyuan Zhang <[email protected]>
* configure: Trust LLVM >= 4.0 llvm-config --libs for shared librariesMichel Dänzer2017-08-141-28/+30
| | | | | | | | | | | No need to manually look for the library files anymore with current LLVM. This sidesteps the manual method failing when LLVM was built with -DLLVM_APPEND_VC_REV=ON. (This might already work with older versions of LLVM) Acked-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nv50/ir: clean up saturated values immediatelyIlia Mirkin2017-08-121-1/+6
| | | | | | | | | | | | Since we don't iterate to a fixed point, we can end up in situations where we have a SAT instruction + a long immediate. This is not legal. However since it's immediately computable, just run unary straight away to handle the situation. Fixes: 24a799ad35a82 ("nv50/ir: fix ConstantFolding with saturation") Reported-by: Tobias Klausmann <[email protected]> Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* nvc0/ir: unlink values pre- and post-call to division functionIlia Mirkin2017-08-121-4/+3
| | | | | | | | | While technically correct, this can lead to e.g. getImmediate assuming that it can walk up the value chain. It could be fixed to not do this, but it seems easier and less error-prone to just not link the two values to save on one LValue object. Signed-off-by: Ilia Mirkin <[email protected]>
* i965: Guard GetBufferSubData's streaming memcpy load with USE_SSE41Kenneth Graunke2017-08-121-0/+2
| | | | | | | | | | This should hopefully fix build issues on 32-bit Android-x86. v2: s/USE_SSE4_1/USE_SS41/, caught by Gražvydas Ignotas. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102050 Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965: Clean up intel_batchbuffer_init().Kenneth Graunke2017-08-123-12/+11
| | | | | | | | | | | | | Passing screen lets us get the kernel features, devinfo, and bufmgr, without needing container_of. This use of container_of could cause crashes due to issues with the "sample" macro parameter. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102062 Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* gallium/radeon: only pass shader-specific debug flags to the disk shader cacheMarek Olšák2017-08-111-1/+8
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi/gfx9: fix the scissor bug workaroundMarek Olšák2017-08-111-3/+7
| | | | | | | | otherwise there is corruption in most apps. Fixes: 0fe0320 radeonsi: use optimal packet order when doing a pipeline sync Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi/gfx9: use the VI codepath for clamping ZMarek Olšák2017-08-112-12/+2
| | | | | | | | | This fixes corrupted shadows in Unigine Valley. The corruption disappeared when I stopped setting IMG_DATA_FORMAT_24_8 for depth. Cc: 17.2 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* egl: Update headers from KhronosDaniel Stone2017-08-114-42/+673
| | | | | | Taken from egl-registry 7d68647c4dab. Signed-off-by: Daniel Stone <[email protected]>
* egl/dri2: Allow modifiers to add FDs to importsDaniel Stone2017-08-111-19/+19
| | | | | | | | | When using dmabuf import, make sure that the modifier is actually allowed to add planes to the base format, as implied by the comment. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Philipp Zabel <[email protected]>
* intel/compiler: properly size attribute wa_flags array for VulkanIago Toral Quiroga2017-08-111-1/+17
| | | | | | | | | | | | | | | | | | Mesa will map user defined vertex input attributes to slots starting at VERT_ATTRIB_GENERIC0 which gives us room for only 16 slots (up to GL_VERT_ATTRIB_MAX). This sufficient for GL, where we expose exactly 16 vertex attributes for user defined inputs, but in Vulkan we can expose up to 28 (which are also mapped from VERT_ATTRIB_GENERIC0 onwards) so we need to account for this when we scope the size of the array of attribute workaround flags that is used during the brw_vertex_workarounds NIR pass. This prevents out-of-bounds accesses in that array for NIR shaders that use more than 16 vertex input attributes. Fixes: dEQP-VK.pipeline.vertex_input.max_attributes.* Acked-by: Lionel Landwerlin <[email protected]>
* glsl: stop cloning builtin fuctions _mesa_glsl_find_builtin_function()Timothy Arceri2017-08-111-10/+1
| | | | | | | | | | | | | | | | | | | | | The cloning was introduced in f81ede469910d to fix a problem with shaders including IR that was owned by builtins. However the approach of cloning the whole function each time we reference a builtin lead to a significant reduction in the GLSL IR compilers performance. The previous patch fixes the ownership problem in a more precise way. So we can now remove this cloning. Testing on a Ryzen 7 1800X shows a ~15% decreases in compiling the Deus Ex: Mankind Divided shaders on radeonsi (which take 5min+ on some machines). Looking just at the GLSL IR compiler the speed up is ~40%. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: pass mem_ctx to constant_expression_value(...) and friendsTimothy Arceri2017-08-1122-90/+168
| | | | | | | | | | | | | | | | | | | | The main motivation for this is that threaded compilation can fall over if we were to allocate IR inside constant_expression_value() when calling it on a builtin. This is because builtins are shared across the whole OpenGL context. f81ede469910d worked around the problem by cloning the entire builtin before constant_expression_value() could be called on it. However cloning the whole function each time we referenced it lead to a significant reduction in the GLSL IR compiler performance. This change along with the following patch helps fix that performance regression. Other advantages are that we reduce the number of calls to ralloc_parent(), and for loop unrolling we free constants after they are used rather than leaving them hanging around. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: use ralloc_str_append() rather than ralloc_asprintf_rewrite_tail()Timothy Arceri2017-08-111-31/+113
| | | | | | | | | | | | | | The Deus Ex: Mankind Divided shaders go from spending ~20 seconds in the GLSL IR compilers front-end down to ~18.5 seconds on a Ryzen 1800X. Tested by compiling once with shader-db then deleting the index file from the shader cache and compiling again. v2: - fix rebasing issue in v1 Reviewed-by: Thomas Helland <[email protected]>
* util/ralloc: add ralloc_str_append() helperTimothy Arceri2017-08-112-0/+37
| | | | | | | | This function differs from ralloc_strcat() and ralloc_strncat() in that it does not do any strlen() calls which can become costly on large strings. Reviewed-by: Thomas Helland <[email protected]>
* glsl: remove unused field from ir_callTimothy Arceri2017-08-111-5/+0
| | | | | Reviewed-by: Thomas Helland <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* glsl: stop copying struct and interface member namesTimothy Arceri2017-08-1113-59/+50
| | | | | | | | | | | We are currently copying the name for each member dereference but we can just share a single instance of the string provided by the type. This change also stops us recalculating the field index repeatedly. Reviewed-by: Thomas Helland <[email protected]>
* glsl: tidy up get_num_operands()Timothy Arceri2017-08-112-14/+9
| | | | | | | | | | | Also add a comment that this should only be used by the ir_reader interface for testing purposes. v2: - fix grammar in comment - use unreachable rather than assert Reviewed-by: Thomas Helland <[email protected]>
* glsl: calculate number of operands in an expression onceTimothy Arceri2017-08-1122-32/+103
| | | | | | | | | | | | | | | | | | | Extra validation is added to ir_validate to make sure this is always updated to the correct numer of operands, as passes like lower_instructions modify the instructions directly rather then generating a new one. The reduction in time is so small that it is not really measurable. However callgrind was reporting this function as being called just under 34 million times while compiling the Deus Ex shaders (just pre-linking was profiled) with 0.20% spent in this function. v2: - make num_operands a unit8_t - fix unsigned/signed mismatches Reviewed-by: Thomas Helland <[email protected]>
* isl: Validate row pitch of stencil surfaces.Kenneth Graunke2017-08-101-2/+7
| | | | | | | | | | | | Also, silence an obnoxious finishme that started occurring for all GL applications which use stencil after the i965 ISL conversion. v2: Check against 3DSTATE_STENCIL_BUFFER's pitch bits when using separate stencil, and 3DSTATE_DEPTH_BUFFER's bits when using combined depth-stencil. Cc: "17.2" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* egl: avoid eglCreatePlatform*Surface{EXT,} crash with invalid dpyEmil Velikov2017-08-101-2/+2
| | | | | | | | | | | | | | | | | | If we have an invalid display fed into the functions, the display lookup will return NULL. Thus as we attempt to get the platform type, we'll deref. it leading to a crash. Keep in mind that this will not happen if Mesa is built without X11 or when the legacy eglCreate*Surface codepaths are used. A similar check was added with earlier commit 5e97b8f5ce9 ("egl: Fix crashes in eglCreate*Surface), although it was only applicable when the surfaceless platform is built. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl/drm: rename dri2_drm_create_surface()Emil Velikov2017-08-101-13/+4
| | | | | | | | | | | | The function can handle only window surfaces, so let's rename it accordingly, killing the wrapper around it. v2: Use native_window in the function args. list. Suggested-by: Eric Engestrom <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/drm: remove unreachable code in dri2_drm_create_surface()Emil Velikov2017-08-101-13/+7
| | | | | | | | | | | The function can be called only when the type is EGL_WINDOW_BIT. Remove the unneeded switch statement. v2: Rename the local variable window to surface (Eric) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> (v1)
* egl/x11: pass NULL instead of XCB_WINDOW_NONE as native_surfaceEmil Velikov2017-08-102-2/+2
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: Clean up native_type vs drawable messMatt Turner2017-08-102-8/+5
| | | | | | | | | | | | | The next patch is going to stop passing XCB_WINDOW_NONE (of type xcb_window_enum_t) as an argument where these functions expect a void *, which clang does not appreciate. This patch cleans things up to better convince me and reviewers that it's safe to do that. v2: Emil Velikov: rebase/integrate with series Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: handle BAD_NATIVE_PIXMAP further up the stackEmil Velikov2017-08-102-5/+3
| | | | | | | | | | | | The basic (null) check is identical across all backends. Just move it to the top. v2: - Split the WINDOW vs PIXMAP into separate patches - Move check after the dpy and config - dEQP expects so Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: drop unreachable BAD_NATIVE_WINDOW conditionsEmil Velikov2017-08-104-15/+3
| | | | | | | | | | | | | The code in _eglCreateWindowSurfaceCommon() already has a NULL check which handles the condition. There's no point in checking again further down the stack. v2: Split the WINDOW vs PIXMAP into separate patches v3: Resolve typos, s/EGL_PIXMAP_BIT_BIT/EGL_PIXMAP_BIT/ Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: add dri2_setup_swap_interval helperEmil Velikov2017-08-104-63/+49
| | | | | | | | | | | | | | | | The current two implementations - X11 and Wayland were identical, barrind the upper limit. Instead of having same code twice - introduce a helper and pass the limit as an argument. Thus as Android/DRM/others get support - they only need to call the function ;-) v2: Rebase on top of keeping ::swap_available Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1)
* configure: remove trailing "-a" in swr architecture testTim Rowley2017-08-101-1/+1
| | | | | | | Fixes "configure: line 27326: test: argument expected" CC: [email protected] Reviewed-by: Matt Turner <[email protected]>
* build: Fix up spirv_info.PloMatt Turner2017-08-101-0/+2
| | | | | | | | | | | | | spirv_info.c existed as a static file until commit 2dd4e2ece32f began generating it as part of the build process. autotools is incapable of coping, and so a build-tree from before this commit would then fail with it: [4]: *** No rule to make target '../../../mesa/src/compiler/spirv/spirv_info.c', needed by 'spirv/spirv_info.lo'. Stop. Add a few lines to configure.ac to update the broken build files. Reviewed-by: Emil Velikov <[email protected]>
* ac: fail shader compilation if libelf is replaced by an incompatible versionMarek Olšák2017-08-103-4/+15
| | | | | | | | | | | | UE4Editor has this issue. This commit prevents hangs (release build) or assertion failures (debug build). It doesn't fix the editor, but catastrophic scenarios are prevented. Cc: 17.1 17.2 <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* dri: Introduce SWAP_METHOD tokensThomas Hellstrom2017-08-109-11/+35
| | | | | | | | | | | | We shouldn't be using GLX tokens in the dri subsystem, so define dri SWAP_METHOD tokens and translate when necessary. Unfortunately the X server uses the dri swap method value untranslated as the GLX fbconfig swapMethod, so we can't enumerate these tokens arbitrarily, but rather need to make them have the same values as the corresponding GLX tokens. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* glx: Fix swap method config matchingThomas Hellstrom2017-08-101-3/+1
| | | | | | | | | | Due to bugs in dri swap method reporting, neither the fbconfigs received from the server nor the value reported from driconfigs were correct. Now that's been fixed and we can enable config swapmethod matching again. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* glx: Work around X servers reporting bogus values of GLX_SWAP_METHOD_OMLThomas Hellstrom2017-08-101-1/+11
| | | | | | | | | | | | | | | Due to the recently fixed bug where dri drivers didn't report a correct __DRI_ATTRIB_SWAP_METHOD value, and the fact that X servers just forward this incorrect value (from the AIGLX dri driver) untranslated as GLX_SWAP_METHOD_OML, the latter value might be undefined when old dri AIGLX drivers are used, which breaks client fbconfig matching with server fbconfigs. So work around this by assuming GLX_SWAP_METHOD_UNDEFINED when a bogus value is read. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* dri: Fix __DRIconfig reporting of __DRI_ATTRIB_SWAP_METHODThomas Hellstrom2017-08-103-7/+6
| | | | | | | | | | | | | | The attribMap had two entries for this attribute, and driGetConfigAttribIndex didn't return a proper value for this attribute. Fix this, and also make sure we return SWAP_UNDEFINED for single-buffer configs as required by the GLX_OML_swap_method spec. Finally bump the dri core extension version to 2, indicating that we correctly report __DRI_ATTRIB_SWAP_METHOD. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* radv: force cs/ps/l2 flush at end of command stream. (v2)Dave Airlie2017-08-091-1/+4
| | | | | | | | | | | | | | | | | | | | This seems like a workaround, but we don't see the bug on CIK/VI. On SI with the dEQP-VK.memory.pipeline_barrier.host_read_transfer_dst.* tests, when one tests complete, the first flush at the start of the next test causes a VM fault as we've destroyed the VM, but we end up flushing the compute shader then, and it must still be in the process of doing something. Could also be a kernel difference between SI and CIK. v2: hit this with a bigger hammer. This fixes a bunch of hangs in the vk cts with the robustness tests. Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101334 Acked-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* nv50/ir: fix ConstantFolding with saturationKarol Herbst2017-08-092-0/+9
| | | | | | | | | | | | | | | | | For mul(a, +-1) codegen can generate OP_MOV with a saturation flag set which is ignored at emission. The same can happen with add(a, 0), and others. Adding an assert for detecting more of such issues. Fixes wrongly rendered water in Hitman Absolution running under wine. Also a few shaders in Mad Max and Alien Isolation produce such MOVs. CC: <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Tobias Klausmann <[email protected]> [imirkin: generalize the fix for other cases] Reviewed-by: Ilia Mirkin <[email protected]>
* st/dri2: fix kms_swrast driconf option handlingRob Herring2017-08-091-3/+3
| | | | | | | | | | | | | Commit e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader") moved the option cache to the pipe_loader_device. However, the screen->dev pointer is not set when dri_init_options() is called. Move the call to after the pipe_loader_sw_probe_kms() call so screen->dev is set. This mirrors the code flow for dri2_init_screen(). Fixes: e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader") Reviewed-by: Nicolai Hähnle <[email protected]> Cc: Marek Olšák <[email protected]> Signed-off-by: Rob Herring <[email protected]>
* radeonsi: drop two unused variables in create_function()Samuel Pitoiset2017-08-091-2/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: whitespace cleanup in eglapi.cEric Engestrom2017-08-091-25/+25
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* TextureStorage1D should return INVALID_OPERATION if target is not a 1D textureIago Toral Quiroga2017-08-091-1/+1
| | | | | | | | | | Previous behavior was inconsistent with other texture targets so this has been fixed in OpenGL 4.6. Fixes: KHR-GL45.direct_state_access.textures_storage_errors Reviewed-by: Jordan Justen <[email protected]>
* Update TextureParameter* error for incompatible texture targetsIago Toral Quiroga2017-08-091-1/+1
| | | | | | | | | | | The OpenGL 4.6 specs have been updated so that GetTextureParameter* with a texture object with an incompatible TEXTURE_TARGET should now report INVALID_OPERATION instead of INVALID_ENUM. Fixes: KHR-GL45.direct_state_access.textures_parameter_errors Reviewed-by: Jordan Justen <[email protected]>
* egl/dri2: refactor dri2_query_surface, swrastGetDrawableInfoTapani Pälli2017-08-091-7/+18
| | | | | | | | | | | | | | Currently swrastGetDrawableInfo always initializes w and h, patch refactors function as x11_get_drawable_info that returns success and sets the values only if no error happened. Add swrastGetDrawableInfo wrapper function as expected by DRI extension. v2: init w,y,w,h in swrastGetDrawableInfo (Eric) Signed-off-by: Tapani Pälli <[email protected]> Reported-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965/bufmgr: Set bo->idle after waiting.Kenneth Graunke2017-08-081-0/+2
| | | | | | | | | | After a successful wait, we know the buffer ought to be idle. Chris points out that: "The only caveat here is that bo is global, and we have a very unlikely (and probably unnoticeable) race condition with multiple contexts." Reviewed-by: Chris Wilson <[email protected]>