summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDanijel Slivka <danijel.slivka@amd.com>2022-05-05 16:45:32 +0200
committerAlex Deucher <alexander.deucher@amd.com>2022-05-10 17:53:13 -0400
commit1b85257290f382a78adba1b0a5b59a95cebdfa2f (patch)
treec843cc0ac759b6c3540cf8e68bc431524f5f54d3 /drivers
parentcae5c1ab057197f1dad8524d37906fda3978bcc9 (diff)
downloadlinux-1b85257290f382a78adba1b0a5b59a95cebdfa2f.tar.bz2
amdgpu/pm: Disallow managing power profiles on SRIOV for Sienna Cichlid
Managing power profiles mode is not allowed in SRIOV mode for Sienna Cichlid. This patch is adjusting the "pp_power_profile_mode" and "power_dpm_force_performance_level" accordingly. Signed-off-by: Danijel Slivka <danijel.slivka@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/pm/amdgpu_pm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 70a0aad05426..d3228216b2da 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2025,6 +2025,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
} else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {
if (amdgpu_dpm_get_power_profile_mode(adev, NULL) == -EOPNOTSUPP)
*states = ATTR_STATE_UNSUPPORTED;
+ else if (gc_ver == IP_VERSION(10, 3, 0) && amdgpu_sriov_vf(adev))
+ *states = ATTR_STATE_UNSUPPORTED;
}
switch (gc_ver) {
@@ -2038,6 +2040,13 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
dev_attr->store = NULL;
}
break;
+ case IP_VERSION(10, 3, 0):
+ if (DEVICE_ATTR_IS(power_dpm_force_performance_level) &&
+ amdgpu_sriov_vf(adev)) {
+ dev_attr->attr.mode &= ~0222;
+ dev_attr->store = NULL;
+ }
+ break;
default:
break;
}