mesa/src/intel
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
..
blorp anv,blorp,iris: Set MOCS for COMPUTE_WALKER post-sync operation 2021-11-08 23:29:51 +00:00
common intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
compiler intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
dev anv: Pull aperture size from devinfo 2021-11-09 02:48:24 +00:00
ds intel/pps: reuse timestamp_frequency from intel_device_info 2021-10-28 13:16:56 +03:00
genxml intel/genxml/125: Update COMPUTE_WALKER POSTSYNC_DATA struct 2021-11-08 23:29:51 +00:00
isl intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
nullhw-layer
perf intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
tools intel: move away from booleans to identify platforms 2021-11-08 16:48:06 +00:00
vulkan anv: fix multiple wait/signal on same binary semaphore 2021-11-11 20:59:32 +00:00
Makefile.perf.am
meson.build