When no displays are connected, there is no vblank
happening so the power management code shouldn't
worry about it.

This fixes a regression that caused the memory clock
to be stuck at maximum when there were no displays
connected to a SI GPU.

Fixes: 9003a0746864 ("drm/amd/pm: Treat zero vblank time as too short in si_dpm 
(v3)")
Fixes: 9d73b107a61b ("drm/amd/pm: Use pm_display_cfg in legacy DPM (v2)")
Tested-by: Jeremy Klarenbeek <[email protected]>
Signed-off-by: Timur Kristóf <[email protected]>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c 
b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index b75a6031c68a..5afe42918497 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -3076,6 +3076,10 @@ static bool si_dpm_vblank_too_short(void *handle)
        /* we never hit the non-gddr5 limit so disable it */
        u32 switch_limit = adev->gmc.vram_type == AMDGPU_VRAM_TYPE_GDDR5 ? 450 
: 0;
 
+       /* Disregard vblank time when there are no displays connected */
+       if (!adev->pm.pm_display_cfg.num_display)
+               return false;
+
        /* Consider zero vblank time too short and disable MCLK switching.
         * Note that the vblank time is set to maximum when no displays are 
attached,
         * so we'll still enable MCLK switching in that case.
-- 
2.54.0

Reply via email to