]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: introduce AMDGPU_CTX_PRIORITY_UNSET
authorAndres Rodriguez <andresx7@gmail.com>
Mon, 26 Jun 2017 20:12:10 +0000 (16:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2017 20:30:23 +0000 (16:30 -0400)
Use _INVALID to identify bad parameters and _UNSET to represent the
lack of interest in a specific value.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
include/uapi/drm/amdgpu_drm.h

index d3d63f78bec99e3a0037be50bdaa6eee85086770..29eebdc30a4c47f142947b601a43f27cea396fd4 100644 (file)
@@ -230,6 +230,8 @@ static enum amd_sched_priority amdgpu_to_sched_priority(int amdgpu_priority)
        case AMDGPU_CTX_PRIORITY_LOW_SW:
        case AMDGPU_CTX_PRIORITY_LOW_HW:
                return AMD_SCHED_PRIORITY_LOW;
+       case AMDGPU_CTX_PRIORITY_UNSET:
+               return AMD_SCHED_PRIORITY_UNSET;
        default:
                WARN(1, "Invalid context priority %d\n", amdgpu_priority);
                return AMD_SCHED_PRIORITY_INVALID;
index 4b528f7abbfe9fb057f8b0490c1fa8380f8fc9df..52c8e544762445888b36168775687a0d666ab638 100644 (file)
@@ -122,7 +122,8 @@ enum amd_sched_priority {
        AMD_SCHED_PRIORITY_HIGH_HW,
        AMD_SCHED_PRIORITY_KERNEL,
        AMD_SCHED_PRIORITY_MAX,
-       AMD_SCHED_PRIORITY_INVALID = -1
+       AMD_SCHED_PRIORITY_INVALID = -1,
+       AMD_SCHED_PRIORITY_UNSET = -2
 };
 
 /**
index 94ef0af492dc960417d6868236803fb289788e78..7ea33b57893a7e213a08f2945d0b4fa01ce6af5c 100644 (file)
@@ -169,6 +169,7 @@ union drm_amdgpu_bo_list {
 #define AMDGPU_CTX_UNKNOWN_RESET       3
 
 /* Context priority level */
+#define AMDGPU_CTX_PRIORITY_UNSET       -2048
 #define AMDGPU_CTX_PRIORITY_LOW_HW      -1023
 #define AMDGPU_CTX_PRIORITY_LOW_SW      -512
 #define AMDGPU_CTX_PRIORITY_NORMAL      0