Commit 921935dc authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: enforce display related settings only on needed

No display related settings are needed on dpm level change.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a0e4fa2f
...@@ -273,7 +273,7 @@ int hwmgr_hw_fini(struct pp_hwmgr *hwmgr) ...@@ -273,7 +273,7 @@ int hwmgr_hw_fini(struct pp_hwmgr *hwmgr)
phm_stop_thermal_controller(hwmgr); phm_stop_thermal_controller(hwmgr);
psm_set_boot_states(hwmgr); psm_set_boot_states(hwmgr);
psm_adjust_power_state_dynamic(hwmgr, false, NULL); psm_adjust_power_state_dynamic(hwmgr, true, NULL);
phm_disable_dynamic_state_management(hwmgr); phm_disable_dynamic_state_management(hwmgr);
phm_disable_clock_power_gatings(hwmgr); phm_disable_clock_power_gatings(hwmgr);
...@@ -295,7 +295,7 @@ int hwmgr_suspend(struct pp_hwmgr *hwmgr) ...@@ -295,7 +295,7 @@ int hwmgr_suspend(struct pp_hwmgr *hwmgr)
ret = psm_set_boot_states(hwmgr); ret = psm_set_boot_states(hwmgr);
if (ret) if (ret)
return ret; return ret;
ret = psm_adjust_power_state_dynamic(hwmgr, false, NULL); ret = psm_adjust_power_state_dynamic(hwmgr, true, NULL);
if (ret) if (ret)
return ret; return ret;
ret = phm_power_down_asic(hwmgr); ret = phm_power_down_asic(hwmgr);
...@@ -325,7 +325,7 @@ int hwmgr_resume(struct pp_hwmgr *hwmgr) ...@@ -325,7 +325,7 @@ int hwmgr_resume(struct pp_hwmgr *hwmgr)
if (ret) if (ret)
return ret; return ret;
ret = psm_adjust_power_state_dynamic(hwmgr, false, NULL); ret = psm_adjust_power_state_dynamic(hwmgr, true, NULL);
return ret; return ret;
} }
...@@ -379,12 +379,12 @@ int hwmgr_handle_task(struct pp_hwmgr *hwmgr, enum amd_pp_task task_id, ...@@ -379,12 +379,12 @@ int hwmgr_handle_task(struct pp_hwmgr *hwmgr, enum amd_pp_task task_id,
ret = psm_set_user_performance_state(hwmgr, requested_ui_label, &requested_ps); ret = psm_set_user_performance_state(hwmgr, requested_ui_label, &requested_ps);
if (ret) if (ret)
return ret; return ret;
ret = psm_adjust_power_state_dynamic(hwmgr, false, requested_ps); ret = psm_adjust_power_state_dynamic(hwmgr, true, requested_ps);
break; break;
} }
case AMD_PP_TASK_COMPLETE_INIT: case AMD_PP_TASK_COMPLETE_INIT:
case AMD_PP_TASK_READJUST_POWER_STATE: case AMD_PP_TASK_READJUST_POWER_STATE:
ret = psm_adjust_power_state_dynamic(hwmgr, false, NULL); ret = psm_adjust_power_state_dynamic(hwmgr, true, NULL);
break; break;
default: default:
break; break;
......
...@@ -256,15 +256,13 @@ static void power_state_management(struct pp_hwmgr *hwmgr, ...@@ -256,15 +256,13 @@ static void power_state_management(struct pp_hwmgr *hwmgr,
} }
} }
int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, bool skip, int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, bool skip_display_settings,
struct pp_power_state *new_ps) struct pp_power_state *new_ps)
{ {
uint32_t index; uint32_t index;
long workload; long workload;
if (skip) if (!skip_display_settings)
return 0;
phm_display_configuration_changed(hwmgr); phm_display_configuration_changed(hwmgr);
if (hwmgr->ps) if (hwmgr->ps)
...@@ -276,6 +274,7 @@ int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, bool skip, ...@@ -276,6 +274,7 @@ int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, bool skip,
*/ */
phm_apply_clock_adjust_rules(hwmgr); phm_apply_clock_adjust_rules(hwmgr);
if (!skip_display_settings)
phm_notify_smc_display_config_after_ps_adjustment(hwmgr); phm_notify_smc_display_config_after_ps_adjustment(hwmgr);
if ((hwmgr->request_dpm_level != hwmgr->dpm_level) && if ((hwmgr->request_dpm_level != hwmgr->dpm_level) &&
......
...@@ -34,7 +34,7 @@ int psm_set_user_performance_state(struct pp_hwmgr *hwmgr, ...@@ -34,7 +34,7 @@ int psm_set_user_performance_state(struct pp_hwmgr *hwmgr,
enum PP_StateUILabel label_id, enum PP_StateUILabel label_id,
struct pp_power_state **state); struct pp_power_state **state);
int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr,
bool skip, bool skip_display_settings,
struct pp_power_state *new_ps); struct pp_power_state *new_ps);
#endif #endif
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