drm/amd/sched: revise priority number
authorChunming Zhou <David1.Zhou@amd.com>
Thu, 16 Mar 2017 03:44:49 +0000 (11:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:54:03 +0000 (23:54 -0400)
big number is to high priority.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
drivers/gpu/drm/amd/scheduler/gpu_scheduler.h

index 4122dbee8511c6e807680d59c908b462a9a587f4..acd882a188bc84f5694ce94b095a5d2160e89ae2 100644 (file)
@@ -502,7 +502,7 @@ amd_sched_select_entity(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;
@@ -610,7 +610,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);
index e037b1e8be6d33c8f1604646844fedc4af169230..0255c7f8a6d8350604ef54bde3561a725edaa930 100644 (file)
@@ -108,9 +108,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
 };
 
 /**
@@ -121,7 +122,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;