anv: fix utrace signaling with Xe

utrace submits can either have a batch or not.

When there is a batch, the utrace vk_sync is signaled by the utrace
batch (because utrace does a timestamp buffer copy using its own
batch). When there is no batch, the utrace vk_sync should be signaled
by the application batch (no timestamp copy required, utrace can read
the timestamps when the application batch has completed).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: fdea48df5e ("anv: Implement Xe version of anv_queue_exec_locked() and queue_exec_trace()")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24085>
This commit is contained in:
Lionel Landwerlin
2023-07-11 12:36:15 +03:00
committed by Marge Bot
parent 6b2fa965c6
commit a85b84ba1e

View File

@@ -119,7 +119,10 @@ xe_exec_process_syncs(struct anv_queue *queue,
uint32_t count = 0;
if (utrace_submit) {
/* Signal the utrace sync only if it doesn't have a batch. Otherwise the
* it's the utrace batch that should signal its own sync.
*/
if (utrace_submit && !utrace_submit->batch_bo) {
struct drm_xe_sync *xe_sync = &xe_syncs[count++];
xe_exec_fill_sync(xe_sync, utrace_submit->sync, 0, TYPE_SIGNAL);
@@ -217,9 +220,6 @@ xe_queue_exec_locked(struct anv_queue *queue,
if (result != VK_SUCCESS)
return result;
if (utrace_submit && !utrace_submit->batch_bo)
utrace_submit = NULL;
struct drm_xe_sync *xe_syncs = NULL;
uint32_t xe_syncs_count = 0;
result = xe_exec_process_syncs(queue, wait_count, waits,
@@ -229,6 +229,10 @@ xe_queue_exec_locked(struct anv_queue *queue,
if (result != VK_SUCCESS)
return result;
/* If we have no batch for utrace, just forget about it now. */
if (utrace_submit && !utrace_submit->batch_bo)
utrace_submit = NULL;
struct drm_xe_exec exec = {
.engine_id = queue->engine_id,
.num_batch_buffer = 1,