Commit 214a91e6 authored by Nicolai Hähnle's avatar Nicolai Hähnle Committed by Alex Deucher

drm/amd/sched: move adding finish callback to amd_sched_job_begin

The finish callback is responsible for removing the job from the ring
mirror list, among other things. It makes sense to add it as callback
in the place where the job is added to the ring mirror list.
Signed-off-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAndres Rodriguez <andresx7@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1650c14b
...@@ -395,6 +395,9 @@ static void amd_sched_job_begin(struct amd_sched_job *s_job) ...@@ -395,6 +395,9 @@ static void amd_sched_job_begin(struct amd_sched_job *s_job)
{ {
struct amd_gpu_scheduler *sched = s_job->sched; struct amd_gpu_scheduler *sched = s_job->sched;
dma_fence_add_callback(&s_job->s_fence->finished, &s_job->finish_cb,
amd_sched_job_finish_cb);
spin_lock(&sched->job_list_lock); spin_lock(&sched->job_list_lock);
list_add_tail(&s_job->node, &sched->ring_mirror_list); list_add_tail(&s_job->node, &sched->ring_mirror_list);
if (sched->timeout != MAX_SCHEDULE_TIMEOUT && if (sched->timeout != MAX_SCHEDULE_TIMEOUT &&
...@@ -487,8 +490,6 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job) ...@@ -487,8 +490,6 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job)
struct amd_sched_entity *entity = sched_job->s_entity; struct amd_sched_entity *entity = sched_job->s_entity;
trace_amd_sched_job(sched_job); trace_amd_sched_job(sched_job);
dma_fence_add_callback(&sched_job->s_fence->finished, &sched_job->finish_cb,
amd_sched_job_finish_cb);
wait_event(entity->sched->job_scheduled, wait_event(entity->sched->job_scheduled,
amd_sched_entity_in(sched_job)); amd_sched_entity_in(sched_job));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment