From 25441b5e5c3a30b3df0c6bb231e47df0e15a9dec Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 1 Apr 2022 16:10:12 -0500 Subject: [PATCH] v3dv: Put indirect compute CSD jobs in the job list Instead of having the CPU job execute the CSD job, put both jobs on the list with the CPU job first which modifies the GPU job which gets kicked off next. This gives the queue code more visibility into what types of jobs are actually in the list. In particular, if an indirect compute job is the last job in a batch buffer, it currently appears as if the batch ends with CPU work which isn't true because it kicks off GPU work. In that case, the last job on the list is now a GPU job, which better matches reality. Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 12 +----------- src/broadcom/vulkan/v3dv_queue.c | 7 ------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index ee0cfb7c3a4..e60adf1af3b 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -168,14 +168,6 @@ job_destroy_cpu_wait_events_resources(struct v3dv_job *job) vk_free(&job->cmd_buffer->device->vk.alloc, job->cpu.event_wait.events); } -static void -job_destroy_cpu_csd_indirect_resources(struct v3dv_job *job) -{ - assert(job->type == V3DV_JOB_TYPE_CPU_CSD_INDIRECT); - assert(job->cmd_buffer); - v3dv_job_destroy(job->cpu.csd_indirect.csd_job); -} - void v3dv_job_destroy(struct v3dv_job *job) { @@ -199,9 +191,6 @@ v3dv_job_destroy(struct v3dv_job *job) case V3DV_JOB_TYPE_CPU_WAIT_EVENTS: job_destroy_cpu_wait_events_resources(job); break; - case V3DV_JOB_TYPE_CPU_CSD_INDIRECT: - job_destroy_cpu_csd_indirect_resources(job); - break; default: break; } @@ -3571,6 +3560,7 @@ cmd_buffer_dispatch_indirect(struct v3dv_cmd_buffer *cmd_buffer, job->cpu.csd_indirect.wg_uniform_offsets[2]; list_addtail(&job->list_link, &cmd_buffer->jobs); + list_addtail(&csd_job->list_link, &cmd_buffer->jobs); cmd_buffer->state.job = NULL; } diff --git a/src/broadcom/vulkan/v3dv_queue.c b/src/broadcom/vulkan/v3dv_queue.c index 9ba5d797784..d95b4be2f38 100644 --- a/src/broadcom/vulkan/v3dv_queue.c +++ b/src/broadcom/vulkan/v3dv_queue.c @@ -575,11 +575,6 @@ handle_timestamp_query_cpu_job(struct v3dv_job *job) return VK_SUCCESS; } -static VkResult -handle_csd_job(struct v3dv_queue *queue, - struct v3dv_job *job, - struct v3dv_submit_info_semaphores *sems_info); - static VkResult handle_csd_indirect_cpu_job(struct v3dv_queue *queue, struct v3dv_job *job, @@ -610,8 +605,6 @@ handle_csd_indirect_cpu_job(struct v3dv_queue *queue, v3dv_cmd_buffer_rewrite_indirect_csd_job(info, group_counts); } - handle_csd_job(queue, info->csd_job, sems_info); - return VK_SUCCESS; }