drm/amd/powerplay: avoid unnecessary dpm level setting
authorEvan Quan <evan.quan@amd.com>
Thu, 17 Jan 2019 09:48:30 +0000 (17:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 25 Jan 2019 21:15:35 +0000 (16:15 -0500)
No dpm level setting is needed when the request level
is actually same as current.

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

index 56437866d1206c163f36593e2764bfb6bfd96170..68f3dcaa80703792d05236c77968b666b9fb3780 100644 (file)
@@ -278,7 +278,8 @@ int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr, bool skip,
 
        phm_notify_smc_display_config_after_ps_adjustment(hwmgr);
 
-       if (!phm_force_dpm_levels(hwmgr, hwmgr->request_dpm_level))
+       if ((hwmgr->request_dpm_level != hwmgr->dpm_level) &&
+           !phm_force_dpm_levels(hwmgr, hwmgr->request_dpm_level))
                hwmgr->dpm_level = hwmgr->request_dpm_level;
 
        if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL) {