drm/amd/powerplay: fix wrong clock adjust sequence
authorEvan Quan <evan.quan@amd.com>
Wed, 6 Jun 2018 03:54:45 +0000 (11:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Jun 2018 18:45:22 +0000 (13:45 -0500)
The clocks should be adjusted after display configuration changed.
Otherwise, the socclk and memclk may be forced on an unnecessary higher
level.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c

index 0af13c1..323990b 100644 (file)
@@ -265,19 +265,18 @@ int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, bool skip,
        if (skip)
                return 0;
 
-       if (!hwmgr->ps)
-               /*
-                * for vega12/vega20 which does not support power state manager
-                * DAL clock limits should also be honoured
-                */
-               phm_apply_clock_adjust_rules(hwmgr);
-
        phm_pre_display_configuration_changed(hwmgr);
 
        phm_display_configuration_changed(hwmgr);
 
        if (hwmgr->ps)
                power_state_management(hwmgr, new_ps);
+       else
+               /*
+                * for vega12/vega20 which does not support power state manager
+                * DAL clock limits should also be honoured
+                */
+               phm_apply_clock_adjust_rules(hwmgr);
 
        phm_notify_smc_display_config_after_ps_adjustment(hwmgr);