drm/amd/pm: enable sysfs node vclk1 and dclk1 for NV2X
authorTong Liu01 <Tong.Liu01@amd.com>
Thu, 30 Mar 2023 03:09:37 +0000 (11:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 31 Mar 2023 15:18:55 +0000 (11:18 -0400)
Enable vclk1 and dclk1 node for gc10.3.0 and gc10.3.1

Signed-off-by: Tong Liu01 <Tong.Liu01@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index ced295e..d8b9c61 100644 (file)
@@ -2123,6 +2123,10 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
                      gc_ver == IP_VERSION(11, 0, 2) ||
                      gc_ver == IP_VERSION(11, 0, 3)))
                        *states = ATTR_STATE_UNSUPPORTED;
+       } else if (DEVICE_ATTR_IS(pp_dpm_vclk1)) {
+               if (!((gc_ver == IP_VERSION(10, 3, 1) ||
+                          gc_ver == IP_VERSION(10, 3, 0)) && adev->vcn.num_vcn_inst >= 2))
+                       *states = ATTR_STATE_UNSUPPORTED;
        } else if (DEVICE_ATTR_IS(pp_dpm_dclk)) {
                if (!(gc_ver == IP_VERSION(10, 3, 1) ||
                      gc_ver == IP_VERSION(10, 3, 0) ||
@@ -2131,6 +2135,10 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
                      gc_ver == IP_VERSION(11, 0, 2) ||
                      gc_ver == IP_VERSION(11, 0, 3)))
                        *states = ATTR_STATE_UNSUPPORTED;
+       } else if (DEVICE_ATTR_IS(pp_dpm_dclk1)) {
+               if (!((gc_ver == IP_VERSION(10, 3, 1) ||
+                          gc_ver == IP_VERSION(10, 3, 0)) && adev->vcn.num_vcn_inst >= 2))
+                       *states = ATTR_STATE_UNSUPPORTED;
        } else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {
                if (amdgpu_dpm_get_power_profile_mode(adev, NULL) == -EOPNOTSUPP)
                        *states = ATTR_STATE_UNSUPPORTED;