mesa/src/intel/vulkan/xe
José Roberto de Souza 7c01cbda6f anv: Optimize vkQueueWaitIdle() on Xe KMD
vk_common_QueueWaitIdle() creates a syncobj, does a submit with no
batch buffers what translates to execute trivial_batch_bo and then
waits for syncobj to be signaled when trivial_batch_bo finishes.

On Xe KMD on other hand we can avoid the trivial_batch_bo submission
and instead use the special DRM_IOCTL_XE_EXEC with num_batch_buffer == 0
to get a syncobj to be signaled when the last exec finish execution.
This should free a bit GPU to execute more important workloads.

This will also optimize vkDeviceWaitIdle() that calls QueueWaitIdle().

It have to fallback to vk_common_QueueWaitIdle() when queue is in
VK_QUEUE_SUBMIT_MODE_THREADED mode because vkQueueWaitIdle()
could return but there still stuff in VK/CPU submission queue.
Also it could cause use after free when resources attached to
submission are freed before it is processed, example:

   vkCreateFence() or vkCreateSemaphore()
   vkQueueSubmit() // with Fence or Semaphore created above
   vkQueueWaitIdle() // with the race it returns
   vkDestroyFence() or vkDestroySemaphore()
   // vk_queue_submit_thread_func() start to process submission above...

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30958>
2024-09-19 23:12:45 +00:00
..
anv_batch_chain.c anv: Make sure all previous vm binds are done before execute perf query pool 2024-09-18 15:29:16 +00:00
anv_batch_chain.h anv: make device initialization more asynchronous 2024-06-13 08:29:25 +00:00
anv_device.c anv: don't expose the compressed memory types when DEBUG_NO_CCS 2024-08-05 18:36:46 +00:00
anv_device.h anv: hide exec_flags selection inside the i915 backend 2023-07-13 17:12:26 +00:00
anv_kmd_backend.c anv/xe: try harder when the vm_bind ioctl fails 2024-07-24 23:18:36 +00:00
anv_queue.c anv: Optimize vkQueueWaitIdle() on Xe KMD 2024-09-19 23:12:45 +00:00
anv_queue.h anv: Optimize vkQueueWaitIdle() on Xe KMD 2024-09-19 23:12:45 +00:00