diff --git a/src/intel/vulkan/xe/anv_batch_chain.c b/src/intel/vulkan/xe/anv_batch_chain.c index bad00dce2c0..dbcf989d7c3 100644 --- a/src/intel/vulkan/xe/anv_batch_chain.c +++ b/src/intel/vulkan/xe/anv_batch_chain.c @@ -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,