drm/amdgpu/gfx9: allow updating sck slowdown and cp pg state
authorHawking Zhang <Hawking.Zhang@amd.com>
Mon, 13 Feb 2017 10:00:43 +0000 (18:00 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 21:41:05 +0000 (17:41 -0400)
More stuff for gfx pg.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index c8f236de7116619a496ef6f8f4c77e7cd5f5cd4b..8e0f7e68be5c8cf89478796adbf6a2058218a917 100644 (file)
@@ -3399,6 +3399,27 @@ static const struct amdgpu_rlc_funcs gfx_v9_0_rlc_funcs = {
 static int gfx_v9_0_set_powergating_state(void *handle,
                                          enum amd_powergating_state state)
 {
+       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+       switch (adev->asic_type) {
+       case CHIP_RAVEN:
+               if (adev->pg_flags & AMD_PG_SUPPORT_RLC_SMU_HS) {
+                       gfx_v9_0_enable_sck_slow_down_on_power_up(adev, true);
+                       gfx_v9_0_enable_sck_slow_down_on_power_down(adev, true);
+               } else {
+                       gfx_v9_0_enable_sck_slow_down_on_power_up(adev, false);
+                       gfx_v9_0_enable_sck_slow_down_on_power_down(adev, false);
+               }
+
+               if (adev->pg_flags & AMD_PG_SUPPORT_CP)
+                       gfx_v9_0_enable_cp_power_gating(adev, true);
+               else
+                       gfx_v9_0_enable_cp_power_gating(adev, false);
+               break;
+       default:
+               break;
+       }
+
        return 0;
 }