[PATCH v5 04/10] drm/amd/pm: Add xgmi plpd policy to pm_policy

Lijo Lazar lijo.lazar at amd.com
Thu May 16 12:43:12 UTC 2024


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

Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
---
v2, v3: No change
v4: Use a macro for XGMI PLPD policy type
v5: Use a separate sysfs node for xgmi_plpd policy

 drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 +
 drivers/gpu/drm/amd/pm/amdgpu_pm.c             | 2 ++
 drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h  | 1 +
 3 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 4adfe9f0fd92..ac76bcd81a5d 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 f1d3423409b4..d47a646c680b 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2373,9 +2373,11 @@ static ssize_t amdgpu_set_pm_policy_attr(struct device *dev,
 #define AMDGPU_PM_POLICY_ATTR_PTR(_name) &pm_policy_attr_##_name.dev_attr.attr
 
 AMDGPU_PM_POLICY_ATTR(soc_pstate, SOC_PSTATE)
+AMDGPU_PM_POLICY_ATTR(xgmi_plpd, XGMI_PLPD)
 
 static struct attribute *pm_policy_attrs[] = {
 	AMDGPU_PM_POLICY_ATTR_PTR(soc_pstate),
+	AMDGPU_PM_POLICY_ATTR_PTR(xgmi_plpd),
 	NULL
 };
 
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
index a35ffe5d2021..84ec4ae3d6c5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
@@ -1574,6 +1574,7 @@ typedef struct {
 } WifiBandEntryTable_t;
 
 #define STR_SOC_PSTATE_POLICY "soc_pstate"
+#define STR_XGMI_PLPD_POLICY "xgmi_plpd"
 
 struct smu_dpm_policy *smu_get_pm_policy(struct smu_context *smu,
 					 enum pp_pm_policy p_type);
-- 
2.25.1



More information about the amd-gfx mailing list