summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* 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)
* 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
* 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)
* 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)
* 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-091-1/+2
| | | | | | | | | 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)
* anv: Better handle return codes from anv_physical_device_initJason Ekstrand2016-11-091-1/+1
| | | | | | | | | | | | | The case where we just want the loop to continue is INCOMPATIBLE_DRIVER because that simply means that whatever FD we opened isn't a supported Intel chip. Other error codes such as OUT_OF_HOST_MEMORY are actual errors and we should be returning early in that case. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a5f8ff6ca18c38a7c4b5b37a4d5b14ca01e71b1e)
* anv/device: Return DEVICE_LOST if execbuf2 failsJason Ekstrand2016-11-091-6/+4
| | | | | | | | | | | | This makes more sense than OUT_OF_HOST_MEMORY. Technically, you can recover from a failed execbuf2 but the batch you just submitted didn't fully execute so things are in an ill-defined state. The app doesn't want to continue from that point anyway. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit c41ec1679f02d6705ceda49d9ad966d0d0833824)
* anv: Replace "abi_versions" with correct "api_version".Matt Turner2016-10-272-2/+2
| | | | | | | | | git history shows "abi_versions" was used from the outset. Cc: <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415 Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 07755237d36754cb44c32e17e32cf1bc551d2373)
* anv: automake: cleanup the generated json file during make cleanEmil Velikov2016-10-241-1/+1
| | | | | | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 8df581520a823564be0ab5af7dbb7d501b1c9670) Conflicts: src/intel/vulkan/Makefile.am
* anv: Suffix the intel_icd file with the host CPUJason Ekstrand2016-10-243-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vulkan has a multi-arch problem... The idea behind the Vulkan loader is that you have a little json file on your disk that tells the loader where to find drivers. The loader looks for these json files in standard locations, and then goes and loads the my_driver.so's that they specify. This allows you as a driver implementer to put their driver wherever on the disk they want so long as the ICD points in the right place. For a multi-arch system, however, you may have multiple libvulkan_intel.so files installed that the loader needs to pick depending on architecture. Since the ICD file format does not specify any architecture information, you can't tell the loader where to find the 32-bit version vs. the 64-bit version. The way that packagers have been dealing with this is to place libvulkan_intel.so in the top level lib directory and provide just a name (and no path) to the loader. It will then use the regular system search paths and find the correct driver. While this solution works fine for distro-installed Vulkan drivers, it doesn't work so well for user-installed drivers because they may put it in /opt or $HOME/.local or some other more exotic location. In this case, you can't use an ICD json file with just a library name because it doesn't know where to find it; you also have to add that to your library lookup path via LD_LIBRARY_PATH or similar. This patch handles both use-cases by taking advantage of the fact that the loader dlopen()s each of the drivers and, if one dlopen() calls fails, it silently continues on to open other drivers. By suffixing the icd file, we can provide two different json files: intel_icd.x86_64.json and intel_icd.i686.json with different paths. Since dlopen() will only succeed on the libvulkan_intel.so of the right arch, the loader will happily ignore the others and load that one. This allows us to properly handle multi-arch while still providing a full path so user installs will work fine. I tested this on my Fedora 25 machine with 32 and 64-bit builds of our Vulkan driver installed and 32 and 64-bit builds of crucible. It seems to work just fine. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d96345de989c8f9a0328cdc3588bfe186154c8ea) Squashed with commit: anv: Always use the full driver path in the intel_icd.*.json Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7ea4ef8849c5cc158adbdff1187b91f591552196) Squashed with commit: configure: Get rid of the --disable-vulkan-icd-full-driver-path flag Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 3f05fc62f924c051bdb883482452fb37650d5768)
* Revert Use absolute path in intel_icd.json and related patches.Emil Velikov2016-10-193-15/+2
| | | | | | | | | | | | | | | | | This commit effectively reverts the following commits: This reverts commit 0b6837a643bbbf3c57c5cc5030279fb4389b23b7. This reverts commit 05f36435ef117e48f457b44877d04dd6249b3bb7. This reverts commit a2ae67aa47df6dd41802462105dac7ce5ab676a2. While the feature introduced is convinient for development it is not as useful for distributions. Furthermore it even breaks things as one wishes to have both 32 and 64 bit package installed on the same system. Keep the functionality in development branch(es) and drop it from distribution packages to avoid confusion and misuse. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* anv: move to using shared wsi codeDave Airlie2016-10-197-1928/+4
| | | | | | | | This moves the shared code to a common subdirectory and makes anv linked to that code instead of the copy it was using. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/wsi: remove all anv references from WSI common codeDave Airlie2016-10-199-99/+98
| | | | | | the WSI code should be now be clean for sharing. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: move common wsi code to x11/wayland common files.Dave Airlie2016-10-1910-1656/+1851
| | | | | | | Next task is to rename all the anv_ out of this, and move to a common location Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>