]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
Merge tag 'pinctrl-v6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ctx.c
index 0dc9c655c4fbdbd9dbd3224508fac806dbd99dfc..5cb33ac99f7089fb81c4954d8cbb6c434c713be6 100644 (file)
@@ -42,12 +42,12 @@ const unsigned int amdgpu_ctx_num_entities[AMDGPU_HW_IP_NUM] = {
        [AMDGPU_HW_IP_VCN_DEC]  =       1,
        [AMDGPU_HW_IP_VCN_ENC]  =       1,
        [AMDGPU_HW_IP_VCN_JPEG] =       1,
+       [AMDGPU_HW_IP_VPE]      =       1,
 };
 
 bool amdgpu_ctx_priority_is_valid(int32_t ctx_prio)
 {
        switch (ctx_prio) {
-       case AMDGPU_CTX_PRIORITY_UNSET:
        case AMDGPU_CTX_PRIORITY_VERY_LOW:
        case AMDGPU_CTX_PRIORITY_LOW:
        case AMDGPU_CTX_PRIORITY_NORMAL:
@@ -55,6 +55,11 @@ bool amdgpu_ctx_priority_is_valid(int32_t ctx_prio)
        case AMDGPU_CTX_PRIORITY_VERY_HIGH:
                return true;
        default:
+       case AMDGPU_CTX_PRIORITY_UNSET:
+               /* UNSET priority is not valid and we don't carry that
+                * around, but set it to NORMAL in the only place this
+                * function is called, amdgpu_ctx_ioctl().
+                */
                return false;
        }
 }
@@ -64,13 +69,14 @@ 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;
+               return DRM_SCHED_PRIORITY_LOW;
 
        case AMDGPU_CTX_PRIORITY_LOW:
-               return DRM_SCHED_PRIORITY_MIN;
+               return DRM_SCHED_PRIORITY_LOW;
 
        case AMDGPU_CTX_PRIORITY_NORMAL:
                return DRM_SCHED_PRIORITY_NORMAL;
@@ -94,9 +100,6 @@ amdgpu_ctx_to_drm_sched_prio(int32_t ctx_prio)
 static int amdgpu_ctx_priority_permit(struct drm_file *filp,
                                      int32_t priority)
 {
-       if (!amdgpu_ctx_priority_is_valid(priority))
-               return -EINVAL;
-
        /* NORMAL and below are accessible by everyone */
        if (priority <= AMDGPU_CTX_PRIORITY_NORMAL)
                return 0;
@@ -631,8 +634,6 @@ static int amdgpu_ctx_query2(struct amdgpu_device *adev,
        return 0;
 }
 
-
-
 static int amdgpu_ctx_stable_pstate(struct amdgpu_device *adev,
                                    struct amdgpu_fpriv *fpriv, uint32_t id,
                                    bool set, u32 *stable_pstate)
@@ -675,8 +676,10 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
        id = args->in.ctx_id;
        priority = args->in.priority;
 
-       /* For backwards compatibility reasons, we need to accept
-        * ioctls with garbage in the priority field */
+       /* For backwards compatibility, we need to accept ioctls with garbage
+        * in the priority field. Garbage values in the priority field, result
+        * in the priority being set to NORMAL.
+        */
        if (!amdgpu_ctx_priority_is_valid(priority))
                priority = AMDGPU_CTX_PRIORITY_NORMAL;
 
This page took 0.038119 seconds and 4 git commands to generate.