]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
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 4adfe9f0fd920b10b56ae4fd90539caf97c4287b..ac76bcd81a5dc59f70873c6c044514962d9b4a39 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 2aebe5a67b034c1d11462b2aca59de1f5472437f..4bce339c5dc0787973b581907d3625785ea8775a 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 a35ffe5d2021d7627344c9cedd6793ac8fdb3ec5..84ec4ae3d6c588fa75a23cdff96b78022b207831 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);