aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-05-04 01:32:01 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-05 18:15:08 -0400
commit7b52db39a4c27c0020ff953a4bb0aa8bbe55e4a2 (patch)
treec453c04d2c1303ac82e643d50c78560557f6092e /drivers
parent5784d5cca66b362e3588c189eada757cf664ae6c (diff)
drm/amd/powerplay: fix bug sclk/mclk level can't be set on vega10.
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')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index e24e54c294bd..85a6c12ad1d4 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4189,55 +4189,56 @@ static int vega10_force_clock_level(struct pp_hwmgr *hwmgr,
4189 4189
4190 switch (type) { 4190 switch (type) {
4191 case PP_SCLK: 4191 case PP_SCLK:
4192 if (data->registry_data.sclk_dpm_key_disabled)
4193 break;
4194
4195 for (i = 0; i < 32; i++) { 4192 for (i = 0; i < 32; i++) {
4196 if (mask & (1 << i)) 4193 if (mask & (1 << i))
4197 break; 4194 break;
4198 } 4195 }
4196 data->smc_state_table.gfx_boot_level = i;
4199 4197
4200 PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc_with_parameter( 4198 for (i = 31; i >= 0; i--) {
4201 hwmgr->smumgr, 4199 if (mask & (1 << i))
4202 PPSMC_MSG_SetSoftMinGfxclkByIndex, 4200 break;
4203 i), 4201 }
4204 "Failed to set soft min sclk index!", 4202 data->smc_state_table.gfx_max_level = i;
4205 return -1); 4203
4204 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_bootup_level(hwmgr),
4205 "Failed to upload boot level to lowest!",
4206 return -EINVAL);
4207
4208 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_max_level(hwmgr),
4209 "Failed to upload dpm max level to highest!",
4210 return -EINVAL);
4206 break; 4211 break;
4207 4212
4208 case PP_MCLK: 4213 case PP_MCLK:
4209 if (data->registry_data.mclk_dpm_key_disabled)
4210 break;
4211
4212 for (i = 0; i < 32; i++) { 4214 for (i = 0; i < 32; i++) {
4213 if (mask & (1 << i)) 4215 if (mask & (1 << i))
4214 break; 4216 break;
4215 } 4217 }
4216 4218
4217 PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc_with_parameter(
4218 hwmgr->smumgr,
4219 PPSMC_MSG_SetSoftMinUclkByIndex,
4220 i),
4221 "Failed to set soft min mclk index!",
4222 return -1);
4223 break;
4224
4225 case PP_PCIE:
4226 if (data->registry_data.pcie_dpm_key_disabled)
4227 break;
4228
4229 for (i = 0; i < 32; i++) { 4219 for (i = 0; i < 32; i++) {
4230 if (mask & (1 << i)) 4220 if (mask & (1 << i))
4231 break; 4221 break;
4232 } 4222 }
4223 data->smc_state_table.mem_boot_level = i;
4224
4225 for (i = 31; i >= 0; i--) {
4226 if (mask & (1 << i))
4227 break;
4228 }
4229 data->smc_state_table.mem_max_level = i;
4230
4231 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_bootup_level(hwmgr),
4232 "Failed to upload boot level to lowest!",
4233 return -EINVAL);
4234
4235 PP_ASSERT_WITH_CODE(!vega10_upload_dpm_max_level(hwmgr),
4236 "Failed to upload dpm max level to highest!",
4237 return -EINVAL);
4233 4238
4234 PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc_with_parameter(
4235 hwmgr->smumgr,
4236 PPSMC_MSG_SetMinLinkDpmByIndex,
4237 i),
4238 "Failed to set min pcie index!",
4239 return -1);
4240 break; 4239 break;
4240
4241 case PP_PCIE:
4241 default: 4242 default:
4242 break; 4243 break;
4243 } 4244 }