anv/trtt: add support for queue->sync to the TR-TT batches

At this moment this patch won't buy us anything since we're already
being completely synchronous, but the next patch is going to change
this and so queue->sync will start making sense.

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/25512>
This commit is contained in:
Paulo Zanoni 2023-11-13 16:01:12 -08:00 committed by Marge Bot
parent 1534ee46b8
commit 0f21836272
2 changed files with 26 additions and 0 deletions

View file

@ -1020,6 +1020,14 @@ i915_execute_trtt_batch(struct anv_sparse_submission *submit,
goto out;
}
if (queue->sync) {
result = anv_execbuf_add_sync(device, &execbuf, queue->sync,
true /* is_signal */,
0 /* signal_value */);
if (result != VK_SUCCESS)
goto out;
}
result = anv_execbuf_add_bo(device, &execbuf, trtt_bbo->bo, NULL, 0);
if (result != VK_SUCCESS)
goto out;
@ -1050,6 +1058,15 @@ i915_execute_trtt_batch(struct anv_sparse_submission *submit,
goto out;
}
if (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, "trtt sync wait failed");
goto out;
}
}
/* TODO: we can get rid of this wait once we can properly handle the buffer
* lifetimes.
*/

View file

@ -226,6 +226,15 @@ xe_execute_trtt_batch(struct anv_sparse_submission *submit,
}
}
if (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, "trtt sync wait failed");
goto exec_error;
}
}
/* FIXME: we shouldn't need this wait, figure out a way to remove it. */
struct drm_syncobj_wait wait = {
.handles = (uintptr_t)&syncobj_handle,