summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* anv: Stop bounds-checking pushed UBOsJason Ekstrand2019-11-201-36/+10
| | | | | | | | | | | | | | | The bounds checking is actually less safe than just pushing the data. If the bounds checking actually ever kicks in and it's not on the last UBO push range, then the shrinking will cause all subsequent ranges to be pushed to the wrong place in the GRF. One of the behaviors we definitely don't want is for OOB UBO access to result in completely unrelated UBOs returning garbage values. It's safer to just push the UBOs as-requested. If we're really concerned about robustness, we can emit shader code to do bounds checking which should be stupid cheap (a CMP followed by SEL). Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]>
* Call shmget() with permission 0600 instead of 0777Brian Paul2019-11-203-3/+6
| | | | | | | | | | | | | | | A security advisory (TALOS-2019-0857/CVE-2019-5068) found that creating shared memory regions with permission mode 0777 could allow any user to access that memory. Several Mesa drivers use shared- memory XImages to implement back buffers for improved performance. This path changes the shmget() calls to use 0600 (user r/w). Tested with legacy Xlib driver and llvmpipe. Cc: [email protected] Reviewed-by: Kristian H. Kristensen <[email protected]> (cherry picked from commit 02c3dad0f3b4d26e0faa5cc51d06bc50d693dcdc)
* i965: Unify CC_STATE and BLEND_STATE atoms on Haswell as a workaroundDanylo Piliaiev2019-11-201-2/+35
| | | | | | | | | | | | | | | | | | | | Re-emitting 3DSTATE_CC_STATE_POINTERS after emitting 3DSTATE_BLEND_STATE_POINTERS fixes the shadow flickering in SuperTuxCart and Tropico 6 which was seen only on Haswell. The reason for this is unknown and fix was found empirically. The closest mention in PRM is that it should improve performance. From the HSW PRM, volume 2b, page 823 (3DSTATE_BLEND_STATE_POINTERS): "When the BLEND_STATE pointer changes but not the CC_STATE pointer, driver needs to force a CC_STATE pointer change to improve blend performance in pixel backend." Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1834 Fixes: eca4a654 ("i965: Disable dual source blending when shader doesn't support it on gen8+") Cc: <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit 6f17fe0606a144f977d8b70a7ee9f8371abc144b)
* llvmpipe: use ppc64le/ppc64 Large code model for JIT-compiled shadersBen Crocker2019-11-201-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Large programs, e.g. gnome-shell and firefox, may tax the addressability of the Medium code model once a (potentially unbounded) number of dynamically generated JIT-compiled shader programs are linked in and relocated. Yet the default code model as of LLVM 8 is Medium or even Small. The cost of changing from Medium to Large is negligible: - an additional 8-byte pointer stored immediately before the shader entrypoint; - change an add-immediate (addis) instruction to a load (ld). Testing with WebGL Conformance (https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html) yields clean runs with this change (and crashes without it). Testing with glxgears shows no detectable performance difference. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1753327, 1753789, 1543572, 1747110, and 1582226 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/223 Co-authored by: Nemanja Ivanovic <[email protected]>, Tom Stellard <[email protected]> CC: [email protected] Signed-off-by: Ben Crocker <[email protected]> (cherry picked from commit 9c3be6d21fa6a45852045d0286b80fb420f82fe3) Conflicts resolved Dylan (PIPE_ARCH -> UTIL_ARCH rename)
* radeonsi: fix shader disk cache keyPierre-Eric Pelloux-Prayer2019-11-201-2/+3
| | | | | | | Use unsigned values otherwise signed extension will produce a 64 bits value where the 32 left-most bits are 1. Fixes: 2afeed30101 ("radeonsi: tell the shader disk cache what IR is used")
* radeonsi: tell the shader disk cache what IR is usedPierre-Eric Pelloux-Prayer2019-11-201-7/+10
| | | | | | | | | | | | | | | Until 8bef4df196fbb the IR (TGSI or NIR) was used in disk_cache driver_flags. This commit restores this features to avoid crashing when switching from one IR to the other. As radeonsi's default is TGSI, I used "driver_flags & 0x8000000 = 0" for TGSI to keep the same driver_flags. Fixes: 8bef4df196f ("radeonsi: add si_debug_options for convenient adding/removing of options") Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi: disable sdma for gfx10Pierre-Eric Pelloux-Prayer2019-11-201-1/+7
| | | | | | | | | | Disable sdma on gfx10 until all timeouts bugs are fixed. See: https://gitlab.freedesktop.org/mesa/mesa/issues/1907 https://bugs.freedesktop.org/show_bug.cgi?id=111481 Reviewed-by: Marek Olšák <[email protected]>
* tgsi_to_nir: handle PIPE_FORMAT_NONE in image opcodesMarek Olšák2019-11-201-0/+3
| | | | | | | | radeonsi doesn't use the format and internal shaders don't set it. Reviewed-By: Timur Kristóf <[email protected]> (cherry picked from commit f704fb7f0ba5c230ec9558621484acebb927a315) Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2112
* tgsi_to_nir: fix masked out image loadsMarek Olšák2019-11-191-2/+1
| | | | | | | | This caused a failure in NIR validation. Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (cherry picked from commit 3906fce88bb473f283e4b064cc996ea6aa6d2922)
* mesa/main: Ignore filter state for MS texture completenessIllia Iorin2019-11-191-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | After the discussion in https://github.com/KhronosGroup/OpenGL-API/issues/45 the section 8.17 (texture completeness) of the OpenGL 4.6 core profile was changed to explicitly say that multisample texture completeness ignores filter state of the texture. "Using the preceding definitions, a texture is complete unless any of the following conditions hold true: ... - The minification filter requires a mipmap (is neither NEAREST nor LINEAR), the texture is not multisample, and the texture is not mipmap complete. - The texture is not multisample; either the magnification filter is not NEAREST, or the minification filter is neither NEAREST nor NEAREST_- MIPMAP_NEAREST; and any of – The internal format of the texture is integer (see table 8.12). – The internal format is STENCIL_INDEX. – The internal format is DEPTH_STENCIL, and the value of DEPTH_- STENCIL_TEXTURE_MODE for the texture is STENCIL_INDEX." Signed-off-by: Danylo Piliaiev <[email protected]> Signed-off-by: Illia Iorin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 6b672e342a367c11c23690c5b309617a0b6e9c40)
* nir/algebraic: Mark other comparison exact when removing a == aIan Romanick2019-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents some additional optimizations that would change the original result. This includes things like (b < a && b < c) => b < min(a, c) and !(a < b) => b >= a. Both of these optimizations were specifically observed in the piglit tests added in piglit!160. This was discovered while investigating https://gitlab.freedesktop.org/mesa/mesa/issues/1958. However, the problem in that issue was Chrome or Angle is replacing calls to isnan() with some stuff that we (correctly) optimize to false. If they had left the calls to isnan() alone, everything would have just worked. No shader-db changes on any Intel platform. I also tried marking the comparison generated by the isnan() function precise. The precise marker "infects" every computation involved in calculating the parameter to the isnan() function, and this severely hurt all of the (few) shaders in shader-db that use isnan(). I also considered adding a new ir_unop_isnan opcode that would implement the functionality. During GLSL IR-to-NIR translation, the resulting comparison operation would be marked exact (and the samething would need to happen in SPIR-V translation). This approach taken by this patch seemed easier, but we may want to do the ir_unop_isnan thing anyway. Fixes: d55835b8bdf ("nir/algebraic: Add optimizations for "a == a && a CMP b"") Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Connor Abbott <[email protected]> (cherry picked from commit 9be4a422a055d1e829d56c3cc91e1fc2f6e8fb31)
* nir/algebraic: Add the ability to mark a replacement as exactIan Romanick2019-11-194-3/+13
| | | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Connor Abbott <[email protected]> (cherry picked from commit ea19f2fb68f54171683b6c490b2cd6df96f854c7)
* intel/compiler: fix nir_op_{i,u}*32 on ICLPaulo Zanoni2019-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | On ICL we have the src1 restriction which is applied through fix_byte_src() and potentially changes the type of the operands from 8 to 32 bits. When this change happens, we fall into the "else if (bit_size < 32)" case and miscompute src_type because it takes into consideration bit_size (8) instead of the adjusted size of temp_op (32). This results in the shader reading unused memory, giving us mostly failures, but occasional passes due to whatever was already in the registers we were reading. This commit fixes a lot of dEQP subgroup i8vec2 tests on ICL, such as: dEQP-VK.subgroups.arithmetic.compute.subgroupadd_i8vec2 This can also be verified by simply changing fix_byte_src() to apply on all platforms. Fixes: 5847de6e9afe ("intel/compiler: don't use byte operands for src1 on ICL") Reviewed-by: Ivan Briano <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Paulo Zanoni <[email protected]> (cherry picked from commit eb6352162dde1445f1fe7a408e79f4ecfdf3703c)
* st/mesa: fix Sanctuary and Tropics by disabling ARB_gpu_shader5 for themMarek Olšák2019-11-196-1/+12
| | | | | | | | They use the "sample" keyword as a variable name. Cc: 19.2 19.3 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> (cherry picked from commit e00791c5525000652472cdcfe55d59f43ec3d85e)
* anv/wsi: signal the semaphore in the acquireNextImageLionel Landwerlin2019-11-191-4/+20
| | | | | | | | | | | | We seem to have forgotten about the semaphore in the acquireNextImageInfo. v2: Signal semaphore/fence regardless of presentation status (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> (cherry picked from commit edc6606d4e515707b22674a0b3357c02de52378e)
* anv: remove list items on batch finiLionel Landwerlin2019-11-191-1/+4
| | | | | | | | | | | | | | This doesn't seem to fix anything because those destroy() calls happen right before the command buffer object & its list of batch_bo is also destroyed. Still looks a bit cleaner. v2: Found a second occurence Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> (v2) Fixes: 26ba0ad54d ("vk: Re-name command buffer implementation files") Cc: <[email protected]> (cherry picked from commit 935f8f0e56a409b10fac86e18f68be776cdff29f)
* anv: invalidate file descriptor of semaphore sync fd at vkQueueSubmitLionel Landwerlin2019-11-191-2/+4
| | | | | | | | | | | | | | | | | | | We always close the in_fence at the end the anv_cmd_buffer_execbuf() so when we take it from the semaphore, let's not forget to invalidate it. Note that the code leaks the fence_in if we get any error before reaching the close(). Let's fix that in another patch or better, rewrite the whole thing! v2: drop redundant fd = -1 (Jason) v3: Update commit message (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> (cherry picked from commit 048f0690ee4b39f865d4d6ad82a6c0290dcaaf41)
* egl: fix _EGL_NATIVE_PLATFORM fallbackEric Engestrom2019-11-131-9/+0
| | | | | | | | | | When the X11 or Haiku platforms were compiled in, they would bypass the `_EGL_NATIVE_PLATFORM` fallback by always returning themselves instead. Cc: [email protected] Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 86d3a346f1576acb6c2f8c3be3853a6a3e226b5c)
* spirv: Don't leak GS initialization to other stagesCaio Marcelo de Oliveira Filho2019-11-131-1/+2
| | | | | | | | | | | | | The stage specific fields of shader_info are in an union. We've likely been lucky that this value was either overwritten or ignored by other stages. The recent change in shader_info layout in commit 84a1a2578da ("compiler: pack shader_info from 160 bytes to 96 bytes") made this issue visible. Fixes: cf2257069cb ("nir/spirv: Set a default number of invocations for geometry shaders") Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 087ecd9ca58a84cf85e66323b44140e7304d5f93)
* gallium: dri2: Use index as plane number.Lepton Wu2019-11-131-1/+1
| | | | | | | | | | | This fix wrong color when playing video under Android + virgl configuration. Fixes: 2decad495f3 ("gallium/dri2: Support images with multiple planes for modifiers") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Lepton Wu <[email protected]> (cherry picked from commit 5a40e153fd7df58a6419cf2e6211828d7d31cf4e)
* mesa: check framebuffer completeness only after state updateLionel Landwerlin2019-11-131-6/+6
| | | | | | | | | | | | | The change made in 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv") correctly updated the state prior to checking the framebuffer completeness on glClearBufferiv but not in glClearBufferfi. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Fixes: 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2072 (cherry picked from commit f93bb903020bac21a36e240b2c19a4733c2405ee)
* meson: Add dep_glvnd to egl deps when building with glvndDylan Baker2019-11-051-1/+2
| | | | | | | | | | | | Otherwise if glvnd is not installed systemwide, but only in a prefix, it's headers wont be found. This happens because if it's headers are in /usr/include/ then another dependence will provide the necessary -I arguments and compilation will work. Fixes: 035ec7a2bb2d5e413ac945b8f012185a0e187d5e ("meson: Add support for EGL glvnd") Acked-by: Eric Engestrom <[email protected]> (cherry picked from commit 5d085ad052aac1f35cef7b60c0e6ecad65a6807b)
* intel/compiler: remove the operand restriction for src1 on GLKPaulo Zanoni2019-11-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 5847de6e9afe implemented a restriction that applies to ICL, but wrongly marked it as also applying to GLK. Reviewers or MR !1125 pointed this, and the commit history shows removal of GLK to parts of the patch, but it turns there was still a left-over GLK check in the code. This code was breaking some of the i8vec2 tests on GLK, for example: dEQP-VK.subgroups.arithmetic.compute.subgroupadd_i8vec2 Removing the GLK check solves the issue for GLK. I don't see a reason on why implementing this restriction would actually break GLK, so there's still more to investigate here since this bug may be affecting ICL+, but let's apply the real GLK fix while we analyze and discuss the other possible issues. Fixes: 5847de6e9afe ("intel/compiler: don't use byte operands for src1 on ICL") BSpec: 3017 Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Paulo Zanoni <[email protected]> (cherry picked from commit b57383a9445eae153fbf91fad8592d273b14e546)
* iris: Fix "Force Zero RTA Index Enable" setting againKenneth Graunke2019-11-051-1/+1
| | | | | | | | | | | In 2ca0d913ea8, we began updating cso_fb->layers to the actual layer count, rather than 0. This fixed cases where we were setting "Force Zero RTA Index Enable" even when doing layered rendering. Sadly, it also broke the check entirely: cso_fb->layers is now 1 for non-layered cases, but the Force Zero RTA Index check was still comparing for 0. Fixes: 2ca0d913ea8 ("iris: Fix framebuffer layer count") (cherry picked from commit fc7b7480867d6049ca12f87d9b6ab0d9ad55d59f)
* nir: correct use of identity check in pythonDylan Baker2019-11-051-2/+2
| | | | | | | | | | | Python has the identity operator `is`, and the equality operator `==`. Using `is` with strings sometimes works in CPython due to optimizations (they have some kind of cache), but it may not always work. Fixes: 96c4b135e34d0804e41bfbc28fc1b5050c49d71e ("nir/algebraic: Don't put quotes around floating point literals") Reviewed-by: Matt Turner <[email protected]> (cherry picked from commit 717606f9f32af6540b68336e676fca9dd16f282a)
* Fix timespec_from_nsec test for 32-bit time_tJon Turney2019-11-041-1/+1
| | | | | | | | | | | Since struct timespec's tv_sec member is of type time_t, adjust the expected value to allow for the truncation which will occur with 32-bit time_t. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Adam Jackson <[email protected]> (cherry picked from commit dd1dba80b9ee74ec8b90761285a8262e374bf8ef) Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2043
* mesa: check draw buffer completeness on glClearBufferfi/glClearBufferivLionel Landwerlin2019-11-041-0/+12
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 88d665830f27087cb2188e03b0b734acc144c593)
* anv/tests: Zero-initialize instancesJason Ekstrand2019-11-046-6/+14
| | | | | | | | | Some of the tests were actually relying on some of those uninitialized bits to be non-zero. In particular, a couple want use_softpin = true. Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]> (cherry picked from commit 9076e9f3751341063679eb227116060070549a37)
* anv: Fix a potential BO handle leakJason Ekstrand2019-11-041-1/+3
| | | | | | Fixes: 731c4adcf9b "anv/allocator: Add support for non-userptr" Reviewed-by: Lionel Landwerlin <[email protected]> (cherry picked from commit bb257e1852473e3bc49bb9e0fe014741894f7bd0)
* mesa: enable msaa in clear_with_quad if neededPierre-Eric Pelloux-Prayer2019-11-041-0/+1
| | | | | | | | | | | | If the DrawBuffer sample count is > 1 and msaa is enabled we must also enable msaa when clearing it. Fixes: ea5b7de138b ("radeonsi: make gl_SampleMaskIn = 0x1 when MSAA is disabled") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1991 Reviewed-by: Marek Olšák <[email protected]> Tested-by: Witold Baryluk <[email protected]> (cherry picked from commit 8a723282e3f7a312ab0ca3aa9157e5b76ec182af)
* anv: Remove _mesa_locale_init/fini calls.Bas Nieuwenhuizen2019-11-041-3/+0
| | | | | | | | | | The resulting locale is not used for Vulkan, and it is not reference counted, giving issues when multiple instances are created. CC: 19.2 19.3 <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit 3e86d553a470c484b6a2c60bc7866759ec21fea5)
* turnip: Remove _mesa_locale_init/fini calls.Bas Nieuwenhuizen2019-11-041-3/+0
| | | | | | | | | | The resulting locale is not used for Vulkan, and it is not reference counted, giving issues when multiple instances are created. CC: 19.2 19.3 <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit 72f858fc07746eb1d7360b47636006202a075e84)
* radv: Remove _mesa_locale_init/fini calls.Bas Nieuwenhuizen2019-11-041-3/+0
| | | | | | | | | | The resulting locale is not used for Vulkan, and it is not reference counted, giving issues when multiple instances are created. CC: 19.2 19.3 <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit 344ba56b0f36e77c3d4a935717854f1bf8000a2e)
* radv: Fix timeout handling in syncobj wait.Bas Nieuwenhuizen2019-11-041-1/+1
| | | | | | | | libdrm returns -errno instead of directly the ioctl ret of -1. Fixes: 1c3cda7d277 "radv: Add syncobj signal/reset/wait to winsys." Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit ec770085c270cb167c02f299f6985744682933b1)
* nv50/ir: mark STORE destination inputs as usedIlia Mirkin2019-11-041-0/+6
| | | | | | | | | | | Observed an issue when looking at the code generatedy by the image-vertex-attrib-input-output piglit test. Even though the test itself worked fine (due to TIC 0 being used for the image), this needs to be fixed. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] (cherry picked from commit 1b9d1e13d8e14c348f6d6c8fab5f31e8768a1371)
* etnaviv: fix depth biasJonathan Marek2019-10-312-1/+2
| | | | | | | | | | | Fixes remaining failures in these deqp tests (tested on GC3000/GC7000L): dEQP-GLES2.functional.polygon_offset.* Fixes: 6c3c05dc ("etnaviv: fix polygon offset") Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 7b524e1acbe7d704a9920302529a0e02e8ef9a55)
* intel/blorp: Assign correct view while clearing depth stencilSagar Ghuge2019-10-301-1/+1
| | | | | | | | | | | We never saw any failures regarding this typo but it's good to assign correct stencil view while constructing blorp_params. Fixes: 0cabf93b80d0 "intel/blorp: Add an entrypoint for clearing depth and stencil" Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Nanley Chery <[email protected]> (cherry picked from commit ce208be2d8793029c5abbde51c972ad1f4166701)
* anv: Fix output of INTEL_DEBUG=bat for chained batchesCaio Marcelo de Oliveira Filho2019-10-291-1/+1
| | | | | | | | | | | The anv_batch_bo contents are linked one to another, and when printing we have to start with the first of those. Since in `u_vector` new elements are added to the head, to get the first element we need the vector's tail. Fixes: 32ffd90002b ("anv: add support for INTEL_DEBUG=bat") Reviewed-by: Lionel Landwerlin <[email protected]> (cherry picked from commit e2155158e99e405313d6bc4d4478b92b4234dc4e)
* iris: Disallow incomplete resource creationNanley Chery2019-10-291-2/+6
| | | | | | | | | If a modifier specifies an aux, it must be created. Fixes: 75a3947af46 ("iris/resource: Fall back to no aux if creation fails") Reviewed-by: Sagar Ghuge <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit d298740a1c1c7798d21a0978d6fa5f72ee97b9fe)
* iris: Don't leak the resource for unsupported modifierNanley Chery2019-10-291-1/+1
| | | | | | | | | Make sure the res struct is free'd before returning. Fixes: 2dce0e94a3d ("iris: Initial commit of a new 'iris' driver for Intel Gen8+ GPUs.") Reviewed-by: Sagar Ghuge <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit f2fc5dece93019f0bab203247985cf350d541156)
* iris: Clear ::has_hiz when disabling auxNanley Chery2019-10-291-0/+1
| | | | | | Fixes: 2cddc953cd0 ("iris: some initial HiZ bits") Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit 6cd9731d96c4a48252b91881491aa43ba565bf95)
* intel/blorp: Disable depth testing for slow depth clearsNanley Chery2019-10-291-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll start doing slow depth clears more often on HIZ_CCS buffers in a future commit. Reduce the performance impact by making them use less bandwidth. From the Depth Test section of the BSpec: This function is enabled by the Depth Test Enable state variable. If enabled, the pixel's ("source") depth value is first computed. After computation the pixel's depth value is clamped to the range defined by Minimum Depth and Maximum Depth in the selected CC_VIEWPORT state. Then the current ("destination") depth buffer value for this pixel is read. and from the Depth Buffer Updates section of the BSpec: If depth testing is disabled or the depth test passed, the incoming pixel's depth value is written to the Depth Buffer. Taken together, it's clear that depth testing isn't necessary to perform a depth buffer clear. Mark Janes and I analyzed this patch with frameretrace and a depthrange piglit test. I disabled HiZ to ensure we'd get slow depth clears. We've observed the bandwidth consumption by the depth buffer access to be cut ~50% on BDW and SKL during depth clears. On a more graphically intensive workload, the Shadowmapping Sascha benchmark, I took the average of 3 runs on a BDW with a display resolution of about 1920x1200 (minus some desktop environment decorations). I measured a 22.61% FPS improvement when HiZ is disabled. v2. The BSpec doesn't mandate this behavior, update comment accordingly. (Ken) Fixes: bc4bb5a7e30 ("intel/blorp: Emit more complete DEPTH_STENCIL state") Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit d5fb9cccdce2d44427582ca6d9201d5ec42fedb2)
* anv: Properly allocate aux-tracking space for CCS_ENanley Chery2019-10-292-3/+5
| | | | | | | | | | add_aux_state_tracking_buffer() actually checks the aux usage when determining how many dwords to allocate for state tracking. Move the function call to the point after the CCS_E aux usage is assigned. Fixes: de3be618016 ("anv/cmd_buffer: Rework aux tracking") Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit d0fcc2dd503f734f10f879ad666c27fd81c44262)
* glsl: Initialize all fields of ir_variable in constructorDanylo Piliaiev2019-10-281-0/+23
| | | | | | | | | | | | Better be safe, even if we could technically avoid this for some fields. Cc: <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1999 Signed-off-by: Danylo Piliaiev <[email protected]> Tested-by: Witold Baryluk <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 8818e0df742120858b2460a2208fac57d242473a)
* i965: setup sized internalformat for MESA_FORMAT_R10G10B10A2_UNORMTapani Pälli2019-10-281-1/+9
| | | | | | | | | | | | | | | | Commit d2b60e433e5 introduced restrictions (as per GLES spec) on the internal format. We need to setup a sized format for the texture image so framebuffers created with that are considered complete. This change fixes following Android CTS test in AHardwareBufferNativeTests category: SingleLayer_ColorTest_GpuColorOutputAndSampledImage_R10G10B10A2_UNORM Signed-off-by: Tapani Pälli <[email protected]> Fixes: d2b60e433e5 ("mesa/main: R10G10B10_(A2) formats are not color renderable in ES") Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit 412badd059de6f55cbcab10a55d052986a74b4cd)
* Revert "mesa/main: Fix multisample texture initialize"Illia Iorin2019-10-281-25/+13
| | | | | | | | | | | This reverts commit a113a42e7369a4e43a1db1c9a7a35a3f7175615e. Per https://github.com/KhronosGroup/OpenGL-API/issues/45 it was a wrong way to fix the issue. Signed-off-by: Illia Iorin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 71d4ece366d5cefe58f503429126a102e688ab42)
* rbug: Fix use of alloca() without #include "c99_alloca.h"Jon Turney2019-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | [12/60] Compiling C object 'src/gallium/auxiliary/eb820e8@@gallium@sta/rbug_rbug_texture.c.o'. FAILED: src/gallium/auxiliary/eb820e8@@gallium@sta/rbug_rbug_texture.c.o [...] ../src/gallium/auxiliary/rbug/rbug_texture.c: In function 'rbug_send_texture_info_reply': ../src/gallium/auxiliary/rbug/rbug_texture.c:302:21: error: implicit declaration of function 'alloca'; did you mean 'malloc'? [-Werror=implicit-function-declaration] uint32_t *height = alloca(sizeof(uint32_t) * height_len); ^~~~~~ malloc ../src/gallium/auxiliary/rbug/rbug_texture.c:302:21: warning: initialization makes pointer from integer without a cast [-Wint-conversion] ../src/gallium/auxiliary/rbug/rbug_texture.c:303:20: warning: initialization makes pointer from integer without a cast [-Wint-conversion] uint32_t *depth = alloca(sizeof(uint32_t) * height_len); ^~~~~~ cc1: some warnings being treated as errors Include c99_alloca.h to portably make the alloca() prototype available. See also: 498d9d0f, adfb9c5c, fc8139b1 Fixes: 6174cba7 ("rbug: fix transmitted texture sizes") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 2649609ac540108eb567ddf36bd1ac5ec75691af)
* winsys/svga: Limit the maximum DMA hardware buffer sizeThomas Hellstrom2019-10-251-1/+4
| | | | | | | | | | | | | | | | | | | | The kernel total GMR/DMA size is limited, but it's definitely possible for the kernel to allow a larger buffer allocation to succeed, but command submission using that buffer as a GMR would fail typically causing an application crash. So have the winsys limit the size of GMR/DMA buffers. The pipe driver will then resort to allocating smaller buffers and perform the DMA transfer in multiple bands, also allowing for the pre-flush mechanism to kick in. This avoids the related application crashes. Fixes: e7843273fae ("winsys/svga: Update to vmwgfx kernel module 2.1") Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> (cherry picked from commit 91146c07967b1d531a38f724ad91e7a0fc0769ef)
* svga: Fix banded DMA upload unmapThomas Hellstrom2019-10-251-1/+1
| | | | | | | | | | | | | | | | | Even with banded DMA uploads, st->hwbuf is always non-NULL, but when we've allocated a software buffer to hold the full upload, unmapping of the hardware buffer has already been done before svga_texture_transfer_unmap_dma(), and the code was performing an unmap of an already mapped buffer. Fix this by testing for software buffer not present. Fixes: a9c4a861d5d ("svga: refactor svga_texture_transfer_map/unmap functions") Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> (cherry picked from commit 00db976905b7fcd615ccee0c13dcbf9dfe29f5ec)
* util/u_queue: skip util_queue_finish if num_threads is 0Marek Olšák2019-10-251-0/+7
| | | | | | | | This fixes a deadlock in pthread_barrier_destroy. Cc: 19.1 19.2 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit c2efd2cbfb19808cd4bf5f2f0cf62455f80f1a2f)