diff options
author | Evan Quan <evan.quan@amd.com> | 2018-11-06 20:16:07 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-07 17:05:56 -0500 |
commit | 2d3030a00ef1dbdbf3df8893c225cb37d88a1ff2 (patch) | |
tree | e84149c3c36a786e5132e578078a704abaf1157f | |
parent | 72deff05bd4662b9aca75812b44a9bea646da1b0 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c index 10c80aae030f..cb3c3d69c3d3 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | |||
@@ -830,6 +830,18 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr) | |||
830 | return 0; | 830 | return 0; |
831 | } | 831 | } |
832 | 832 | ||
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 | |||
833 | static int vega20_send_clock_ratio(struct pp_hwmgr *hwmgr) | 845 | static int vega20_send_clock_ratio(struct pp_hwmgr *hwmgr) |
834 | { | 846 | { |
835 | struct vega20_hwmgr *data = | 847 | struct vega20_hwmgr *data = |
@@ -1543,6 +1555,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr) | |||
1543 | "[EnableDPMTasks] Failed to enable all smu features!", | 1555 | "[EnableDPMTasks] Failed to enable all smu features!", |
1544 | return result); | 1556 | return result); |
1545 | 1557 | ||
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 | |||
1546 | result = vega20_send_clock_ratio(hwmgr); | 1563 | result = vega20_send_clock_ratio(hwmgr); |
1547 | PP_ASSERT_WITH_CODE(!result, | 1564 | PP_ASSERT_WITH_CODE(!result, |
1548 | "[EnableDPMTasks] Failed to send clock ratio!", | 1565 | "[EnableDPMTasks] Failed to send clock ratio!", |
@@ -1988,19 +2005,6 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx, | |||
1988 | return ret; | 2005 | return ret; |
1989 | } | 2006 | } |
1990 | 2007 | ||
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 | |||
2004 | int vega20_display_clock_voltage_request(struct pp_hwmgr *hwmgr, | 2008 | int vega20_display_clock_voltage_request(struct pp_hwmgr *hwmgr, |
2005 | struct pp_display_clock_request *clock_req) | 2009 | struct pp_display_clock_request *clock_req) |
2006 | { | 2010 | { |
@@ -2060,13 +2064,6 @@ static int vega20_notify_smc_display_config_after_ps_adjustment( | |||
2060 | struct pp_display_clock_request clock_req; | 2064 | struct pp_display_clock_request clock_req; |
2061 | int ret = 0; | 2065 | int ret = 0; |
2062 | 2066 | ||
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 | |||
2070 | min_clocks.dcefClock = hwmgr->display_config->min_dcef_set_clk; | 2067 | min_clocks.dcefClock = hwmgr->display_config->min_dcef_set_clk; |
2071 | min_clocks.dcefClockInSR = hwmgr->display_config->min_dcef_deep_sleep_set_clk; | 2068 | min_clocks.dcefClockInSR = hwmgr->display_config->min_dcef_deep_sleep_set_clk; |
2072 | min_clocks.memoryClock = hwmgr->display_config->min_mem_set_clock; | 2069 | min_clocks.memoryClock = hwmgr->display_config->min_mem_set_clock; |