drm/scheduler: Add drm_sched_job_cleanup
This patch adds a new API to clean up the scheduler job resources. This is primarliy needed in cases the job was created but was not queued to the scheduler queue. Additionally with this change, the layer which creates the scheduler job also gets to free up the job's resources and this entails moving the dma_fence_put(finished_fence) to the drivers ops free handler routines. Signed-off-by: Sharat Masetty <smasetty@codeaurora.org> Reviewed-by: Christian König <christian.koenig@amd.com> Acked-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

gecommit door
Alex Deucher

bovenliggende
98079389a8
commit
26efecf955
@@ -211,7 +211,6 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
|
||||
|
||||
drm_sched_fence_finished(job->s_fence);
|
||||
WARN_ON(job->s_fence->parent);
|
||||
dma_fence_put(&job->s_fence->finished);
|
||||
job->sched->ops->free_job(job);
|
||||
}
|
||||
|
||||
|
@@ -233,7 +233,6 @@ static void drm_sched_job_finish(struct work_struct *work)
|
||||
drm_sched_start_timeout(sched);
|
||||
spin_unlock(&sched->job_list_lock);
|
||||
|
||||
dma_fence_put(&s_job->s_fence->finished);
|
||||
sched->ops->free_job(s_job);
|
||||
}
|
||||
|
||||
@@ -440,6 +439,18 @@ int drm_sched_job_init(struct drm_sched_job *job,
|
||||
}
|
||||
EXPORT_SYMBOL(drm_sched_job_init);
|
||||
|
||||
/**
|
||||
* drm_sched_job_cleanup - clean up scheduler job resources
|
||||
*
|
||||
* @job: scheduler job to clean up
|
||||
*/
|
||||
void drm_sched_job_cleanup(struct drm_sched_job *job)
|
||||
{
|
||||
dma_fence_put(&job->s_fence->finished);
|
||||
job->s_fence = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_sched_job_cleanup);
|
||||
|
||||
/**
|
||||
* drm_sched_ready - is the scheduler ready
|
||||
*
|
||||
|
Verwijs in nieuw issue
Block a user