summaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'mesa/13.0' into nougat-x86Chih-Wei Huang2017-01-098-56/+97
|\
| * anv/descriptor_set: Write the state offset in the surface state free list.Jason Ekstrand2016-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | When Kristian reworked descriptor set allocation, somehow he forgot to actually store the offset in the free list. Somehow, this completely missed CTS testing until now... This fixes all 2744 of the new 'dEQP-VK.texture.filtering.* tests in the latest CTS. Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (cherry picked from commit 37537b7d868ddca376e2553a4ea9e5e0033a961c)
| * anv/device: Implicitly unmap memory objects in FreeMemoryJason Ekstrand2016-12-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | From the Vulkan spec version 1.0.32 docs for vkFreeMemory: "If a memory object is mapped at the time it is freed, it is implicitly unmapped." Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> (cherry picked from commit b1217eada9e32bf387d4d14615340aa5b5fd1f5c)
| * anv/device: Return the right error for failed mapsJason Ekstrand2016-12-152-6/+9
| | | | | | | | | | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> (cherry picked from commit 920f34a2d9f14f023aee5203baa110c971519ee8)
| * 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)
| * 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: 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)
| * 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)
* | Merge remote-tracking branch 'mesa/13.0' into nougat-x86Chih-Wei Huang2016-11-2519-54/+394
|\ \ | |/
| * 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)
| * anv/cmd_buffer: Emit a CS stall before setting a CS pipelineJason Ekstrand2016-11-241-1/+13
| | | | | | | | | | | | | | 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 f680a01ad4ed360b44cd1b9d3c447a95cedbccd5)
| * anv/cmd_buffer: Handle running out of binding tables in compute shadersJason Ekstrand2016-11-241-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | If we try to allocate a binding table and fail, we have to get a new binding table block, re-emit STATE_BASE_ADDRESS, and then try again. We already handle this correctly for 3D and blorp but it never got handled for CS. This fixes the new stress.lots-of-surface-state.cs.static crucible 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 722ab3de9f0e30e1dfbbd2b5217330b85f53bcec)
| * anv: Fix unintentional integer overflow in anv_CreateDmaBufImageINTELGwan-gyeong Mun2016-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since both pCreateInfo->strideInBytes and pCreateInfo->extent.height are of uint32_t type 32-bit arithmetic will be used. Fix unintentional integer overflow by casting to uint64_t before multifying. CID 1394321 Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> [Emil Velikov: cast only of the arguments] Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit e074a08a6ded3260f13111d0e23961dea2da2442)
| * anv: Implement a depth stall restriction on gen7Jason Ekstrand2016-11-243-0/+35
| | | | | | | | | | | | | | | | Fixes around 60 Vulkan CTS tests on Haswell Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a8b85f1f772ef45cdeba9d5d205d105e689c3bdf)
| * anv/blorp: Ignore clears for attachments first used as resolve destinationsJason Ekstrand2016-11-241-9/+11
| | | | | | | | | | | | | | | | | | Otherwise, we'll try to clear it the first time it's used as a draw so if you do some multisampled rendering, resolve to an attachment, and then draw on top of the single-sampled attachment, we might accidentally clear it. Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ccdf9af39265ef3478fac4d13b19e9d17fbbcab7)
| * anv/fence: Handle ANV_FENCE_CREATE_SIGNALED_BITJason Ekstrand2016-11-241-1/+5
| | | | | | | | | | | | Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 1c97432ce88ea272ff7d906cd36f70e09dafcab9)
| * anv: Handle null in all destructorsJason Ekstrand2016-11-249-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bunch of new CTS tests which look for exactly this. Even in the cases where we just call vk_free to free a CPU data structure, we still handle NULL explicitly. This way we're less likely to forget to handle NULL later should we actually do something less trivial. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 49f08ad77f51cc344e4bfe60ba9f8d9fccfbd753) [Emil Velikov: color_rt_surface_state is still around] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/intel/vulkan/anv_image.c
| * i965/glk: Add basic Geminilake supportBen Widawsky2016-11-241-0/+46
| | | | | | | | | | | | | | | | | | | | | | v2: s/bdw/gen; Add the 2x6 config v3: Add min_ds_entries Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 2193fb0e1f437b53672a03f74e40d4aebc503f9e)
| * isl: Fix height calculation in isl_msaa_interleaved_scale_px_to_saJordan Justen2016-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | No known fixed tests, but it looks like a typo from: commit 8ac99eabb6570f0f3c5f7d7da1332a99ce636362 intel/isl: Add a helper for getting the size of an interleaved pixel Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 0ac57afa6fbe59e9fd8eef38365cb3da8ec67f95)
| * intel: Set min_ds_entries on Broxton.Kenneth Graunke2016-11-241-0/+2
| | | | | | | | | | | | | | | | | | This was missing. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com> (cherry picked from commit 341fc0073a3c05fd43e9c7a33613bcb881f25f33)
| * anv: fix multi level clears with VK_REMAINING_MIP_LEVELSLionel Landwerlin2016-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | A commit from the CTS suite on the 1.0-dev branch started using VK_REMAINING_MIP_LEVELS, we're not dealing with it properly for clears. Fixes: dEQP-VK.api.image_clearing.clear_color_image.* Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a46bc3f70a22a71dc2977f7394841e1b19bb68b6)
| * anv: Rework fencesJason Ekstrand2016-11-233-26/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our previous fence implementation was very simple. Fences had two states: signaled and unsignaled. However, this didn't properly handle all of the edge-cases that we need to handle. In order to handle the case where the client calls vkGetFenceStatus on a fence that has not yet been submitted via vkQueueSubmit, we need a three-status system. In order to handle the case where the client calls vkWaitForFences on fences which have not yet been submitted, we need more complex logic and a condition variable. It's rather annoying but, so long as the client doesn't do that, we should still hit the fast path and use i915_gem_wait to do all our waiting. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 843775bab78a6b4d5cb4f02bd95d9d0e95c1c5e3)
| * anv/wsi: Set the fence to signaled in AcquireNextImageKHRJason Ekstrand2016-11-231-3/+10
| | | | | | | | | | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 73701be667ae408772bf20cb504b70d1775d4a4b)
| * anv/gen8: Stall when needed in Cmd(Set|Reset)EventJason Ekstrand2016-11-231-0/+29
| | | | | | | | | | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 71397042fea36a2a14b530b75829ad13f969fd00)
* | Merge remote-tracking branch 'mesa/13.0' into nougat-x86Chih-Wei Huang2016-11-1617-411/+572
|\ \ | |/
| * mesa: Fix pixel shader scratch space allocation on Gen9+ platforms.Kenneth Graunke2016-11-111-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had missed a bit of errata - PS scratch needs to be computed as if there were 4 subslices per slice, rather than 3. Skylake Broxton Kabylake GT1 GT2 GT3 GT4 2x6 3x6 GT1 GT1.5 GT2 GT3 GT4 Actual Slices 1 1 2 3 1 1 1 1 1 2 3 Total Subslices 3 3 6 9 2 3 2 3 3 6 9 Subsl. for PS Scratch 4 4 8 12 4 4 4 4 4 8 12 Note that Skylake GT1-3 already worked because we allocated 64 * 9 (trying to use a value that would work on GT4, with 9 subslices), and the actual required values were 64 * 4 or 64 * 8. However, all others (Skylake GT4, Broxton, and Kabylake GT1-4) underallocated, which can lead to scratch writes trashing random process memory, and rendering corruption or GPU hangs. Fixes GPU hangs and rendering corruption on Skylake GT4 in shaders that spill. Particularly, dEQP-GLES31.functional.ubo.all_per_block_buffers.* now runs successfully with no hangs and renders correctly. This may fix problems on Broxton and Kabylake as well. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (cherry picked from commit aaee3daa90578fb711cc89186a65bc3d2c68022f)
| * anv/cmd_buffer: Enable a CS stall workaround for Sky Lake gt4Jason Ekstrand2016-11-111-0/+6
| | | | | | | | | | | | | | | | This fixes hangs in Dota2 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a6c3d0f92b754e11e74cea9d6bd5ac329c73a8ba)
| * anv/cmd_buffer: Take a command buffer instead of a batch in two helpersJason Ekstrand2016-11-111-8/+8
| | | | | | | | | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1e3e347fd5d1d55cdb36c39442def31d121ebae5)
| * anv: use correct .specVersion for extensionsEmil Velikov2016-11-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vulkan has introduced the consept of .specVersion which can be used to attribute changes of the said extension. The current loader does not check the value, thus it have gone unnoticed that the driver exposes an old version of the following extensions: VK_KHR_xcb_surface (Rev 6) VK_KHR_xlib_surface (Rev 6) VK_KHR_wayland_surface (Rev 5) - Updated the surface create function to take a pCreateInfo structure VK_KHR_swapchain (Rev 68) - Moved the "validity" include for vkAcquireNextImage to be in its proper place, after the prototype and list of parameters. ... According to the documentation: * pname:specVersion is the version of this extension. It is an integer, incremented with backward compatible changes. Based on the history of vk.xml the above (latest) revision has been available since Vulkan 1.0 so even if they were any backwards incompatible change(s) [as hinted by the revision log] those should be safe. 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 f373a91a5264bb93b31b5be9f9714da856383ed1)
| * anv: Do relocations in userspace before execbuf ioctlKristian Høgsberg Kristensen2016-11-092-9/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since our surface state buffer is shared by all batches, the kernel does a full stall and sync with the CPU between batches every time we call execbuf2 because it refuses to do relocations on an active buffer. Doing them in userspace and passing the NO_RELOC flag to the kernel allows us to perform the relocations without stalling. This improves the performance of Dota 2 by around 30% on a Sky Lake GT2. v2 (Jason Ekstrand): - Better comments (Chris Wilson) - Fixed write_reloc for correct canonical form (Chris Wilson) v3 (Jason Ekstrand): - Skip relocations which aren't needed - Provide an environment variable to always use the kernel - More comments about correctness (Chris Wilson) v4 (Jason Ekstrand): - More comments (Chris Wilson) v5 (Jason Ekstrand): - Rebase on top of moving execbuf2 setup go QueueSubmit Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit b3a29f2e9eb528a16ceec0fd88aad9f0c3c3b6d4)
| * anv: Move relocation handling from EndCommandBuffer to QueueSubmitJason Ekstrand2016-11-094-72/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever since the early days of the Vulkan driver, we've been setting up the lists of relocations at EndCommandBuffer time. The idea behind this was to move some of the CPU load out of QueueSubmit which the client is required to lock around and into command buffer building which could be done in parallel. Then QueueSubmit basically just becomes a bunch of execbuf2 calls. Technically, this works. However, when you start to do more in QueueSubmit than just execbuf2, you start to run into problems. In particular, if a block pool is resized between EndCommandBuffer and QueueSubmit, the list of anv_bo's and the execbuf2 object list can get out of sync. This can cause problems if, for instance, you wanted to do relocations in userspace. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8b61c57049ff75766715ad4f7b1ad2d3657b9b4d)
| * anv/batch: Move last_ss_pool_bo_offset to the command bufferJason Ekstrand2016-11-092-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original reason for putting it in the batch_bo was to allow primaries to share it across secondaries or something like that. However, the relocation lists in secondary command buffers are are always left alone and copied into the primary command buffer's relocation list. This means that the offset really applies at the command buffer level and putting it in the batch_bo doesn't make sense. This fixes a couple of potential bugs around re-submission of command buffers that are not likely to be hit but are bugs none the less. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 595400d57745fba198b42d95f3c4f5d855023c33)
| * anv: Add an anv_execbuf helper structJason Ekstrand2016-11-092-48/+62
| | | | | | | | | | | | | | | | | | | | | | | | This commit adds a little helper struct for storing everything we use to build an execbuf2 call. Since the add_bo function really has nothing to do with a command buffer, it makes sense to break it out a bit. This also reduces some of the churn in the next commit. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0fe68294275a4ab1d9f71bb48d21a5e6b830e1ca)
| * anv/batch_chain: Improve write_relocJason Ekstrand2016-11-091-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | The old version wasn't properly handling large addresses where we have to sign-extend to get it into the "canonical form" expected by the hardware. Also, the new version is capable of doing a clflush of the newly written reloc if requested. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 095c48a496fccdd95821ee426d70674bc75dc6af)
| * anv: Initialize anv_bo::offset to -1Jason Ekstrand2016-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Since -1 is an invalid GPU address, this lets us know whether or not we have a valid address for a buffer. We don't get a valid address until the first time that buffer is used in an execbuf2 ioctl. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d46bfb629725a5b8c327f3bd7f76d04f5ae262aa)
| * anv/allocator: Simplify anv_scratch_poolJason Ekstrand2016-11-092-61/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation was being overly clever and using the anv_bo::size field as its mutex. Scratch pool allocations don't happen often, will happen at most a fixed number of times, and never happen in the critical path (they only happen in shader compilation). We can make this much simpler by just using the device mutex. This also means that we can start using anv_bo_init_new directly on the bo and avoid setting fields one-at-a-time. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit bd0f8d50706fce400ff0768c659acc90696aadb6)
| * anv: Add a new bo_pool_init helperJason Ekstrand2016-11-094-20/+21
| | | | | | | | | | | | | | | | | | This ensures that we're always setting all of the fields in anv_bo Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 6283b6d56a2bb731cfcb4c876566901075f9bd34)
| * anv: Don't presume to know what address is in a surface relocationJason Ekstrand2016-11-092-53/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Because our relocation processing happens at EndCommandBuffer time and because RENDER_SURFACE_STATE objects may be shared by batches, we really have no clue whatsoever what address is actually written to the relocation offset in the BO. We need to stop making such claims to the kernel and just let it relocate for us. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ba1eea4f957ca068eceea121bc3a70e2fe07873d)
| * anv: Add a cmd_buffer_execbuf helperJason Ekstrand2016-11-093-2/+11
| | | | | | | | | | | | | | | | | | | | This puts the actual execbuf2 call in anv_batch_chain.c along with the other relocation stuff. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit db9f4b2a2bbf1aff3c6c878735495fc7accbb11e)
| * anv/device: Add an execbuf wrapperJason Ekstrand2016-11-092-20/+35
| | | | | | | | | | | | | | | | | | | | This wrapper ensures that we always update all anv_bo::offset fields based on the offsets returned by the kernel. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 07798c9c3ed29fd162ebc6b6d6beb8448218487f)
| * intel/blorp: Emit all the binding tablesJason Ekstrand2016-11-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At least on Sky Lake, after emitting 3DSTATE_CONSTANT_*, you are required to re-emit the 3DSTATE_BINDING_TABLE_POINTERS packet for the corresponding stage. If you don't, double-buffering may fail and you may get the wrong constants. It turns out that you need to do this even if you have no push constants to speak of or else the next 3DSTATE_CONSTANT packet you emit for that stage may not work correctly. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 406cd9d1261996ba53e3301b2a5a01b5c5c56f00)
| * anv/pipeline: Properly cache prog_data::paramJason Ekstrand2016-11-093-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | Before we were caching the prog data but we weren't doing anything with brw_stage_prog_data::param so anything with push constants wasn't getting cached properly. This commit fixes that. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 71cc1e188d52bebe86a1ac72fe90f4e2a7e76778)
| * anv/pipeline: Put actual pointers in anv_shader_binJason Ekstrand2016-11-095-50/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we can simply calculate offsets to get to things such as the prog_data and the key, it's much more user-friendly if there are just pointers. Also, it's a bit more fool-proof. While we're at it, we rework the pipeline cache API to use the brw_stage_prog_data type directly. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ff3185e3ba85b3635a1f645e8e951954f4022afe)
| * intel/blorp: Pass a brw_stage_prog_data to upload_shaderJason Ekstrand2016-11-094-5/+7
| | | | | | | | | | | | | | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 4306c10a885bdd833328a2a4eeb0079aa4f4bae3)