Use _INVALID to identify bad parameters and _UNSET to represent the lack of interest in a specific value.
Unified · Split
| @@ -230,6 +230,8 @@ static enum amd_sched_priority amdgpu_to_sched_priority(int amdgpu_priority) · 229 unmodified lines | ||
| 230 | 230 | case AMDGPU_CTX_PRIORITY_LOW_SW: |
| 231 | 231 | case AMDGPU_CTX_PRIORITY_LOW_HW: |
| 232 | 232 | return AMD_SCHED_PRIORITY_LOW; |
| 233 | + case AMDGPU_CTX_PRIORITY_UNSET: | |
| 234 | + return AMD_SCHED_PRIORITY_UNSET; | |
| 233 | 235 | default: |
| 234 | 236 | WARN(1, "Invalid context priority %d\n", amdgpu_priority); |
| 235 | 237 | return AMD_SCHED_PRIORITY_INVALID; |
| @@ -122,7 +122,8 @@ enum amd_sched_priority { · 121 unmodified lines | ||
| 122 | 122 | AMD_SCHED_PRIORITY_HIGH_HW, |
| 123 | 123 | AMD_SCHED_PRIORITY_KERNEL, |
| 124 | 124 | AMD_SCHED_PRIORITY_MAX, |
| 125 | − AMD_SCHED_PRIORITY_INVALID = -1 | |
| 125 | + AMD_SCHED_PRIORITY_INVALID = -1, | |
| 126 | + AMD_SCHED_PRIORITY_UNSET = -2 | |
| 126 | 127 | }; |
| 127 | 128 | |
| 128 | 129 | /** |
| @@ -169,6 +169,7 @@ union drm_amdgpu_bo_list { · 168 unmodified lines | ||
| 169 | 169 | #define AMDGPU_CTX_UNKNOWN_RESET 3 |
| 170 | 170 | |
| 171 | 171 | /* Context priority level */ |
| 172 | +#define AMDGPU_CTX_PRIORITY_UNSET -2048 | |
| 172 | 173 | #define AMDGPU_CTX_PRIORITY_LOW_HW -1023 |
| 173 | 174 | #define AMDGPU_CTX_PRIORITY_LOW_SW -512 |
| 174 | 175 | #define AMDGPU_CTX_PRIORITY_NORMAL 0 |