mesa/src/intel/vulkan
Lionel Landwerlin d2ff2b9e4a anv: fix multiple wait/signal on same binary semaphore
We need to guarantee that when vkQueueSubmit() returns the application
can actually wait on a signaled semaphore/syncobj.

When using a thread to do the submission to i915, this gets a bit
tricky in the following case :

   A syncobj is used both as a wait & signal semaphore and has been
   signaled once already. It contains a fence before entering
   vkQueueSubmit().

   This means we need to reset the syncobj to ensure when we return
   from vkQueueSubmit(), the syncobj contains no stale fence.

   Currently in the Anv, the submission thread is in charge of putting
   the new fence in the syncobj and also picks up the wait fence
   directly from the syncobj. This means we can't reset the syncobj
   from vkQueueSubmit().

The solution to this has been pointed by Bas & Jason :

   In vkQueueSubmit(), clone the wait syncobj fence into a new
   temporary syncobj that will be destroy after submission and use
   this temporary syncobj as a wait fence for i915. This allows us to
   reset the original syncobj in vkQueueSubmit().

   For this to work with wait_before_signal behavior, we also need to
   do a wait-on-materialize on binary semaphores from vkQueueSubmit().
   Otherwise the application thread calling vkQueueSubmit() could race
   the submission thread and pick up the wrong fence when cloing.

v2: Use copy semantic for clone_syncobj_dma_fence() (Jason)
    Do the cloning prior to adding the syncobj to anv_queue_submit so
    that if the cloning fails don't have an invalid syncobj in
    anv_queue_submit (Jason)

v3: Fix another syncobj leak (Jason)

v4: Fix invalid argument order (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4945
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11474>
2021-11-11 20:59:32 +00:00
..
tests anv: Add a use_relocations physical device bit 2021-11-09 02:48:24 +00:00
anv_acceleration_structure.c anv: Add an anv_bo_is_pinned helper 2021-11-09 02:48:24 +00:00
anv_allocator.c anv: Add an anv_bo_is_pinned helper 2021-11-09 02:48:24 +00:00
anv_android.c anv: Add get/set_tiling helpers 2021-11-09 02:48:24 +00:00
anv_android.h anv: move VkImage object allocation to anv_CreateImage 2021-10-06 02:18:39 +00:00
anv_android_stubs.c anv: move VkImage object allocation to anv_CreateImage 2021-10-06 02:18:39 +00:00
anv_batch_chain.c anv: Add an anv_bo_is_pinned helper 2021-11-09 02:48:24 +00:00
anv_blorp.c intel/blorp: Add option to emit packets that disable Mesh 2021-11-04 14:41:06 -07:00
anv_cmd_buffer.c anv: Use the common vk_error and vk_errorf helpers 2021-10-07 20:51:36 +00:00
anv_descriptor_set.c anv: Flip around the way we reason about storage image lowering 2021-10-11 10:29:09 -05:00
anv_device.c anv: Add an anv_bo_is_pinned helper 2021-11-09 02:48:24 +00:00
anv_formats.c anv: Enable CCS for storage image formats 2021-10-27 10:59:56 -07:00
anv_gem.c intel: Add has_bit6_swizzle to devinfo 2021-11-04 18:51:04 +00:00
anv_gem_stubs.c intel: Add has_bit6_swizzle to devinfo 2021-11-04 18:51:04 +00:00
anv_genX.h anv: Add genX(cmd_buffer_emit_gfx12_depth_wa) 2021-08-20 17:50:35 +00:00
anv_image.c anv: Also disallow CCS_E for multi-LOD images 2021-11-09 23:05:53 +00:00
anv_measure.c intel: Rename genx keyword to gfxx in source files 2021-04-02 18:33:07 +00:00
anv_measure.h intel: support secondary command buffers in INTEL_MEASURE 2021-02-01 17:24:57 -08:00
anv_nir.h anv: Do UBO loads with global addresses for bindless 2021-03-17 17:49:59 +00:00
anv_nir_add_base_work_group_id.c anv: use nir_shader_instructions_pass in anv_nir_add_base_work_group_id 2021-10-05 10:02:54 +00:00
anv_nir_apply_pipeline_layout.c anv: Add a anv_use_relocations helper and use it 2021-11-09 02:48:24 +00:00
anv_nir_compute_push_layout.c anv: fix push constant lowering with bindless shaders 2021-10-26 15:41:43 +00:00
anv_nir_lower_multiview.c anv: preserve all metadata when anv_nir_lower_multiview doesn't make progress 2021-10-05 10:02:54 +00:00
anv_nir_lower_ubo_loads.c anv: Add a pass for lowering A64 UBO access 2021-03-17 17:49:59 +00:00
anv_nir_lower_ycbcr_textures.c anv: use nir_shader_instructions_pass in anv_nir_lower_ycbcr_textures 2021-10-05 10:02:54 +00:00
anv_pass.c vulkan/util: Handle depth-only formats in vk_att_ref_stencil_layout 2021-11-11 17:17:16 +00:00
anv_perf.c intel: fix INTEL_DEBUG environment variable on 32-bit systems 2021-10-15 19:55:14 +00:00
anv_pipeline.c anv: disable debug logging spam 2021-11-04 02:24:43 +00:00
anv_pipeline_cache.c anv: Use the common vk_error and vk_errorf helpers 2021-10-07 20:51:36 +00:00
anv_private.h anv: Add an anv_bo_is_pinned helper 2021-11-09 02:48:24 +00:00
anv_queue.c anv: fix multiple wait/signal on same binary semaphore 2021-11-11 20:59:32 +00:00
anv_util.c anv: Use the common vk_error and vk_errorf helpers 2021-10-07 20:51:36 +00:00
anv_wsi.c anv: setup syncobj fd via wsi_device_setup_syncobj_fd 2021-11-04 16:57:29 +00:00
anv_wsi_display.c anv: use vk_object_zalloc for wsi fences created 2021-10-13 11:59:17 +00:00
genX_blorp_exec.c anv: dirty only state impacted by blorp_exec 2021-10-13 04:31:34 +00:00
genX_cmd_buffer.c anv: Add an anv_bo_is_pinned helper 2021-11-09 02:48:24 +00:00
genX_gpu_memcpy.c anv: Cache VB/IB in L3$ for Gfx12 2021-06-15 12:57:42 +00:00
genX_pipeline.c anv: don't forget to add scratch buffer to BO list 2021-11-10 17:22:15 +00:00
genX_query.c intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
genX_state.c intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
gfx7_cmd_buffer.c anv: Include viewport size in scissor rectangle 2021-11-03 17:48:10 +00:00
gfx8_cmd_buffer.c intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
meson.build vulkan: Move all the common object code to runtime/ 2021-10-29 23:12:32 +00:00
TODO intel: Rename genx keyword to gfxx in source files 2021-04-02 18:33:07 +00:00