drm/amdgpu: allow for more flexible priority handling
Subsystems (2)
PATCH 1/2 drm/amdgpu: allow for more flexible priority handling
Allow to call amdgpu_ring_priority_get() after pushing the ring to the scheduler.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -1
@@ -211,7 +211,8 @@ void amdgpu_ring_priority_get(struct amdgpu_ring *ring,if (!ring->funcs->set_priority)return ; -atomic_inc (&ring->num_jobs[priority]); +if (atomic_inc_return (&ring->num_jobs[priority]) <=0 ) +return ;mutex_lock (&ring->priority_mutex);if (priority <= ring->priority)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180716132448.21767-1-christian.koenig-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: change ring priority after pushing the job
Pushing a job can change the ring assignment of an entity.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -1
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +4 -2
@@ -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; *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 ; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180716132448.21767-2-christian.koenig-5C7GfCeVMHo@public.gmane.org
Zhou, David(ChunMing)
Reviewed-by Chunming ZhouRE: [PATCH 2/2] drm/amdgpu: change ring priority after pushing the job
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian K?nig
Sent: Monday, July 16, 2018 9:25 PM
To: [email protected]
Subject: [PATCH 2/2] drm/amdgpu: change ring priority after pushing the job
Pushing a job can change the ring assignment of an entity.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -1
@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +4 -2
@@ -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; *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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx