OSDN Git Service

drm/amd/pm: Set no fan control flag as needed.
authorLijo Lazar <lijo.lazar@amd.com>
Wed, 9 Dec 2020 13:06:16 +0000 (21:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 02:56:49 +0000 (22:56 -0400)
For GPUs that don't support fan control, set the no fan control flag so
that they don't appear in hwmon sensors.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index 4ffe74c..21492ab 100644 (file)
@@ -1028,6 +1028,10 @@ static int smu_sw_init(void *handle)
                return ret;
        }
 
+       /* If there is no way to query fan control mode, fan control is not supported */
+       if (!smu->ppt_funcs->get_fan_control_mode)
+               smu->adev->pm.no_fan = true;
+
        return 0;
 }