From 631794b8a90e820f4e6fe5acb1d79c35eaba7882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 16 Aug 2022 13:57:55 -0700 Subject: [PATCH] anv: Only wait for queue sync if execbuf was properly executed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case execbuf failed it would block execution until the maximum timeout if DEBUG_SYNC is enabled. While at it also removing the shadowing of result that would cause the function result to not have its values updated in case vk_sync_wait() returns a error. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_batch_chain.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 389ae18e9a8..e81df2f2086 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -2264,11 +2264,9 @@ anv_queue_exec_locked(struct anv_queue *queue, if (ret) result = vk_queue_set_lost(&queue->vk, "execbuf2 failed: %m"); - if (queue->sync) { - VkResult result = vk_sync_wait(&device->vk, - queue->sync, 0, - VK_SYNC_WAIT_COMPLETE, - UINT64_MAX); + if (result == VK_SUCCESS && queue->sync) { + result = vk_sync_wait(&device->vk, queue->sync, 0, + VK_SYNC_WAIT_COMPLETE, UINT64_MAX); if (result != VK_SUCCESS) result = vk_queue_set_lost(&queue->vk, "sync wait failed"); }