diff options
author | Christian König <christian.koenig@amd.com> | 2018-07-16 08:58:48 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-18 17:18:44 -0400 |
commit | b5286801705b39e44b824520714d503f882fef1c (patch) | |
tree | bfe405dfc922b51893f1b7c42138d3d0361b2cb6 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | 9d46f32bdd3e9d4bf435c5ae50f72fb475bf0620 (diff) |
drm/amdgpu: change ring priority after pushing the job (v2)
Pushing a job can change the ring assignment of an entity.
v2: squash in:
"drm/amdgpu: fix job priority handling" (Christian)
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 72dc9b36b937..7c5cc33d0cda 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -1209,6 +1209,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, | |||
1209 | { | 1209 | { |
1210 | struct amdgpu_ring *ring = p->ring; | 1210 | struct amdgpu_ring *ring = p->ring; |
1211 | struct drm_sched_entity *entity = &p->ctx->rings[ring->idx].entity; | 1211 | struct drm_sched_entity *entity = &p->ctx->rings[ring->idx].entity; |
1212 | enum drm_sched_priority priority; | ||
1212 | struct amdgpu_job *job; | 1213 | struct amdgpu_job *job; |
1213 | unsigned i; | 1214 | unsigned i; |
1214 | uint64_t seq; | 1215 | uint64_t seq; |
@@ -1256,11 +1257,14 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, | |||
1256 | job->uf_sequence = seq; | 1257 | job->uf_sequence = seq; |
1257 | 1258 | ||
1258 | amdgpu_job_free_resources(job); | 1259 | amdgpu_job_free_resources(job); |
1259 | amdgpu_ring_priority_get(p->ring, job->base.s_priority); | ||
1260 | 1260 | ||
1261 | trace_amdgpu_cs_ioctl(job); | 1261 | trace_amdgpu_cs_ioctl(job); |
1262 | priority = job->base.s_priority; | ||
1262 | drm_sched_entity_push_job(&job->base, entity); | 1263 | drm_sched_entity_push_job(&job->base, entity); |
1263 | 1264 | ||
1265 | ring = to_amdgpu_ring(entity->sched); | ||
1266 | amdgpu_ring_priority_get(ring, priority); | ||
1267 | |||
1264 | ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence); | 1268 | ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence); |
1265 | amdgpu_mn_unlock(p->mn); | 1269 | amdgpu_mn_unlock(p->mn); |
1266 | 1270 | ||