summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* radeonsi: wait for outstanding memory instructions in TCS barriersMarek Olšák2016-12-141-1/+5
| | | | | | Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 16f49c16c79a67f174b92672d546f909425f7fc3)
* radeonsi: allow specifying simm16 of emit_waitcnt at call sitesMarek Olšák2016-12-141-5/+7
| | | | | | | | The next commit will use this. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 15e96c70b0b668a2626326d3572a247e41885c18)
* radeonsi: fix incorrect FMASK checking in bind_sampler_statesMarek Olšák2016-12-141-4/+4
| | | | | | Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 38d4859b9465146189c234cd372de9d3eee86a92)
* radeonsi: always restore sampler states when unbinding sampler viewsMarek Olšák2016-12-141-3/+8
| | | | | | Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit b3a2aa9cba46bd6c8de22390b3b1ce9ac6c27988)
* cso: don't release sampler states that are boundMarek Olšák2016-12-141-1/+3
| | | | | | | | | | | | | | | This fixes random radeonsi GPU hangs in Batman Arkham: Origins (Wine) and probably many other games too. cso_cache deletes sampler states when the cache size is too big and doesn't check which sampler states are bound, causing use-after-free in drivers. Because of that, radeonsi uploaded garbage sampler states and the hardware went bananas. Other drivers may have experienced similar issues. Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> (cherry picked from commit 6dc96de303290e8d1fc294da478c4f370be98dea)
* radeonsi: fix isolines tess factor writes to control ringNicolai Hähnle2016-12-141-4/+12
| | | | | | | | | Fixes piglit arb_tessellation_shader/execution/isoline{_no_tcs}.shader_test. Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit d3931a355fd5d309d5bcfe2655249f029e84d355) [Emil Velikov: there is no si_shader_key::part in branch] Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* genxml/gen9: Change the default of MI_SEMAPHORE_WAIT::RegisterPoleModeJason Ekstrand2016-12-141-1/+1
| | | | | | | | | | | We would really like it to be false as that's what you get on hardware that doesn't have RegisterPoleMode (Sky Lake for example). While we're at it, we change it to a boolean. This fixes dEQP-VK.synchronization.smoke.events on Broxton. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit eb7b51d62ae541ff351b4335c6d2f2e1a3a8bbce)
* i965: Allocate at least some URB space even when max_vertices = 0.Kenneth Graunke2016-12-141-1/+7
| | | | | | | | | | | | | | | | | | | | | Allocating zero URB space is a really bad idea. The hardware has to give threads a handle to their URB space, and threads have to use that to terminate the thread. Having it be an empty region just breaks a lot of assumptions. Hence, why we asserted that it isn't possible. Unfortunately, it /is/ possible prior to Gen8, if max_vertices = 0. In theory a geometry shader could do SSBO/image access and maybe still accomplish something. In reality, this is tripped up by conformance tests. Gen8+ already avoids this problem by placing the vertex count DWord in the URB entry header. This fixes things on earlier generations. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Tested-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit a41f5dcb141a11ca5ca0c765c305027b0f0b609e)
* radv: fix another regression since shadow fixes.Dave Airlie2016-12-141-1/+1
| | | | | | | | | This fixes: dEQP-VK.glsl.texture_gather.basic.2d.depth32f.* Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 8033f78f94c7c6349e1c6a4d63fe3accb34b36f1)
* mesa: only verify that enabled arrays have backing buffersIlia Mirkin2016-12-141-1/+1
| | | | | | | | | | | | | We were previously also verifying that no backing buffers were available when an array wasn't enabled. This is has no basis in the spec, and it causes GLupeN64 to fail as a result. Fixes: c2e146f487 ("mesa: error out in indirect draw when vertex bindings mismatch") Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (cherry picked from commit 7c16552f8dcc869b14cf7ef443a1b5de83b07973)
* vc4: In a loop break/continue, jump if everyone has taken the path.Eric Anholt2016-12-141-10/+17
| | | | | | | | | | | | | | | | | | This should be a win for most loops, which tend to have uniform control flow. More importantly, it exposes important information to live variables: that the break/continue here means that our jump target may have access to values that were live on our input. Previously, we were just setting the exec mask and letting control flow fall through, so an intervening def between the break and the end of the loop would appear to live variables as if it screened off the variable, when it didn't actually. Fixes a regression in glsl-vs-loop-redundant-condition.shader_test when a perturbing of register allocation caused a live variable to get stomped. Cc: 13.0 <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8e5ec33f1151dd82402bdfdaa4fff7c284e49a1c)
* radeonsi: apply the double EVENT_WRITE_EOP workaround to VI as wellMarek Olšák2016-12-141-2/+4
| | | | | | | | | | | | | Internal docs don't mention it, but they also don't mention that the bug has been fixed (like other CI bugs fixed in VI). Vulkan does this too. v2: also update r600_gfx_write_fence_dwords Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1) (cherry picked from commit bacf9b4e735cc9d96acd2d507dfb2fc8831966a3)
* radeonsi: add a tess+GS hang workaround for VI dGPUsMarek Olšák2016-12-141-2/+10
| | | | | | | | ported from Vulkan Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit a816c7fe07bf16325c11bc692486ffb6d1e8b670)
* radeonsi: apply a tessellation bug workaround for SIMarek Olšák2016-12-141-0/+6
| | | | | | | | | | | Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 78c4528ae7709fbe94d917d034cfd60535b5dcf3) [Emil Velikov: resolve trivial conflict] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/gallium/drivers/radeonsi/si_state_draw.c
* radeonsi: apply a TC L1 write corruption workaround for SIMarek Olšák2016-12-141-11/+23
| | | | | | Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 72e46c98896d0cb13fc7d70b7a4193a84d72a5fc)
* radeonsi: apply a multi-wave workgroup SPI bug workaround to affected CIK chipsMarek Olšák2016-12-144-4/+29
| | | | | | | | All codepaths are handled except for clover. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 72d48fcd8eb5862c72d27e5462c289c5de65396e)
* radeonsi: consolidate max-work-group-size computationMarek Olšák2016-12-141-24/+19
| | | | | | | | The next commit will need this. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit ec36c63b4f417973a6d50d79281f4834682c4555)
* radeonsi: disable RB+ blend optimizations for dual source blendingMarek Olšák2016-12-141-0/+11
| | | | | | | | | This fixes dual source blending on Stoney. The fix was copied from Vulkan. The problem was discovered during internal testing. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 5e5573b1bf8565f38e9b770b5357d069e80ff00d)
* radeonsi: set CB_BLEND1_CONTROL.ENABLE for dual source blendingMarek Olšák2016-12-141-0/+4
| | | | | | | | copied from Vulkan Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit ff50c44a5fb4411715da828af5b8706c8a456d26)
* radeonsi: always set all blend registersMarek Olšák2016-12-141-5/+5
| | | | | | | | better safe than sorry Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 87b208a54e67b6b01845efa2ec20a96963399920)
* mesa: fix active subroutine uniforms properlyTimothy Arceri2016-12-143-104/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 07fe2d565b introduced a big hack in order to return NumSubroutineUniforms when querying ACTIVE_RESOURCES for <shader>_SUBROUTINE_UNIFORM interfaces. However this is the wrong fix we are meant to be returning the number of active resources i.e. the count of subroutine uniforms in the resource list which is what the code was previously doing, anything else will cause trouble when trying to retrieve the resource properties based on the ACTIVE_RESOURCES count. The real problem is that NumSubroutineUniforms was counting array elements as separate uniforms but the innermost array is always considered a single uniform so we fix that count instead which was counted incorrectly in 7fa0250f9. Idealy we could probably completely remove NumSubroutineUniforms and just compute its value when needed from the resource list but this works for now. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Cc: 13.0 <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0303201dfb73c16751d5519cca7480fa678d429a) [Emil Velikov: LinkStatus is in gl_shader_program] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/main/program_resource.c
* anv/cmd_buffer: Remove the 1-D case from the HiZ QPitch calculationJason Ekstrand2016-12-141-3/+6
| | | | | | | | | | | | The 1-D special case doesn't actually apply to depth or HiZ. I discovered this while converting BLORP over to genxml and ISL. The reason is that the 1-D special case only applies to the new Sky Lake 1-D layout which is only used for LINEAR 1-D images. For tiled 1-D images, such as depth buffers, the old gen4 2-D layout is used and the QPitch should be in rows. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit f469235a6e0c239166ba803e121994063b47ddd3)
* anv/image: Rename hiz_surface to aux_surfaceJason Ekstrand2016-12-143-17/+18
| | | | (cherry picked from commit c3eb58664e5e537b21a75172916b42bd4b5504b3)
* radv: set maxFragmentDualSrcAttachments to 1Dave Airlie2016-12-141-1/+1
| | | | | | | | Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit eaf0768b8f9a9fd76b44a4d60826ef1f42fc6a46)
* anv: set maxFragmentDualSrcAttachments to 1Dave Airlie2016-12-141-1/+1
| | | | | | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit f9ab60202d48c72afa6a6f2a8c27db1e0777ed16)
* vulkan/wsi: Fix resource leak in success path of wsi_queue_init()Gwan-gyeong Mun2016-12-141-0/+1
| | | | | | | | | | It fixes leakage of pthread_condattr resource on wsi_queue_init() Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com> (cherry picked from commit 65ea559465df527d8a2998380c7eb2554780a2ba)
* anv: Update the teardown in reverse order of the anv_CreateDeviceGwan-gyeong Mun2016-12-141-9/+14
| | | | | | | | | | | | This updates releasing of resource in reverse order of the anv_CreateDevice to anv_DestroyDevice. And it fixes resource leak in pthread_mutex, pthread_cond, anv_gem_context. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit b178652b41410483dcd82aba495eab6bc892ab15)
* anv: Add missing error-checking to anv_block_pool_init (v2)Gwan-gyeong Mun2016-12-142-8/+23
| | | | | | | | | | | | | | | | | | | | When the memfd_create() and u_vector_init() fail on anv_block_pool_init(), this patch makes to return VK_ERROR_INITIALIZATION_FAILED. All of initialization success on anv_block_pool_init(), it makes to return VK_SUCCESS. CID 1394319 v2: Fixes from Emil's review: a) Add the return type for propagating the return value to caller. b) Changed anv_block_pool_init() to return VK_ERROR_INITIALIZATION_FAILED on failure of initialization. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit ecc618b0d88e462270ffedf01502ede4c60fdad9)
* radv: don't leak the fd if radv_physical_device_init() succeedsEmil Velikov2016-12-141-0/+1
| | | | | | | | | | | radv_amdgpu_winsys_create() does not take ownership of the fd, thus we end up leaking it as we return with VK_SUCCESS. Cc: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (cherry picked from commit 78707a15f205f9c2f45dc43ccbb99eb43029dc78)
* anv: don't leak memory if anv_init_wsi() failsEmil Velikov2016-12-141-2/+4
| | | | | | | | | brw_compiler_create() rzalloc-ates memory which we forgot to free. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit a1cf494f7740c2afb851ffc3248e2cfa54d74ead)
* anv: don't double-close the same fdEmil Velikov2016-12-141-2/+1
| | | | | | Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 3af81715470f8d656fe8b8e35475ed2b5fc766da)
* anv/cmd_buffer: Re-emit MEDIA_CURBE_LOAD when CS push constants are dirtyJason Ekstrand2016-12-141-10/+13
| | | | | | | | | | | | | | | | | | | | | | | This can happen even if the binding table isn't changed. For instance, you could have dynamic offsets with your descriptor set. This fixes the new stress.lots-of-surface-state.cs.dynamic cricible test. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 054e48ee0ead7e5a81d28220e3890c7dfc410188) Conflicts: src/intel/vulkan/genX_cmd_buffer.c Squashed with commit: anv/cmd_buffer: Emit CS push constants after binding tables Emitting binding tables can cause push constants to be dirtied if the shader uses images so we need to handle push constants later. (cherry picked from commit 7a2cfd4adb891fb93e84fd8aedfbe387a8a2c781)
* docs: add sha256 checksums for 13.0.2Emil Velikov2016-11-281-1/+2
| | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* docs: add release notes for 13.0.2Emil Velikov2016-11-281-0/+188
| | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* Update version to 13.0.2Emil Velikov2016-11-281-1/+1
| | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* radv: fix 3D clears with baseMiplevelDave Airlie2016-11-281-1/+1
| | | | | | | | | | | | | This fixes: dEQP-VK.api.image_clearing.clear_color_image.3d* These were hitting an assert as the code wasn't taking the baseMipLevel into account when minify the image depth. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 09c0c17bc3609a5f5d3ba1df26820406ff5449bf)
* radv/ac/llvm: shadow samplers only return one value.Dave Airlie2016-11-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intrinsic engine asserts in llvm due to this. Reported-by: Christoph Haag <haagch+mesadev@frickel.club> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b56b54cbf1d8e70c87a434da5350d11533e5fed8) Squashed with commit: radv/ac/llvm: fix regression with shadow samplers fix This fixes b56b54cbf1d8e70c87a434da5350d11533e5fed8: radv/ac/llvm: shadow samplers only return one value It makes sure we only do that for shadow sampling, as opposed to sizing requests. Signed-off-by: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit b2e217369e1ca4bf9d7741721559a4506b1f0ce8) Squashed with commit: radv: brown-paper bag for a forgotten else. This fixes the fix: radv/ac/llvm: fix regression with shadow samplers fix Signed-off-by: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 020978af12ef6d598bc5efeae3704c0eb8cdafd2)
* radv/si: fix optimal micro tile selectionDave Airlie2016-11-281-7/+7
| | | | | | | | | The same fix was posted for radeonsi, so port it here. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 9838db8f643354e485f74664b92b902fe0b95c4f)
* radv: honour the number of properties availableEmil Velikov2016-11-281-11/+7
| | | | | | | | | | | | Cap up-to the number of properties available while copying the data. Otherwise we might crash and/or leak data. Cc: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit a025c5b2c7c9c6862006b13c9b8ab46c3acf8e53)
* radv: fix texel fetch offset with 2d arrays.Dave Airlie2016-11-281-3/+4
| | | | | | | | | | | | | The code didn't limit the offsets to the number supplied, so if we expected 3 but only got 2 we were accessing undefined memory. This fixes random failures in: dEQP-VK.glsl.texture_functions.texelfetchoffset.sampler2darray_* Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit bb8ac183404541ca8dee31563709d5aca8de0e73)
* vulkan/wsi/x11: Implement FIFO mode.Jason Ekstrand2016-11-281-10/+164
| | | | | | | | | | | | This implements VK_PRESENT_MODE_FIFO_KHR for X11. Unfortunately, due to the way the present extension works, we have to manage the queue of presented images in a separate thread. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit e73d136a02308088cacab842790c7670e5d07b23)
* vulkan/wsi: Add a thread-safe queue implementationKevin Strasser2016-11-282-1/+156
| | | | | | | | | | | | | | | | In order to support FIFO mode without blocking the application on calls to vkQueuePresentKHR it is necessary to enqueue the request and defer calling the server until the next vblank period. The xcb present api doesn't offer a way to register a callback, so we will have to spawn a worker thread that will wait for a request to be added to the queue, call to the server, and then make the image available for reuse. This commit introduces the queue data structure needed to implement this. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 932bb3f0ddf22a9cbdf6d45089547765027b4397)
* vulkan/wsi/x11: add support for IMMEDIATE present modeDave Airlie2016-11-281-1/+3
| | | | | | | | | We shouldn't be using ASYNC here, that would be used for immediate mode, so let's implement that. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit ca035006c86a5055c8e640f49c858f04770681eb)
* vulkan/wsi: store present mode in swapchain base classDave Airlie2016-11-283-3/+5
| | | | | | | | | This just moves this up a level as x11 will need it to implement things properly. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 1cdca1eb16ab33da338dda076794efd4bf859f7b)
* vulkan/wsi/x11: handle timeouts properly in next image acquire (v1.1)Dave Airlie2016-11-281-5/+57
| | | | | | | | | | | | | | For 0 timeout, just poll for an event, and if none, return For UINT64_MAX timeout, just wait for special event blocked For other timeouts get the xcb fd and block on it, decreasing the timeout if we get woken up for non-special events. v1.1: return VK_TIMEOUT for poll timeouts. handle timeout going negative. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 787c172aed0ae88ca6a8c1a193d9dd744fbdc918)
* vulkan/wsi/x11: Fix behavior of vkGetPhysicalDeviceSurfacePresentModesKHREduardo Lima Mitev2016-11-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | x11_surface_get_present_modes() is currently asserting that the number of elements in pPresentModeCount must be greater than or equal to the number of present modes available. This is buggy because pPresentModeCount elements are later copied from the internal modes' array, so if pPresentModeCount is greater, it will overflow it. On top of that, this assertion violates the spec. From the Vulkan 1.0 (revision 32, with KHR extensions), page 581 of the PDF: "If the value of pPresentModeCount is less than the number of presentation modes supported, at most pPresentModeCount values will be written. If pPresentModeCount is smaller than the number of presentation modes supported for the given surface, VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that not all the available values were returned." So, the correct behavior is: if pPresentModeCount is greater than the internal number of formats, it is clamped to that many present modes. But if it is lesser than that, then pPresentModeCount elements are copied, and the call returns VK_INCOMPLETE. This fix is similar (but simpler and more readable) than the one I provided in 750d8cad72a for vkGetPhysicalDeviceSurfaceFormatsKHR, which was suffering from the same problem. Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit b677b99db5c48ffd1eeef538b962080ac5fd65d9) Nominated-by: Emil Velikov <emil.velikov@collabora.com>
* vulkan/wsi/x11: Fix behavior of vkGetPhysicalDeviceSurfaceFormatsKHREduardo Lima Mitev2016-11-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | x11_surface_get_formats() is currently asserting that the number of elements in pSurfaceFormats must be greater than or equal to the number of formats available. This is buggy because pSurfaceFormatsCount elements are later copied from the internal formats' array, so if pSurfaceFormatCount is greater, it will overflow it. On top of that, this assertion violates the spec. From the Vulkan 1.0 (revision 32, with KHR extensions), page 579 of the PDF: "If pSurfaceFormats is NULL, then the number of format pairs supported for the given surface is returned in pSurfaceFormatCount. Otherwise, pSurfaceFormatCount must point to a variable set by the user to the number of elements in the pSurfaceFormats array, and on return the variable is overwritten with the number of structures actually written to pSurfaceFormats. If the value of pSurfaceFormatCount is less than the number of format pairs supported, at most pSurfaceFormatCount structures will be written. If pSurfaceFormatCount is smaller than the number of format pairs supported for the given surface, VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that not all the available values were returned." So, the correct behavior is: if pSurfaceFormatCount is greater than the internal number of formats, it is clamped to that many formats. But if it is lesser than that, then pSurfaceFormatCount elements are copied, and the call returns VK_INCOMPLETE. Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 750d8cad72a532d977df10ffbbdd1902bd06f50b) Nominated-by: Emil Velikov <emil.velikov@collabora.com> Squashed with commit: vulkan/wsi/x11: Smplify implementation of vkGetPhysicalDeviceSurfaceFormatsKHR This patch simplifies x11_surface_get_formats(). It is actually just a readability improvement over the patch I provided earlier this week (750d8cad72). Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit 129da274261b6e79f459e24428591f137bf92ed1)
* anv/format: handle unsupported formats properlyIago Toral Quiroga2016-11-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the spec for vkGetPhysicalDeviceImageFormatProperties: "If format is not a supported image format, or if the combination of format, type, tiling, usage, and flags is not supported for images, then vkGetPhysicalDeviceImageFormatProperties returns VK_ERROR_FORMAT_NOT_SUPPORTED." Makes the following Vulkan CTS tests report 'Not Supported' instead of crashing: dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_unorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_snorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_uscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_sscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_uint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_sint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_unorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_snorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_uscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_sscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_uint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_sint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_r4g4_unorm_pack8 dEQP-VK.api.image_clearing.clear_color_image.1d_r8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_r8g8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_r8g8b8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_b5g5r5a1_unorm_pack16 Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (cherry picked from commit 35deeda66f5fcbccb24f8eda42c8a4f67bb106c9) Squashed with: anv/format: handle unsupported formats earlier Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 277f868e6682b9ee398ed326425274c3d1898417)
* anv: fix enumeration of propertiesEmil Velikov2016-11-241-6/+8
| | | | | | | | | | | | | | | | | | | | Driver should enumerate only up-to min2(num_available, num_requested) properties and return VK_INCOMPLETE if the # of requested props is smaller than the ones available. Presently we assert out in such cases. Inspired by a similar fix for RADV. v2: Use MIN2 + typed_memcpy (Jason). Should fix: dEQP-VK.api.info.device.extensions Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 5cc07d854c85e30c5aa1ced626b4b6500f8cd74c)
* gbm: request correct version of the DRI2_FENCE extensionLucas Stach2016-11-241-1/+1
| | | | | | | | | | | There is no version 2 of the DRI2_FENCE extension. So only a request for version 1 has a chance to succeed. Fixes: 74b1969d717f (gbm: wire up fence extension) Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit d9a3ad94cac34c51603660af6647290d238f64bc)