summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/scheduler
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-05-18 14:19:32 +0200
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:50:53 -0400
commit0e51a772e2014db55b969c06814e8fe01d167ba2 (patch)
treee9d8e576348a73ac72b5cdf256789c1154ee9436 /drivers/gpu/drm/amd/scheduler
parent1e24e31f22a69e0983c3dbc31dc725cd940ad258 (diff)
downloadblackbird-op-linux-0e51a772e2014db55b969c06814e8fe01d167ba2.tar.gz
blackbird-op-linux-0e51a772e2014db55b969c06814e8fe01d167ba2.zip
drm/amdgpu: properly abstract scheduler timeout handling
The driver shouldn't mess with the scheduler internals. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Monk.Liu <monk.liu@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.c11
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h2
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index e8ee90fa6899..f2ed8c56a07e 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -362,6 +362,14 @@ static void amd_sched_job_begin(struct amd_sched_job *s_job)
}
}
+static void amd_sched_job_timedout(struct work_struct *work)
+{
+ struct amd_sched_job *job = container_of(work, struct amd_sched_job,
+ work_tdr.work);
+
+ job->sched->ops->timedout_job(job);
+}
+
/**
* Submit a job to the job queue
*
@@ -384,7 +392,6 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job)
int amd_sched_job_init(struct amd_sched_job *job,
struct amd_gpu_scheduler *sched,
struct amd_sched_entity *entity,
- void (*timeout_cb)(struct work_struct *work),
void (*free_cb)(struct kref *refcount),
void *owner, struct fence **fence)
{
@@ -397,7 +404,7 @@ int amd_sched_job_init(struct amd_sched_job *job,
return -ENOMEM;
job->s_fence->s_job = job;
- INIT_DELAYED_WORK(&job->work_tdr, timeout_cb);
+ INIT_DELAYED_WORK(&job->work_tdr, amd_sched_job_timedout);
job->free_callback = free_cb;
if (fence)
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 7e333fa08539..f0de46ce7afe 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -108,6 +108,7 @@ static inline struct amd_sched_fence *to_amd_sched_fence(struct fence *f)
struct amd_sched_backend_ops {
struct fence *(*dependency)(struct amd_sched_job *sched_job);
struct fence *(*run_job)(struct amd_sched_job *sched_job);
+ void (*timedout_job)(struct amd_sched_job *sched_job);
};
enum amd_sched_priority {
@@ -153,7 +154,6 @@ void amd_sched_fence_signal(struct amd_sched_fence *fence);
int amd_sched_job_init(struct amd_sched_job *job,
struct amd_gpu_scheduler *sched,
struct amd_sched_entity *entity,
- void (*timeout_cb)(struct work_struct *work),
void (*free_cb)(struct kref* refcount),
void *owner, struct fence **fence);
static inline void amd_sched_job_get(struct amd_sched_job *job)
OpenPOWER on IntegriCloud