[PATCH 1/2] drm/sched: select new rq even if there is only one v3
Jiang, Sonny
Sonny.Jiang at amd.com
Fri Mar 5 13:50:02 UTC 2021
[AMD Official Use Only - Internal Distribution Only]
Reviewed-by: Sonny Jiang <sonny.jiang at amd.com>
________________________________
From: Christian König <ckoenig.leichtzumerken at gmail.com>
Sent: Friday, March 5, 2021 7:51 AM
To: dri-devel at lists.freedesktop.org <dri-devel at lists.freedesktop.org>; amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Liu, Leo <Leo.Liu at amd.com>; Jiang, Sonny <Sonny.Jiang at amd.com>
Subject: [PATCH 1/2] drm/sched: select new rq even if there is only one v3
This is necessary when changing priorities of an entity.
v2: test the sched_list instead of num_sched.
v3: set the sched_list to NULL when there is only one entry
Signed-off-by: Christian König <christian.koenig at amd.com>
---
drivers/gpu/drm/scheduler/sched_entity.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index 92d965b629c6..f0790e9471d1 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -453,7 +453,7 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
struct drm_gpu_scheduler *sched;
struct drm_sched_rq *rq;
- if (spsc_queue_count(&entity->job_queue) || entity->num_sched_list <= 1)
+ if (spsc_queue_count(&entity->job_queue) || !entity->sched_list)
return;
fence = READ_ONCE(entity->last_scheduled);
@@ -467,8 +467,10 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
drm_sched_rq_remove_entity(entity->rq, entity);
entity->rq = rq;
}
-
spin_unlock(&entity->rq_lock);
+
+ if (entity->num_sched_list == 1)
+ entity->sched_list = NULL;
}
/**
--
2.25.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210305/b91da7ab/attachment.htm>
More information about the dri-devel
mailing list