diff options
author | Chunming Zhou <David1.Zhou@amd.com> | 2016-06-30 11:30:37 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 15:06:13 -0400 |
commit | e686e75dacb262a7d5f6673e1b9bfe0e62cd287a (patch) | |
tree | 2afa1cdf2ebcd06aa87a9068968de6beb10136b6 /drivers/gpu/drm/amd/scheduler | |
parent | 754ce0fa55c4e464626e961ddb98f935ab85aa19 (diff) | |
download | op-kernel-dev-e686e75dacb262a7d5f6673e1b9bfe0e62cd287a.zip op-kernel-dev-e686e75dacb262a7d5f6673e1b9bfe0e62cd287a.tar.gz |
drm/amd: add amd_sched_hw_job_reset
amd_sched_hw_job_reset will remove callback from hw fence.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler')
-rw-r--r-- | drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 717655d..cf2d64b 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -381,6 +381,20 @@ static void amd_sched_job_timedout(struct work_struct *work) job->sched->ops->timedout_job(job); } +void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched) +{ + struct amd_sched_job *s_job; + + spin_lock(&sched->job_list_lock); + list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node) { + if (fence_remove_callback(s_job->s_fence->parent, &s_job->s_fence->cb)) { + fence_put(s_job->s_fence->parent); + s_job->s_fence->parent = NULL; + } + } + spin_unlock(&sched->job_list_lock); +} + /** * Submit a job to the job queue * diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h index 545fda7..fdcd8fb 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h @@ -153,4 +153,5 @@ int amd_sched_job_init(struct amd_sched_job *job, struct amd_gpu_scheduler *sched, struct amd_sched_entity *entity, void *owner); +void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched); #endif |