From: Le Ma <le.ma@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alexander.Deucher@amd.com, Lijo.Lazar@amd.com, Hawking.Zhang@amd.com
Subject: [PATCH 5/7] drm/amd/pm: init plpd_mode properly for different asics
Date: Mon, 25 Sep 2023 12:27:50 +0800 [thread overview]
Message-ID: <20230925042752.3847-5-le.ma@amd.com> (raw)
In-Reply-To: <20230925042752.3847-1-le.ma@amd.com>
Assign DEFAULT mode if it supports plpd, otherwise keeps NONE
v2: reduce ip version checks
Signed-off-by: Le Ma <le.ma@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 893359b26418..1c6b22638bf4 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1130,6 +1130,21 @@ static void smu_swctf_delayed_work_handler(struct work_struct *work)
orderly_poweroff(true);
}
+static void smu_init_xgmi_plpd_mode(struct smu_context *smu)
+{
+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(11, 0, 2)) {
+ smu->plpd_mode = XGMI_PLPD_DEFAULT;
+ return;
+ }
+
+ /* PMFW put PLPD into default policy after enabling the feature */
+ if (smu_feature_is_enabled(smu,
+ SMU_FEATURE_XGMI_PER_LINK_PWR_DWN_BIT))
+ smu->plpd_mode = XGMI_PLPD_DEFAULT;
+ else
+ smu->plpd_mode = XGMI_PLPD_NONE;
+}
+
static int smu_sw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1361,6 +1376,8 @@ static int smu_smc_hw_setup(struct smu_context *smu)
return ret;
}
+ smu_init_xgmi_plpd_mode(smu);
+
ret = smu_feature_get_enabled_mask(smu, &features_supported);
if (ret) {
dev_err(adev->dev, "Failed to retrieve supported dpm features!\n");
--
2.38.1
next prev parent reply other threads:[~2023-09-25 4:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 4:27 [PATCH 1/7] drm/amd/pm: update pmfw headers for version 85.73.0 Le Ma
2023-09-25 4:27 ` [PATCH 2/7] drm/amd/pm: add plpd_mode in smu_context to indicate current mode Le Ma
2023-09-25 4:27 ` [PATCH 3/7] drm/amd/pm: add xgmi plpd mode selecting interface for smu v13.0.6 Le Ma
2023-09-25 4:27 ` [PATCH 4/7] drm/amd/pm: add xgmi_plpd_policy sysfs node for user to change plpd policy Le Ma
2023-09-25 4:27 ` Le Ma [this message]
2023-09-25 4:27 ` [PATCH 6/7] drm/amd/pm: integrate plpd allow/disallow into select_xgmi_plpd_policy in ppt level Le Ma
2023-09-25 4:27 ` [PATCH 7/7] drm/amd/pm: deprecate allow_xgmi_power_down interface Le Ma
2023-09-26 5:51 ` [PATCH 1/7] drm/amd/pm: update pmfw headers for version 85.73.0 Lazar, Lijo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230925042752.3847-5-le.ma@amd.com \
--to=le.ma@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Lijo.Lazar@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox