drm/amd/powerplay: set fan speed to max in profile peak mode only.
authorRex Zhu <Rex.Zhu@amd.com>
Tue, 7 Feb 2017 09:34:11 +0000 (17:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 8 Feb 2017 22:27:39 +0000 (17:27 -0500)
Signed-off-by: Rex Zhu <Rex.Zhu@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/smu7_hwmgr.c

index 0a6c833720df00338bfc0d7750a0b4a288bc4faf..64e72c39b43c8abcdb3db2bc68886489ee3e9c32 100644 (file)
@@ -2624,6 +2624,7 @@ static int smu7_force_dpm_level(struct pp_hwmgr *hwmgr,
                smu7_force_clock_level(hwmgr, PP_SCLK, 1<<sclk_mask);
                smu7_force_clock_level(hwmgr, PP_MCLK, 1<<mclk_mask);
                smu7_force_clock_level(hwmgr, PP_PCIE, 1<<pcie_mask);
+
                break;
        case AMD_DPM_FORCED_LEVEL_MANUAL:
                hwmgr->dpm_level = level;
@@ -2633,9 +2634,9 @@ static int smu7_force_dpm_level(struct pp_hwmgr *hwmgr,
                break;
        }
 
-       if (level & (AMD_DPM_FORCED_LEVEL_PROFILE_PEAK | AMD_DPM_FORCED_LEVEL_HIGH))
+       if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK && hwmgr->saved_dpm_level != AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
                smu7_fan_ctrl_set_fan_speed_percent(hwmgr, 100);
-       else
+       else if (level != AMD_DPM_FORCED_LEVEL_PROFILE_PEAK && hwmgr->saved_dpm_level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
                smu7_fan_ctrl_reset_fan_speed_to_default(hwmgr);
 
        return 0;