From acb759c44fad9fb1cd6029dedab065c8d623b7b8 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Tue, 27 Aug 2024 16:20:21 -0700 Subject: [PATCH] anv/trtt: decrement trtt->timeline_val when submission fails Otherwise code such as anv_sparse_trtt_garbage_collect_batches() may end up stuck waiting forever on a timeline of a submission that failed. Reviewed-by: Lionel Landwerlin Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_sparse.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index 1ac5684ae03..62f0c99d620 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -742,11 +742,6 @@ anv_sparse_bind_trtt(struct anv_device *device, anv_sparse_trtt_garbage_collect_batches(device, false); - submit->base.signal = (struct vk_sync_signal) { - .sync = trtt->timeline, - .signal_value = ++trtt->timeline_val, - }; - /* These capacities are conservative estimations. For L1 binds the * number will match exactly unless we skip NULL binds due to L2 already * being NULL. For L3/L2 things are harder to estimate, but the resulting @@ -832,15 +827,21 @@ anv_sparse_bind_trtt(struct anv_device *device, } } + submit->base.signal = (struct vk_sync_signal) { + .sync = trtt->timeline, + .signal_value = ++trtt->timeline_val, + }; + result = device->kmd_backend->queue_exec_async(&submit->base, sparse_submit->wait_count, sparse_submit->waits, sparse_submit->signal_count, sparse_submit->signals); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS) { + trtt->timeline_val--; goto out_add_bind; - + } list_addtail(&submit->link, &trtt->in_flight_batches);