diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2016-12-07 21:58:15 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:12:46 -0500 |
commit | f6f534e2af5b518f522b5df244accf945a6207ec (patch) | |
tree | fff9a1be97b6e3754f63d5705882ae3a6a94b292 | |
parent | e8a95b274d2f1a46dda12fa8e0cd2806df791701 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vi.c | 19 |
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 bb6eacb6b23d..fbb7d8bf5a58 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, | |||
1177 | WREG32(mmHDP_MEM_POWER_LS, data); | 1177 | WREG32(mmHDP_MEM_POWER_LS, data); |
1178 | } | 1178 | } |
1179 | 1179 | ||
1180 | static void vi_update_drm_light_sleep(struct amdgpu_device *adev, | ||
1181 | bool enable) | ||
1182 | { | ||
1183 | uint32_t temp, data; | ||
1184 | |||
1185 | temp = data = RREG32(0x157a); | ||
1186 | |||
1187 | if (enable && (adev->cg_flags & AMD_CG_SUPPORT_DRM_LS)) | ||
1188 | data |= 1; | ||
1189 | else | ||
1190 | data &= ~1; | ||
1191 | |||
1192 | if (temp != data) | ||
1193 | WREG32(0x157a, data); | ||
1194 | } | ||
1195 | |||
1196 | |||
1180 | static void vi_update_rom_medium_grain_clock_gating(struct amdgpu_device *adev, | 1197 | static void vi_update_rom_medium_grain_clock_gating(struct amdgpu_device *adev, |
1181 | bool enable) | 1198 | bool enable) |
1182 | { | 1199 | { |
@@ -1337,6 +1354,8 @@ static int vi_common_set_clockgating_state(void *handle, | |||
1337 | state == AMD_CG_STATE_GATE ? true : false); | 1354 | state == AMD_CG_STATE_GATE ? true : false); |
1338 | vi_update_hdp_light_sleep(adev, | 1355 | vi_update_hdp_light_sleep(adev, |
1339 | state == AMD_CG_STATE_GATE ? true : false); | 1356 | state == AMD_CG_STATE_GATE ? true : false); |
1357 | vi_update_drm_light_sleep(adev, | ||
1358 | state == AMD_CG_STATE_GATE ? true : false); | ||
1340 | break; | 1359 | break; |
1341 | case CHIP_TONGA: | 1360 | case CHIP_TONGA: |
1342 | case CHIP_POLARIS10: | 1361 | case CHIP_POLARIS10: |