Commit 7cdd4dc5 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: check for invalid profile mode before switching

Need to check for invalid profile mode settings before determining
to switch to that.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6752bea8
...@@ -4915,9 +4915,6 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui ...@@ -4915,9 +4915,6 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui
uint8_t min_active_level; uint8_t min_active_level;
uint32_t power_profile_mode = input[size]; uint32_t power_profile_mode = input[size];
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,
1 << power_profile_mode);
if (power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) { if (power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
if (size != 0 && size != 4) if (size != 0 && size != 4)
return -EINVAL; return -EINVAL;
...@@ -4944,6 +4941,8 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui ...@@ -4944,6 +4941,8 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui
} }
out: out:
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,
1 << power_profile_mode);
hwmgr->power_profile_mode = power_profile_mode; hwmgr->power_profile_mode = power_profile_mode;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment