Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/powerplay: Fix hardmins not being sent to SMU for RV

[Why]
DC uses these to raise the voltage as needed for higher dispclk/dppclk
and to ensure that we have enough bandwidth to drive the displays.

There's a bug preventing these from actuially sending messages since
it's checking the actual clock (which is 0) instead of the incoming
clock (which shouldn't be 0) when deciding to send the hardmin.

[How]
Check the clocks != 0 instead of the actual clocks.

Fixes: 9ed9203c3ee7 ("drm/amd/powerplay: rv dal-pplib interface refactor powerplay part")
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
e2bf3723 75947544

+3 -6
+3 -6
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
··· 204 204 { 205 205 struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend); 206 206 207 - if (smu10_data->need_min_deep_sleep_dcefclk && 208 - smu10_data->deep_sleep_dcefclk != clock) { 207 + if (clock && smu10_data->deep_sleep_dcefclk != clock) { 209 208 smu10_data->deep_sleep_dcefclk = clock; 210 209 smum_send_msg_to_smc_with_parameter(hwmgr, 211 210 PPSMC_MSG_SetMinDeepSleepDcefclk, ··· 218 219 { 219 220 struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend); 220 221 221 - if (smu10_data->dcf_actual_hard_min_freq && 222 - smu10_data->dcf_actual_hard_min_freq != clock) { 222 + if (clock && smu10_data->dcf_actual_hard_min_freq != clock) { 223 223 smu10_data->dcf_actual_hard_min_freq = clock; 224 224 smum_send_msg_to_smc_with_parameter(hwmgr, 225 225 PPSMC_MSG_SetHardMinDcefclkByFreq, ··· 232 234 { 233 235 struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend); 234 236 235 - if (smu10_data->f_actual_hard_min_freq && 236 - smu10_data->f_actual_hard_min_freq != clock) { 237 + if (clock && smu10_data->f_actual_hard_min_freq != clock) { 237 238 smu10_data->f_actual_hard_min_freq = clock; 238 239 smum_send_msg_to_smc_with_parameter(hwmgr, 239 240 PPSMC_MSG_SetHardMinFclkByFreq,