[PATCH 1/2] drm/amd/sched: revise priority number

Chunming Zhou David1.Zhou at amd.com
Thu Mar 16 09:00:48 UTC 2017


big number is to high priority.

Change-Id: I1e94b3403d0cfd41a418d2bd741736cf7edc5d77
Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
---
 drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 4 ++--
 drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 3ff25af..0f439dd 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -499,7 +499,7 @@ static void amd_sched_wakeup(struct amd_gpu_scheduler *sched)
 		return NULL;
 
 	/* Kernel run queue has higher priority than normal run queue*/
-	for (i = 0; i < AMD_SCHED_MAX_PRIORITY; i++) {
+	for (i = AMD_SCHED_PRIORITY_MAX - 1; i >= AMD_SCHED_PRIORITY_MIN; i--) {
 		entity = amd_sched_rq_select_entity(&sched->sched_rq[i]);
 		if (entity)
 			break;
@@ -607,7 +607,7 @@ int amd_sched_init(struct amd_gpu_scheduler *sched,
 	sched->hw_submission_limit = hw_submission;
 	sched->name = name;
 	sched->timeout = timeout;
-	for (i = 0; i < AMD_SCHED_MAX_PRIORITY; i++)
+	for (i = AMD_SCHED_PRIORITY_MIN; i < AMD_SCHED_PRIORITY_MAX; i++)
 		amd_sched_rq_init(&sched->sched_rq[i]);
 
 	init_waitqueue_head(&sched->wake_up_worker);
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 338d840..99f0240 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -111,9 +111,10 @@ struct amd_sched_backend_ops {
 };
 
 enum amd_sched_priority {
-	AMD_SCHED_PRIORITY_KERNEL = 0,
-	AMD_SCHED_PRIORITY_NORMAL,
-	AMD_SCHED_MAX_PRIORITY
+	AMD_SCHED_PRIORITY_MIN,
+	AMD_SCHED_PRIORITY_NORMAL = AMD_SCHED_PRIORITY_MIN,
+	AMD_SCHED_PRIORITY_KERNEL,
+	AMD_SCHED_PRIORITY_MAX
 };
 
 /**
@@ -124,7 +125,7 @@ struct amd_gpu_scheduler {
 	uint32_t			hw_submission_limit;
 	long				timeout;
 	const char			*name;
-	struct amd_sched_rq		sched_rq[AMD_SCHED_MAX_PRIORITY];
+	struct amd_sched_rq		sched_rq[AMD_SCHED_PRIORITY_MAX];
 	wait_queue_head_t		wake_up_worker;
 	wait_queue_head_t		job_scheduled;
 	atomic_t			hw_rq_count;
-- 
1.9.1



More information about the amd-gfx mailing list