[PATCH 3/4] drm/amdgpu: gfx ip ctrl gfx off via amdgpu_gfx_off_ctrl

Quan, Evan Evan.Quan at amd.com
Mon Jul 30 02:27:20 UTC 2018


Reviewed-by: Evan Quan <evan.quan at amd.com>

________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Rex Zhu <rex.zhu at amd.com>
Sent: Sunday, July 29, 2018 7:35:49 PM
To: amd-gfx at lists.freedesktop.org
Cc: Zhu, Rex
Subject: [PATCH 3/4] drm/amdgpu: gfx ip ctrl gfx off via amdgpu_gfx_off_ctrl

use amdgpu_gfx_off_ctrl function so driver can arbitrate
whether the gfx ip can be power off or power on.

Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++----
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c      | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 9f8e267..d861bfc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1828,8 +1828,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
                                           adev->ip_blocks[i].version->funcs->name, r);
                                 return r;
                         }
-                       if (adev->powerplay.pp_funcs->set_powergating_by_smu)
-                               amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, false);
+                       amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, false);
                         r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
                         /* XXX handle errors */
                         if (r) {
@@ -2013,8 +2012,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
         }

         /* call smu to disable gfx off feature first when suspend */
-       if (adev->powerplay.pp_funcs->set_powergating_by_smu)
-               amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, false);
+       amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, false);

         for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
                 if (!adev->ip_blocks[i].status.valid)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index ef00d14..c3d8030 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3783,13 +3783,11 @@ static int gfx_v9_0_set_powergating_state(void *handle,
                 gfx_v9_0_update_gfx_mg_power_gating(adev, enable);

                 /* set gfx off through smu */
-               if (enable && adev->powerplay.pp_funcs->set_powergating_by_smu)
-                       amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, true);
+               amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, true);
                 break;
         case CHIP_VEGA12:
                 /* set gfx off through smu */
-               if (enable && adev->powerplay.pp_funcs->set_powergating_by_smu)
-                       amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, true);
+               amdgpu_gfx_off_ctrl(adev, AMD_IP_BLOCK_TYPE_GFX, true);
                 break;
         default:
                 break;
--
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180730/06ca952b/attachment.html>


More information about the amd-gfx mailing list