uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass)
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit)
{
struct anv_device *device = queue->device;
VkResult result = VK_SUCCESS;
cmd_buffer_count, cmd_buffers,
needs_companion_sync ? 0 : signal_count, signals,
perf_query_pool,
- perf_query_pass);
+ perf_query_pass,
+ utrace_submit);
if (result != VK_SUCCESS)
return result;
1, &companion_sync,
0, NULL,
signal_count, signals,
- NULL, 0);
+ NULL, 0,
+ NULL);
}
return result;
static VkResult
anv_queue_submit_locked(struct anv_queue *queue,
- struct vk_queue_submit *submit)
+ struct vk_queue_submit *submit,
+ struct anv_utrace_submit *utrace_submit)
{
VkResult result;
NULL /* cmd_buffers */,
submit->signal_count, submit->signals,
NULL /* perf_query_pool */,
- 0 /* perf_query_pass */);
+ 0 /* perf_query_pass */,
+ utrace_submit);
if (result != VK_SUCCESS)
return result;
} else {
next == end ? submit->signal_count : 0,
next == end ? submit->signals : NULL,
perf_query_pool,
- submit->perf_pass_index);
+ submit->perf_pass_index,
+ next == end ? utrace_submit : NULL);
if (result != VK_SUCCESS)
return result;
if (next < end) {
return VK_SUCCESS;
}
+ /* Flush the trace points first before taking the lock as the flushing
+ * might try to take that same lock.
+ */
+ struct anv_utrace_submit *utrace_submit = NULL;
+ result = anv_device_utrace_flush_cmd_buffers(
+ queue,
+ submit->command_buffer_count,
+ (struct anv_cmd_buffer **)submit->command_buffers,
+ &utrace_submit);
+ if (result != VK_SUCCESS)
+ return result;
+
pthread_mutex_lock(&device->mutex);
uint64_t start_ts = intel_ds_begin_submit(&queue->ds);
- result = anv_queue_submit_locked(queue, submit);
+ result = anv_queue_submit_locked(queue, submit, utrace_submit);
/* Take submission ID under lock */
intel_ds_end_submit(&queue->ds, start_ts);
uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass)
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit)
{
return VK_ERROR_UNKNOWN;
}
uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass);
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit);
VkResult (*queue_exec_trace)(struct anv_queue *queue,
struct anv_utrace_submit *submit);
uint32_t (*bo_alloc_flags_to_bo_flags)(struct anv_device *device,
uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass)
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit)
{
struct anv_device *device = queue->device;
- struct anv_utrace_submit *utrace_submit = NULL;
struct anv_execbuf execbuf = {
.alloc = &queue->device->vk.alloc,
.alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE,
.perf_query_pass = perf_query_pass,
};
-
- /* Flush the trace points first, they need to be moved */
- VkResult result =
- anv_device_utrace_flush_cmd_buffers(queue,
- cmd_buffer_count,
- cmd_buffers,
- &utrace_submit);
- if (result != VK_SUCCESS)
- goto error;
+ VkResult result;
if (utrace_submit && !utrace_submit->batch_bo) {
result = anv_execbuf_add_sync(device, &execbuf,
uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass);
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit);
uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass)
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit)
{
struct anv_device *device = queue->device;
- struct anv_utrace_submit *utrace_submit = NULL;
VkResult result;
- result = anv_device_utrace_flush_cmd_buffers(queue, cmd_buffer_count,
- cmd_buffers, &utrace_submit);
- if (result != VK_SUCCESS)
- return result;
-
struct drm_xe_sync *xe_syncs = NULL;
uint32_t xe_syncs_count = 0;
result = xe_exec_process_syncs(queue, wait_count, waits,
uint32_t signal_count,
const struct vk_sync_signal *signals,
struct anv_query_pool *perf_query_pool,
- uint32_t perf_query_pass);
+ uint32_t perf_query_pass,
+ struct anv_utrace_submit *utrace_submit);
VkResult
xe_queue_exec_utrace_locked(struct anv_queue *queue,