]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_gfx.c
index e584f48f3b548561ed326cc467a7443d10c58c7e..cd2c676a2797cc084950f90a0727064c6e076181 100644 (file)
@@ -193,10 +193,14 @@ static bool amdgpu_gfx_is_multipipe_capable(struct amdgpu_device *adev)
 }
 
 bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
-                                              int queue)
+                                              int pipe, int queue)
 {
-       /* Policy: make queue 0 of each pipe as high priority compute queue */
-       return (queue == 0);
+       bool multipipe_policy = amdgpu_gfx_is_multipipe_capable(adev);
+       int cond;
+       /* Policy: alternate between normal and high priority */
+       cond = multipipe_policy ? pipe : queue;
+
+       return ((cond % 2) != 0);
 
 }
 
@@ -815,3 +819,23 @@ int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev)
        }
        return amdgpu_num_kcq;
 }
+
+/* amdgpu_gfx_state_change_set - Handle gfx power state change set
+ * @adev: amdgpu_device pointer
+ * @state: gfx power state(1 -sGpuChangeState_D0Entry and 2 -sGpuChangeState_D3Entry)
+ *
+ */
+
+void amdgpu_gfx_state_change_set(struct amdgpu_device *adev, enum gfx_change_state state)
+{
+       if (is_support_sw_smu(adev)) {
+               smu_gfx_state_change_set(&adev->smu, state);
+       } else {
+               mutex_lock(&adev->pm.mutex);
+               if (adev->powerplay.pp_funcs &&
+                   adev->powerplay.pp_funcs->gfx_state_change_set)
+                       ((adev)->powerplay.pp_funcs->gfx_state_change_set(
+                               (adev)->powerplay.pp_handle, state));
+               mutex_unlock(&adev->pm.mutex);
+       }
+}
This page took 0.045073 seconds and 4 git commands to generate.