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 <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30953>
This commit is contained in:
Paulo Zanoni 2024-08-27 16:20:21 -07:00 committed by Marge Bot
parent 0802bbd486
commit acb759c44f

View file

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