OSDN Git Service

drm/amd/powerplay: no MGPU fan boost enablement on DPM disabled
authorEvan Quan <evan.quan@amd.com>
Wed, 31 Oct 2018 06:15:04 +0000 (14:15 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 1 Nov 2018 14:52:12 +0000 (09:52 -0500)
As MGPU fan boost feature will be definitely not needed when
DPM is disabled. So, there is no need to error out.

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/amd_powerplay.c

index bf09735..d6aa1d4 100644 (file)
@@ -1318,12 +1318,12 @@ static int pp_enable_mgpu_fan_boost(void *handle)
 {
        struct pp_hwmgr *hwmgr = handle;
 
-       if (!hwmgr || !hwmgr->pm_en)
+       if (!hwmgr)
                return -EINVAL;
 
-       if (hwmgr->hwmgr_func->enable_mgpu_fan_boost == NULL) {
+       if (!hwmgr->pm_en ||
+            hwmgr->hwmgr_func->enable_mgpu_fan_boost == NULL)
                return 0;
-       }
 
        mutex_lock(&hwmgr->smu_lock);
        hwmgr->hwmgr_func->enable_mgpu_fan_boost(hwmgr);