mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 10:40:11 +01:00
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> |
||
|---|---|---|
| .. | ||
| anv_batch_chain.c | ||
| anv_batch_chain.h | ||
| anv_device.c | ||
| anv_device.h | ||
| anv_kmd_backend.c | ||
| anv_queue.c | ||
| anv_queue.h | ||