[PATCH 4/9] drm/amd/pm: Add xgmi plpd policy to pm_policy
Lijo Lazar
lijo.lazar at amd.com
Wed Mar 13 11:02:51 UTC 2024
Add support to set XGMI PLPD policy levels through pm_policy sysfs node.
Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
---
drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 +
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index e48da7acd7a7..45c78cd08eae 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -275,6 +275,7 @@ enum pp_xgmi_plpd_mode {
enum pp_pm_policy {
PP_PM_POLICY_NONE = -1,
PP_PM_POLICY_SOC_PSTATE = 0,
+ PP_PM_POLICY_XGMI_PLPD,
PP_PM_POLICY_NUM,
};
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index d8c8eaff3355..1d5a8428601d 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2195,6 +2195,9 @@ static ssize_t amdgpu_set_pm_policy(struct device *dev,
if (strncmp(tmp, "soc_pstate", strlen("soc_pstate")) == 0) {
policy_type = PP_PM_POLICY_SOC_PSTATE;
tmp += strlen("soc_pstate");
+ } else if (strncmp(tmp, "xgmi", strlen("xgmi")) == 0) {
+ policy_type = PP_PM_POLICY_XGMI_PLPD;
+ tmp += strlen("xgmi");
} else {
return -EINVAL;
}
--
2.25.1
More information about the amd-gfx
mailing list