Commit 97e8f102 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/pp: Set Max clock level to display by default

avoid the error in dmesg:
[drm:dm_pp_get_static_clocks]
*ERROR* DM_PPLIB: invalid powerlevel state: 0!
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a0c3bf0f
...@@ -998,7 +998,7 @@ static int pp_get_display_power_level(void *handle, ...@@ -998,7 +998,7 @@ static int pp_get_display_power_level(void *handle,
static int pp_get_current_clocks(void *handle, static int pp_get_current_clocks(void *handle,
struct amd_pp_clock_info *clocks) struct amd_pp_clock_info *clocks)
{ {
struct amd_pp_simple_clock_info simple_clocks; struct amd_pp_simple_clock_info simple_clocks = { 0 };
struct pp_clock_info hw_clocks; struct pp_clock_info hw_clocks;
struct pp_hwmgr *hwmgr = handle; struct pp_hwmgr *hwmgr = handle;
int ret = 0; int ret = 0;
...@@ -1034,6 +1034,9 @@ static int pp_get_current_clocks(void *handle, ...@@ -1034,6 +1034,9 @@ static int pp_get_current_clocks(void *handle,
clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk; clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk; clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
if (simple_clocks.level == 0)
clocks->max_clocks_state = PP_DAL_POWERLEVEL_7;
else
clocks->max_clocks_state = simple_clocks.level; clocks->max_clocks_state = simple_clocks.level;
if (0 == phm_get_current_shallow_sleep_clocks(hwmgr, &hwmgr->current_ps->hardware, &hw_clocks)) { if (0 == phm_get_current_shallow_sleep_clocks(hwmgr, &hwmgr->current_ps->hardware, &hw_clocks)) {
...@@ -1137,6 +1140,8 @@ static int pp_get_display_mode_validation_clocks(void *handle, ...@@ -1137,6 +1140,8 @@ static int pp_get_display_mode_validation_clocks(void *handle,
if (!hwmgr || !hwmgr->pm_en ||!clocks) if (!hwmgr || !hwmgr->pm_en ||!clocks)
return -EINVAL; return -EINVAL;
clocks->level = PP_DAL_POWERLEVEL_7;
mutex_lock(&hwmgr->smu_lock); mutex_lock(&hwmgr->smu_lock);
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_DynamicPatchPowerState)) if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_DynamicPatchPowerState))
......
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