anv: Only wait for queue sync if execbuf was properly executed

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 <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18110>
This commit is contained in:
José Roberto de Souza 2022-08-16 13:57:55 -07:00 committed by Marge Bot
parent 7981936e46
commit 631794b8a9

View file

@ -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");
}