diff options
author | Christian König <christian.koenig@amd.com> | 2016-05-18 08:19:32 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 14:50:53 -0400 |
commit | 0e51a772e2014db55b969c06814e8fe01d167ba2 (patch) | |
tree | e9d8e576348a73ac72b5cdf256789c1154ee9436 /drivers/gpu/drm/amd/amdgpu | |
parent | 1e24e31f22a69e0983c3dbc31dc725cd940ad258 (diff) |
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/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 15 |
3 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index aeec288b572a..a5d1cfbb1a87 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -759,7 +759,6 @@ void amdgpu_job_free_func(struct kref *refcount); | |||
759 | int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, | 759 | int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, |
760 | struct amd_sched_entity *entity, void *owner, | 760 | struct amd_sched_entity *entity, void *owner, |
761 | struct fence **f); | 761 | struct fence **f); |
762 | void amdgpu_job_timeout_func(struct work_struct *work); | ||
763 | 762 | ||
764 | struct amdgpu_ring { | 763 | struct amdgpu_ring { |
765 | struct amdgpu_device *adev; | 764 | struct amdgpu_device *adev; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 9bc8f1d99733..72694d7f11f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -838,8 +838,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, | |||
838 | p->job = NULL; | 838 | p->job = NULL; |
839 | 839 | ||
840 | r = amd_sched_job_init(&job->base, &ring->sched, | 840 | r = amd_sched_job_init(&job->base, &ring->sched, |
841 | entity, amdgpu_job_timeout_func, | 841 | entity, amdgpu_job_free_func, |
842 | amdgpu_job_free_func, | ||
843 | p->filp, &fence); | 842 | p->filp, &fence); |
844 | if (r) { | 843 | if (r) { |
845 | amdgpu_job_free(job); | 844 | amdgpu_job_free(job); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index be4698b0b33b..32132f2e236d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | |||
@@ -34,13 +34,14 @@ static void amdgpu_job_free_handler(struct work_struct *ws) | |||
34 | amd_sched_job_put(&job->base); | 34 | amd_sched_job_put(&job->base); |
35 | } | 35 | } |
36 | 36 | ||
37 | void amdgpu_job_timeout_func(struct work_struct *work) | 37 | static void amdgpu_job_timedout(struct amd_sched_job *s_job) |
38 | { | 38 | { |
39 | struct amdgpu_job *job = container_of(work, struct amdgpu_job, base.work_tdr.work); | 39 | struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base); |
40 | |||
40 | DRM_ERROR("ring %s timeout, last signaled seq=%u, last emitted seq=%u\n", | 41 | DRM_ERROR("ring %s timeout, last signaled seq=%u, last emitted seq=%u\n", |
41 | job->base.sched->name, | 42 | job->base.sched->name, |
42 | (uint32_t)atomic_read(&job->ring->fence_drv.last_seq), | 43 | atomic_read(&job->ring->fence_drv.last_seq), |
43 | job->ring->fence_drv.sync_seq); | 44 | job->ring->fence_drv.sync_seq); |
44 | 45 | ||
45 | amd_sched_job_put(&job->base); | 46 | amd_sched_job_put(&job->base); |
46 | } | 47 | } |
@@ -126,8 +127,7 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, | |||
126 | return -EINVAL; | 127 | return -EINVAL; |
127 | 128 | ||
128 | r = amd_sched_job_init(&job->base, &ring->sched, | 129 | r = amd_sched_job_init(&job->base, &ring->sched, |
129 | entity, amdgpu_job_timeout_func, | 130 | entity, amdgpu_job_free_func, owner, &fence); |
130 | amdgpu_job_free_func, owner, &fence); | ||
131 | if (r) | 131 | if (r) |
132 | return r; | 132 | return r; |
133 | 133 | ||
@@ -197,4 +197,5 @@ err: | |||
197 | const struct amd_sched_backend_ops amdgpu_sched_ops = { | 197 | const struct amd_sched_backend_ops amdgpu_sched_ops = { |
198 | .dependency = amdgpu_job_dependency, | 198 | .dependency = amdgpu_job_dependency, |
199 | .run_job = amdgpu_job_run, | 199 | .run_job = amdgpu_job_run, |
200 | .timedout_job = amdgpu_job_timedout, | ||
200 | }; | 201 | }; |