drm/amdgpu/pm: only hide average power on SI and pre-RENOIR APUs
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2020 19:18:01 +0000 (15:18 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Aug 2020 22:22:40 +0000 (18:22 -0400)
We can get this on RENOIR and newer via the SMU metrics
table.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Acked-by: Nirmoy Das <nirmoy.das@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index f2e70655e8d9aff4d49e7c3cd779872b53572f56..a77f7347fdfc4204671cddacff3326eeea360df7 100644 (file)
@@ -3312,12 +3312,17 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
 
        if (((adev->flags & AMD_IS_APU) ||
             adev->family == AMDGPU_FAMILY_SI) &&       /* not implemented yet */
-           (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
+           (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
             attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
             attr == &sensor_dev_attr_power1_cap.dev_attr.attr))
                return 0;
 
+       if (((adev->family == AMDGPU_FAMILY_SI) ||
+            ((adev->flags & AMD_IS_APU) &&
+             (adev->asic_type < CHIP_RENOIR))) &&      /* not implemented yet */
+           (attr == &sensor_dev_attr_power1_average.dev_attr.attr))
+               return 0;
+
        if (!is_support_sw_smu(adev)) {
                /* hide max/min values if we can't both query and manage the fan */
                if ((!adev->powerplay.pp_funcs->set_fan_speed_percent &&