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 <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
This commit is contained in:
Jason Ekstrand
2022-04-01 16:10:12 -05:00
committed by Marge Bot
parent 0208bb2d58
commit 25441b5e5c
2 changed files with 1 additions and 18 deletions
+1 -11
View File
@@ -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;
}
-7
View File
@@ -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;
}