gpu/drm: Eliminate DRM_SCHED_PRIORITY_UNSET
authorLuben Tuikov <luben.tuikov@amd.com>
Tue, 17 Oct 2023 02:48:56 +0000 (22:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 13:11:00 +0000 (14:11 +0100)
[ Upstream commit fa8391ad68c16716e2c06ada397e99ceed2fb647 ]

Eliminate DRM_SCHED_PRIORITY_UNSET, value of -2, whose only user was
amdgpu. Furthermore, eliminate an index bug, in that when amdgpu boots, it
calls drm_sched_entity_init() with DRM_SCHED_PRIORITY_UNSET, which uses it to
index sched->sched_rq[].

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Acked-by: Alex Deucher <Alexander.Deucher@amd.com>
Link: https://lore.kernel.org/r/20231017035656.8211-2-luben.tuikov@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
include/drm/gpu_scheduler.h

index fdbeafda4e80a9fddc3014e769c47e3078045582..1ed2142a6e7bf068a109fcb80e5eddd66d2dbf4b 100644 (file)
@@ -64,7 +64,8 @@ amdgpu_ctx_to_drm_sched_prio(int32_t ctx_prio)
 {
        switch (ctx_prio) {
        case AMDGPU_CTX_PRIORITY_UNSET:
-               return DRM_SCHED_PRIORITY_UNSET;
+               pr_warn_once("AMD-->DRM context priority value UNSET-->NORMAL");
+               return DRM_SCHED_PRIORITY_NORMAL;
 
        case AMDGPU_CTX_PRIORITY_VERY_LOW:
                return DRM_SCHED_PRIORITY_MIN;
index 2ae4fd62e01c4066bd8979632f03fa1a521fd734..17e7e3145a058383749fc4e85f9ad75ef7d0cd32 100644 (file)
@@ -55,8 +55,7 @@ enum drm_sched_priority {
        DRM_SCHED_PRIORITY_HIGH,
        DRM_SCHED_PRIORITY_KERNEL,
 
-       DRM_SCHED_PRIORITY_COUNT,
-       DRM_SCHED_PRIORITY_UNSET = -2
+       DRM_SCHED_PRIORITY_COUNT
 };
 
 /**