[2/2] drm/amdgpu: change ring priority after pushing the job

Submitted by Zhou, David(ChunMing) on July 17, 2018, 1:47 a.m.

Details

Message ID SN1PR12MB05109901E61B6366E8E3090BB45C0@SN1PR12MB0510.namprd12.prod.outlook.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Zhou, David(ChunMing) July 17, 2018, 1:47 a.m.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com> for series.


-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Christian K?nig

Sent: Monday, July 16, 2018 9:25 PM
To: amd-gfx@lists.freedesktop.org
Subject: [PATCH 2/2] drm/amdgpu: change ring priority after pushing the job

Pushing a job can change the ring assignment of an entity.

Signed-off-by: Christian K├Ânig <christian.koenig@amd.com>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c  | 4 +++-  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

 	*f = dma_fence_get(&job->base.s_fence->finished);
 	amdgpu_job_free_resources(job);
-	amdgpu_ring_priority_get(ring, job->base.s_priority);
 	drm_sched_entity_push_job(&job->base, entity);
 
+	ring = to_amdgpu_ring(entity->sched);
+	amdgpu_ring_priority_get(ring, job->base.s_priority);
+
 	return 0;
 }
 
--
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 72dc9b36b937..911c4a12a163 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1256,11 +1256,13 @@  static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 	job->uf_sequence = seq;
 
 	amdgpu_job_free_resources(job);
-	amdgpu_ring_priority_get(p->ring, job->base.s_priority);
 
 	trace_amdgpu_cs_ioctl(job);
 	drm_sched_entity_push_job(&job->base, entity);
 
+	ring = to_amdgpu_ring(entity->sched);
+	amdgpu_ring_priority_get(ring, job->base.s_priority);
+
 	ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence);
 	amdgpu_mn_unlock(p->mn);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 024efb7ea6d6..10c769db5d67 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -121,7 +121,7 @@  void amdgpu_job_free(struct amdgpu_job *job)  int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
 		      void *owner, struct dma_fence **f)  {
-	struct amdgpu_ring *ring = to_amdgpu_ring(entity->sched);
+	struct amdgpu_ring *ring;
 	int r;
 
 	if (!f)
@@ -134,9 +134,11 @@  int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
 	job->owner = owner;