summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/vi.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2016-12-08 10:58:15 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-01-27 11:12:46 -0500
commitf6f534e2af5b518f522b5df244accf945a6207ec (patch)
treefff9a1be97b6e3754f63d5705882ae3a6a94b292 /drivers/gpu/drm/amd/amdgpu/vi.c
parente8a95b274d2f1a46dda12fa8e0cd2806df791701 (diff)
downloadop-kernel-dev-f6f534e2af5b518f522b5df244accf945a6207ec.zip
op-kernel-dev-f6f534e2af5b518f522b5df244accf945a6207ec.tar.gz
drm/amdgpu: add drm light sleep support for Vi
v2: fix copy error. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vi.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index bb6eacb..fbb7d8b 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1177,6 +1177,23 @@ static void vi_update_hdp_light_sleep(struct amdgpu_device *adev,
WREG32(mmHDP_MEM_POWER_LS, data);
}
+static void vi_update_drm_light_sleep(struct amdgpu_device *adev,
+ bool enable)
+{
+ uint32_t temp, data;
+
+ temp = data = RREG32(0x157a);
+
+ if (enable && (adev->cg_flags & AMD_CG_SUPPORT_DRM_LS))
+ data |= 1;
+ else
+ data &= ~1;
+
+ if (temp != data)
+ WREG32(0x157a, data);
+}
+
+
static void vi_update_rom_medium_grain_clock_gating(struct amdgpu_device *adev,
bool enable)
{
@@ -1337,6 +1354,8 @@ static int vi_common_set_clockgating_state(void *handle,
state == AMD_CG_STATE_GATE ? true : false);
vi_update_hdp_light_sleep(adev,
state == AMD_CG_STATE_GATE ? true : false);
+ vi_update_drm_light_sleep(adev,
+ state == AMD_CG_STATE_GATE ? true : false);
break;
case CHIP_TONGA:
case CHIP_POLARIS10:
OpenPOWER on IntegriCloud