[PATCH v2 4/9] drm/amd/pm: Add xgmi plpd policy to pm_policy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add support to set XGMI PLPD policy levels through pm_policy sysfs node.

Signed-off-by: Lijo Lazar <lijo.lazar@xxxxxxx>
Reviewed-by: Hawking Zhang <Hawking.Zhang@xxxxxxx>
---
 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 84dd819ccc06..73d304093e98 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -276,6 +276,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 7ee11c2e3c61..ea9112ca1ac4 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2219,6 +2219,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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux