drm/amd/pm: Add xgmi plpd policy to pm_policy
authorLijo Lazar <lijo.lazar@amd.com>
Thu, 16 May 2024 08:19:11 +0000 (13:49 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 May 2024 21:40:39 +0000 (17:40 -0400)
Add support to set XGMI PLPD policy levels through 'pm_policy/xgmi_plpd'
sysfs node.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/include/kgd_pp_interface.h
drivers/gpu/drm/amd/pm/amdgpu_pm.c
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h

index 4adfe9f..ac76bcd 100644 (file)
@@ -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,
 };
 
index 2aebe5a..4bce339 100644 (file)
@@ -2373,9 +2373,11 @@ static ssize_t amdgpu_set_pm_policy_attr(struct device *dev,
 #define AMDGPU_PM_POLICY_ATTR_VAR(_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_VAR(soc_pstate),
+       &AMDGPU_PM_POLICY_ATTR_VAR(xgmi_plpd),
        NULL
 };
 
index a35ffe5..84ec4ae 100644 (file)
@@ -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);