]> 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 8c9bacfdbc300c751e7fe3713548acd12e984882..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);
 
 }
 
@@ -804,3 +808,34 @@ failed_undo:
 failed_kiq_write:
        dev_err(adev->dev, "failed to write reg:%x\n", reg);
 }
+
+int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev)
+{
+       if (amdgpu_num_kcq == -1) {
+               return 8;
+       } else if (amdgpu_num_kcq > 8 || amdgpu_num_kcq < 0) {
+               dev_warn(adev->dev, "set kernel compute queue number to 8 due to invalid parameter provided by user\n");
+               return 8;
+       }
+       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.036601 seconds and 4 git commands to generate.