Skip to content

Commit 108110a

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/powerplay: always use fast UCLK switching when UCLK DPM enabled
With UCLK DPM enabled, slow switching is not supported any more. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 3c7eda0 commit 108110a

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,18 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr)
830830
return 0;
831831
}
832832

833+
static int vega20_notify_smc_display_change(struct pp_hwmgr *hwmgr)
834+
{
835+
struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);
836+
837+
if (data->smu_features[GNLD_DPM_UCLK].enabled)
838+
return smum_send_msg_to_smc_with_parameter(hwmgr,
839+
PPSMC_MSG_SetUclkFastSwitch,
840+
1);
841+
842+
return 0;
843+
}
844+
833845
static int vega20_send_clock_ratio(struct pp_hwmgr *hwmgr)
834846
{
835847
struct vega20_hwmgr *data =
@@ -1543,6 +1555,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
15431555
"[EnableDPMTasks] Failed to enable all smu features!",
15441556
return result);
15451557

1558+
result = vega20_notify_smc_display_change(hwmgr);
1559+
PP_ASSERT_WITH_CODE(!result,
1560+
"[EnableDPMTasks] Failed to notify smc display change!",
1561+
return result);
1562+
15461563
result = vega20_send_clock_ratio(hwmgr);
15471564
PP_ASSERT_WITH_CODE(!result,
15481565
"[EnableDPMTasks] Failed to send clock ratio!",
@@ -1988,19 +2005,6 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,
19882005
return ret;
19892006
}
19902007

1991-
static int vega20_notify_smc_display_change(struct pp_hwmgr *hwmgr,
1992-
bool has_disp)
1993-
{
1994-
struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);
1995-
1996-
if (data->smu_features[GNLD_DPM_UCLK].enabled)
1997-
return smum_send_msg_to_smc_with_parameter(hwmgr,
1998-
PPSMC_MSG_SetUclkFastSwitch,
1999-
has_disp ? 1 : 0);
2000-
2001-
return 0;
2002-
}
2003-
20042008
int vega20_display_clock_voltage_request(struct pp_hwmgr *hwmgr,
20052009
struct pp_display_clock_request *clock_req)
20062010
{
@@ -2060,13 +2064,6 @@ static int vega20_notify_smc_display_config_after_ps_adjustment(
20602064
struct pp_display_clock_request clock_req;
20612065
int ret = 0;
20622066

2063-
if ((hwmgr->display_config->num_display > 1) &&
2064-
!hwmgr->display_config->multi_monitor_in_sync &&
2065-
!hwmgr->display_config->nb_pstate_switch_disable)
2066-
vega20_notify_smc_display_change(hwmgr, false);
2067-
else
2068-
vega20_notify_smc_display_change(hwmgr, true);
2069-
20702067
min_clocks.dcefClock = hwmgr->display_config->min_dcef_set_clk;
20712068
min_clocks.dcefClockInSR = hwmgr->display_config->min_dcef_deep_sleep_set_clk;
20722069
min_clocks.memoryClock = hwmgr->display_config->min_mem_set_clock;

0 commit comments

Comments
 (0)