diff options
author | Tom St Denis <tom.stdenis@amd.com> | 2016-09-30 10:58:44 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-10-25 14:38:25 -0400 |
commit | 97f40ef049dded1962bc9e70ad4d197fa8a5cadb (patch) | |
tree | f6edd8d9535a625fdb159c300148106cbaf07520 /drivers | |
parent | f8991bab1aa2121e33b8569857dfb22e536bc396 (diff) |
drm/amd/powerplay: Enable UVD powergating for SMU7
This patch enables detecting VCE/UVD PG features and fixes the
UVD powergate function.
Tested on a Tonga (by reading UVD tile/clk bits during playback/idle).
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 14 |
2 files changed, 23 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c index f5a58d489b4b..cf2ee93d8475 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | |||
@@ -149,15 +149,21 @@ int smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | |||
149 | if (bgate) { | 149 | if (bgate) { |
150 | cgs_set_clockgating_state(hwmgr->device, | 150 | cgs_set_clockgating_state(hwmgr->device, |
151 | AMD_IP_BLOCK_TYPE_UVD, | 151 | AMD_IP_BLOCK_TYPE_UVD, |
152 | AMD_CG_STATE_GATE); | 152 | AMD_CG_STATE_UNGATE); |
153 | cgs_set_powergating_state(hwmgr->device, | ||
154 | AMD_IP_BLOCK_TYPE_UVD, | ||
155 | AMD_PG_STATE_GATE); | ||
153 | smu7_update_uvd_dpm(hwmgr, true); | 156 | smu7_update_uvd_dpm(hwmgr, true); |
154 | smu7_powerdown_uvd(hwmgr); | 157 | smu7_powerdown_uvd(hwmgr); |
155 | } else { | 158 | } else { |
156 | smu7_powerup_uvd(hwmgr); | 159 | smu7_powerup_uvd(hwmgr); |
157 | smu7_update_uvd_dpm(hwmgr, false); | 160 | cgs_set_powergating_state(hwmgr->device, |
161 | AMD_IP_BLOCK_TYPE_UVD, | ||
162 | AMD_CG_STATE_UNGATE); | ||
158 | cgs_set_clockgating_state(hwmgr->device, | 163 | cgs_set_clockgating_state(hwmgr->device, |
159 | AMD_IP_BLOCK_TYPE_UVD, | 164 | AMD_IP_BLOCK_TYPE_UVD, |
160 | AMD_CG_STATE_UNGATE); | 165 | AMD_CG_STATE_GATE); |
166 | smu7_update_uvd_dpm(hwmgr, false); | ||
161 | } | 167 | } |
162 | 168 | ||
163 | return 0; | 169 | return 0; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index 173f9f3f2068..073e0bfa22a0 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | |||
@@ -1352,6 +1352,8 @@ static void smu7_init_dpm_defaults(struct pp_hwmgr *hwmgr) | |||
1352 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); | 1352 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); |
1353 | struct phm_ppt_v1_information *table_info = | 1353 | struct phm_ppt_v1_information *table_info = |
1354 | (struct phm_ppt_v1_information *)(hwmgr->pptable); | 1354 | (struct phm_ppt_v1_information *)(hwmgr->pptable); |
1355 | struct cgs_system_info sys_info = {0}; | ||
1356 | int result; | ||
1355 | 1357 | ||
1356 | data->dll_default_on = false; | 1358 | data->dll_default_on = false; |
1357 | data->mclk_dpm0_activity_target = 0xa; | 1359 | data->mclk_dpm0_activity_target = 0xa; |
@@ -1439,6 +1441,18 @@ static void smu7_init_dpm_defaults(struct pp_hwmgr *hwmgr) | |||
1439 | data->pcie_lane_performance.min = 16; | 1441 | data->pcie_lane_performance.min = 16; |
1440 | data->pcie_lane_power_saving.max = 0; | 1442 | data->pcie_lane_power_saving.max = 0; |
1441 | data->pcie_lane_power_saving.min = 16; | 1443 | data->pcie_lane_power_saving.min = 16; |
1444 | |||
1445 | sys_info.size = sizeof(struct cgs_system_info); | ||
1446 | sys_info.info_id = CGS_SYSTEM_INFO_PG_FLAGS; | ||
1447 | result = cgs_query_system_info(hwmgr->device, &sys_info); | ||
1448 | if (!result) { | ||
1449 | if (sys_info.value & AMD_PG_SUPPORT_UVD) | ||
1450 | phm_cap_set(hwmgr->platform_descriptor.platformCaps, | ||
1451 | PHM_PlatformCaps_UVDPowerGating); | ||
1452 | if (sys_info.value & AMD_PG_SUPPORT_VCE) | ||
1453 | phm_cap_set(hwmgr->platform_descriptor.platformCaps, | ||
1454 | PHM_PlatformCaps_VCEPowerGating); | ||
1455 | } | ||
1442 | } | 1456 | } |
1443 | 1457 | ||
1444 | /** | 1458 | /** |