* [PATCH v3 1/4] drm/amd/pm: Update pmfw headers for smuv_13_0_12
@ 2025-11-06 15:33 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 2/4] drm/amd/pm: Add ppt1 support for smu_v13_0_12 Asad Kamal
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Asad Kamal @ 2025-11-06 15:33 UTC (permalink / raw)
To: amd-gfx
Cc: lijo.lazar, hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
asad.kamal, KevinYang.Wang
Update pmfw headers for smmu_v13_0_12 to include ppt1 messages and
static parameters
Signed-off-by: Asad Kamal <asad.kamal@amd.com>
---
.../gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_pmfw.h | 7 ++++++-
.../gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_ppsmc.h | 4 +++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_pmfw.h b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_pmfw.h
index fa43d2e229a0..dd30d96e1ca2 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_pmfw.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_pmfw.h
@@ -189,7 +189,7 @@ typedef enum {
SVI_MAX_TEMP_ENTRIES, // 13
} SVI_TEMP_e;
-#define SMU_METRICS_TABLE_VERSION 0x14
+#define SMU_METRICS_TABLE_VERSION 0x15
#define SMU_SYSTEM_METRICS_TABLE_VERSION 0x1
@@ -367,6 +367,11 @@ typedef struct {
//Node Power Limit
uint32_t MaxNodePowerLimit;
+
+ // PPT1 Configuration
+ uint32_t PPT1Max;
+ uint32_t PPT1Min;
+ uint32_t PPT1Default;
} StaticMetricsTable_t;
#pragma pack(pop)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_ppsmc.h b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_ppsmc.h
index fe1b3ac50a75..d09b6ae9827e 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_ppsmc.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_12_ppsmc.h
@@ -117,7 +117,9 @@
#define PPSMC_MSG_GetSystemMetricsTable 0x5C
#define PPSMC_MSG_GetSystemMetricsVersion 0x5D
#define PPSMC_MSG_ResetVCN 0x5E
-#define PPSMC_Message_Count 0x5F
+#define PPSMC_MSG_SetFastPptLimit 0x5F
+#define PPSMC_MSG_GetFastPptLimit 0x60
+#define PPSMC_Message_Count 0x61
//PPSMC Reset Types for driver msg argument
#define PPSMC_RESET_TYPE_DRIVER_MODE_1_RESET 0x1
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 2/4] drm/amd/pm: Add ppt1 support for smu_v13_0_12
2025-11-06 15:33 [PATCH v3 1/4] drm/amd/pm: Update pmfw headers for smuv_13_0_12 Asad Kamal
@ 2025-11-06 15:33 ` Asad Kamal
2025-11-06 15:33 ` [PATCH v3 3/4] drm/amd/pm: Expose ppt1 limit for gc_v9_5_0 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 4/4] drm/amd/pm: Enable ppt1 caps for smu_v13_0_12 Asad Kamal
2 siblings, 0 replies; 6+ messages in thread
From: Asad Kamal @ 2025-11-06 15:33 UTC (permalink / raw)
To: amd-gfx
Cc: lijo.lazar, hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
asad.kamal, KevinYang.Wang
Add support to configure and retrieve ppt1 limit for smu_v13_0_12
v2: Add update_caps function and update ppt1 cap based on max ppt1
value, optimize the return values (Lijo)
v3: Add Null ptr check, return not supported in case of invalid
level/type (Lijo)
Signed-off-by: Asad Kamal <asad.kamal@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 4 +-
.../drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 8 ++
.../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 80 ++++++++++++++++++-
.../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h | 4 +
4 files changed, 92 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h
index 3a3930ef7ed9..9b71a8afdd35 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h
@@ -286,7 +286,9 @@
__SMU_DUMMY_MAP(SetTimestamp), \
__SMU_DUMMY_MAP(GetTimestamp), \
__SMU_DUMMY_MAP(GetBadPageIpid), \
- __SMU_DUMMY_MAP(EraseRasTable),
+ __SMU_DUMMY_MAP(EraseRasTable), \
+ __SMU_DUMMY_MAP(SetFastPptLimit), \
+ __SMU_DUMMY_MAP(GetFastPptLimit),
#undef __SMU_DUMMY_MAP
#define __SMU_DUMMY_MAP(type) SMU_MSG_##type
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c
index 0ce8cff27bf9..c513cbeb361f 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c
@@ -148,6 +148,8 @@ const struct cmn2asic_msg_mapping smu_v13_0_12_message_map[SMU_MSG_MAX_COUNT] =
MSG_MAP(GetTimestamp, PPSMC_MSG_GetTimestamp, 0),
MSG_MAP(GetBadPageIpid, PPSMC_MSG_GetBadPageIpIdLoHi, 0),
MSG_MAP(EraseRasTable, PPSMC_MSG_EraseRasTable, 0),
+ MSG_MAP(SetFastPptLimit, PPSMC_MSG_SetFastPptLimit, 1),
+ MSG_MAP(GetFastPptLimit, PPSMC_MSG_GetFastPptLimit, 1),
};
int smu_v13_0_12_tables_init(struct smu_context *smu)
@@ -354,6 +356,12 @@ int smu_v13_0_12_setup_driver_pptable(struct smu_context *smu)
if (smu_v13_0_6_cap_supported(smu, SMU_CAP(NPM_METRICS)))
pptable->MaxNodePowerLimit =
SMUQ10_ROUND(static_metrics->MaxNodePowerLimit);
+ if (smu_v13_0_6_cap_supported(smu, SMU_CAP(FAST_PPT)) &&
+ static_metrics->PPT1Max) {
+ pptable->PPT1Max = static_metrics->PPT1Max;
+ pptable->PPT1Min = static_metrics->PPT1Min;
+ pptable->PPT1Default = static_metrics->PPT1Default;
+ }
smu_v13_0_12_init_xgmi_data(smu, static_metrics);
pptable->Init = true;
}
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index dd8c7b98ce7e..f9e04df7e472 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -856,6 +856,17 @@ int smu_v13_0_6_get_static_metrics_table(struct smu_context *smu)
return 0;
}
+static void smu_v13_0_6_update_caps(struct smu_context *smu)
+{
+ struct smu_table_context *smu_table = &smu->smu_table;
+ struct PPTable_t *pptable =
+ (struct PPTable_t *)smu_table->driver_pptable;
+
+ if (smu_v13_0_6_cap_supported(smu, SMU_CAP(FAST_PPT)) &&
+ !pptable->PPT1Max)
+ smu_v13_0_6_cap_clear(smu, SMU_CAP(FAST_PPT));
+}
+
static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu)
{
struct smu_table_context *smu_table = &smu->smu_table;
@@ -872,8 +883,12 @@ static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu)
uint8_t max_width;
if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 12) &&
- smu_v13_0_6_cap_supported(smu, SMU_CAP(STATIC_METRICS)))
- return smu_v13_0_12_setup_driver_pptable(smu);
+ smu_v13_0_6_cap_supported(smu, SMU_CAP(STATIC_METRICS))) {
+ ret = smu_v13_0_12_setup_driver_pptable(smu);
+ if (ret)
+ return ret;
+ goto out;
+ }
/* Store one-time values in driver PPTable */
if (!pptable->Init) {
@@ -953,7 +968,8 @@ static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu)
smu_v13_0_6_fill_static_metrics_table(smu, static_metrics);
}
}
-
+out:
+ smu_v13_0_6_update_caps(smu);
return 0;
}
@@ -1887,9 +1903,66 @@ static int smu_v13_0_6_set_power_limit(struct smu_context *smu,
enum smu_ppt_limit_type limit_type,
uint32_t limit)
{
+ struct smu_table_context *smu_table = &smu->smu_table;
+ struct PPTable_t *pptable =
+ (struct PPTable_t *)smu_table->driver_pptable;
+ int ret;
+
+ if (limit_type == SMU_FAST_PPT_LIMIT) {
+ if (!smu_v13_0_6_cap_supported(smu, SMU_CAP(FAST_PPT)))
+ return -EOPNOTSUPP;
+ if (limit > pptable->PPT1Max || limit < pptable->PPT1Min) {
+ dev_err(smu->adev->dev,
+ "New power limit (%d) should be between min %d max %d\n",
+ limit, pptable->PPT1Min, pptable->PPT1Max);
+ return -EINVAL;
+ }
+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetFastPptLimit,
+ limit, NULL);
+ if (ret)
+ dev_err(smu->adev->dev, "Set fast PPT limit failed!\n");
+ return ret;
+ }
+
return smu_v13_0_set_power_limit(smu, limit_type, limit);
}
+static int smu_v13_0_6_get_ppt_limit(struct smu_context *smu,
+ uint32_t *ppt_limit,
+ enum smu_ppt_limit_type type,
+ enum smu_ppt_limit_level level)
+{
+ struct smu_table_context *smu_table = &smu->smu_table;
+ struct PPTable_t *pptable =
+ (struct PPTable_t *)smu_table->driver_pptable;
+ int ret = 0;
+
+ if (type == SMU_FAST_PPT_LIMIT) {
+ if (!smu_v13_0_6_cap_supported(smu, SMU_CAP(FAST_PPT)))
+ return -EOPNOTSUPP;
+ switch (level) {
+ case SMU_PPT_LIMIT_MAX:
+ *ppt_limit = pptable->PPT1Max;
+ break;
+ case SMU_PPT_LIMIT_CURRENT:
+ ret = smu_cmn_send_smc_msg(smu, SMU_MSG_GetFastPptLimit, ppt_limit);
+ if (ret)
+ dev_err(smu->adev->dev, "Get fast PPT limit failed!\n");
+ break;
+ case SMU_PPT_LIMIT_DEFAULT:
+ *ppt_limit = pptable->PPT1Default;
+ break;
+ case SMU_PPT_LIMIT_MIN:
+ *ppt_limit = pptable->PPT1Min;
+ break;
+ default:
+ return -EOPNOTSUPP;
+ }
+ return ret;
+ }
+ return -EOPNOTSUPP;
+}
+
static int smu_v13_0_6_irq_process(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
struct amdgpu_iv_entry *entry)
@@ -3959,6 +4032,7 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
.get_enabled_mask = smu_v13_0_6_get_enabled_mask,
.feature_is_enabled = smu_cmn_feature_is_enabled,
.set_power_limit = smu_v13_0_6_set_power_limit,
+ .get_ppt_limit = smu_v13_0_6_get_ppt_limit,
.set_xgmi_pstate = smu_v13_0_set_xgmi_pstate,
.register_irq_handler = smu_v13_0_6_register_irq_handler,
.enable_thermal_alert = smu_v13_0_enable_thermal_alert,
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h
index 367102cdbf09..6cbdd7c5ded9 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h
@@ -50,6 +50,9 @@ struct PPTable_t {
uint32_t MinLclkDpmRange;
uint64_t PublicSerialNumber_AID;
uint32_t MaxNodePowerLimit;
+ uint32_t PPT1Max;
+ uint32_t PPT1Min;
+ uint32_t PPT1Default;
bool Init;
};
@@ -73,6 +76,7 @@ enum smu_v13_0_6_caps {
SMU_CAP(TEMP_METRICS),
SMU_CAP(NPM_METRICS),
SMU_CAP(RAS_EEPROM),
+ SMU_CAP(FAST_PPT),
SMU_CAP(ALL),
};
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 3/4] drm/amd/pm: Expose ppt1 limit for gc_v9_5_0
2025-11-06 15:33 [PATCH v3 1/4] drm/amd/pm: Update pmfw headers for smuv_13_0_12 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 2/4] drm/amd/pm: Add ppt1 support for smu_v13_0_12 Asad Kamal
@ 2025-11-06 15:33 ` Asad Kamal
2025-11-06 16:12 ` Lazar, Lijo
2025-11-06 15:33 ` [PATCH v3 4/4] drm/amd/pm: Enable ppt1 caps for smu_v13_0_12 Asad Kamal
2 siblings, 1 reply; 6+ messages in thread
From: Asad Kamal @ 2025-11-06 15:33 UTC (permalink / raw)
To: amd-gfx
Cc: lijo.lazar, hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
asad.kamal, KevinYang.Wang
Expose power2_cap hwmon node for retrieving and configuring ppt1
limit on supported boards for gc_v9_5_0
v2: Remove version check (Lijo)
v3: Remove power2_average (Lijo)
Signed-off-by: Asad Kamal <asad.kamal@amd.com>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 15 ++++++++-------
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 ++
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 69aa8e22f103..d9e37fd6e186 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -3373,7 +3373,9 @@ static ssize_t amdgpu_hwmon_show_power_label(struct device *dev,
to_sensor_dev_attr(attr)->index == PP_PWR_TYPE_FAST ?
"fastPPT" : "slowPPT");
else
- return sysfs_emit(buf, "PPT\n");
+ return sysfs_emit(buf, "%s\n",
+ to_sensor_dev_attr(attr)->index == PP_PWR_TYPE_FAST ?
+ "PPT1" : "PPT");
}
static ssize_t amdgpu_hwmon_set_power_cap(struct device *dev,
@@ -3578,7 +3580,6 @@ static SENSOR_DEVICE_ATTR(power1_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_m
static SENSOR_DEVICE_ATTR(power1_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 0);
static SENSOR_DEVICE_ATTR(power1_cap_default, S_IRUGO, amdgpu_hwmon_show_power_cap_default, NULL, 0);
static SENSOR_DEVICE_ATTR(power1_label, S_IRUGO, amdgpu_hwmon_show_power_label, NULL, 0);
-static SENSOR_DEVICE_ATTR(power2_average, S_IRUGO, amdgpu_hwmon_show_power_avg, NULL, 1);
static SENSOR_DEVICE_ATTR(power2_cap_max, S_IRUGO, amdgpu_hwmon_show_power_cap_max, NULL, 1);
static SENSOR_DEVICE_ATTR(power2_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_min, NULL, 1);
static SENSOR_DEVICE_ATTR(power2_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 1);
@@ -3627,7 +3628,6 @@ static struct attribute *hwmon_attributes[] = {
&sensor_dev_attr_power1_cap.dev_attr.attr,
&sensor_dev_attr_power1_cap_default.dev_attr.attr,
&sensor_dev_attr_power1_label.dev_attr.attr,
- &sensor_dev_attr_power2_average.dev_attr.attr,
&sensor_dev_attr_power2_cap_max.dev_attr.attr,
&sensor_dev_attr_power2_cap_min.dev_attr.attr,
&sensor_dev_attr_power2_cap.dev_attr.attr,
@@ -3826,13 +3826,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
return 0;
/* only Vangogh has fast PPT limit and power labels */
- if (!(gc_ver == IP_VERSION(10, 3, 1)) &&
- (attr == &sensor_dev_attr_power2_average.dev_attr.attr ||
- attr == &sensor_dev_attr_power2_cap_max.dev_attr.attr ||
+ if ((attr == &sensor_dev_attr_power2_cap_max.dev_attr.attr ||
attr == &sensor_dev_attr_power2_cap_min.dev_attr.attr ||
attr == &sensor_dev_attr_power2_cap.dev_attr.attr ||
attr == &sensor_dev_attr_power2_cap_default.dev_attr.attr ||
- attr == &sensor_dev_attr_power2_label.dev_attr.attr))
+ attr == &sensor_dev_attr_power2_label.dev_attr.attr) &&
+ (amdgpu_dpm_get_power_limit(adev, &tmp,
+ PP_PWR_LIMIT_MAX,
+ PP_PWR_TYPE_FAST) == -EOPNOTSUPP))
return 0;
return effective_mode;
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index c0e7c45ac0e6..8b49fb86c77b 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -2938,6 +2938,8 @@ int smu_get_power_limit(void *handle,
if (limit_type != SMU_DEFAULT_PPT_LIMIT) {
if (smu->ppt_funcs->get_ppt_limit)
ret = smu->ppt_funcs->get_ppt_limit(smu, limit, limit_type, limit_level);
+ else
+ return -EOPNOTSUPP;
} else {
switch (limit_level) {
case SMU_PPT_LIMIT_CURRENT:
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 4/4] drm/amd/pm: Enable ppt1 caps for smu_v13_0_12
2025-11-06 15:33 [PATCH v3 1/4] drm/amd/pm: Update pmfw headers for smuv_13_0_12 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 2/4] drm/amd/pm: Add ppt1 support for smu_v13_0_12 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 3/4] drm/amd/pm: Expose ppt1 limit for gc_v9_5_0 Asad Kamal
@ 2025-11-06 15:33 ` Asad Kamal
2025-11-06 16:13 ` Lazar, Lijo
2 siblings, 1 reply; 6+ messages in thread
From: Asad Kamal @ 2025-11-06 15:33 UTC (permalink / raw)
To: amd-gfx
Cc: lijo.lazar, hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
asad.kamal, KevinYang.Wang
Enable ppt1 caps to fetch and configure ppt1 for smu_v13_0_12
Signed-off-by: Asad Kamal <asad.kamal@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index f9e04df7e472..44e1cd821eec 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -356,6 +356,9 @@ static void smu_v13_0_12_init_caps(struct smu_context *smu)
if (fw_ver > 0x04560900)
smu_v13_0_6_cap_set(smu, SMU_CAP(VCN_RESET));
+ if (fw_ver >= 0x04560D00)
+ smu_v13_0_6_cap_set(smu, SMU_CAP(FAST_PPT));
+
if (fw_ver >= 0x04560700) {
if (fw_ver >= 0x04560900) {
smu_v13_0_6_cap_set(smu, SMU_CAP(TEMP_METRICS));
--
2.46.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 3/4] drm/amd/pm: Expose ppt1 limit for gc_v9_5_0
2025-11-06 15:33 ` [PATCH v3 3/4] drm/amd/pm: Expose ppt1 limit for gc_v9_5_0 Asad Kamal
@ 2025-11-06 16:12 ` Lazar, Lijo
0 siblings, 0 replies; 6+ messages in thread
From: Lazar, Lijo @ 2025-11-06 16:12 UTC (permalink / raw)
To: Asad Kamal, amd-gfx
Cc: hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
KevinYang.Wang
On 11/6/2025 9:03 PM, Asad Kamal wrote:
> Expose power2_cap hwmon node for retrieving and configuring ppt1
> limit on supported boards for gc_v9_5_0
>
> v2: Remove version check (Lijo)
>
> v3: Remove power2_average (Lijo)
Sorry, this one needs to be a separate patch. I didn't mean to combine
with this series.
Thanks,
Lijo
>
> Signed-off-by: Asad Kamal <asad.kamal@amd.com>
> ---
> drivers/gpu/drm/amd/pm/amdgpu_pm.c | 15 ++++++++-------
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 ++
> 2 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index 69aa8e22f103..d9e37fd6e186 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -3373,7 +3373,9 @@ static ssize_t amdgpu_hwmon_show_power_label(struct device *dev,
> to_sensor_dev_attr(attr)->index == PP_PWR_TYPE_FAST ?
> "fastPPT" : "slowPPT");
> else
> - return sysfs_emit(buf, "PPT\n");
> + return sysfs_emit(buf, "%s\n",
> + to_sensor_dev_attr(attr)->index == PP_PWR_TYPE_FAST ?
> + "PPT1" : "PPT");
> }
>
> static ssize_t amdgpu_hwmon_set_power_cap(struct device *dev,
> @@ -3578,7 +3580,6 @@ static SENSOR_DEVICE_ATTR(power1_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_m
> static SENSOR_DEVICE_ATTR(power1_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 0);
> static SENSOR_DEVICE_ATTR(power1_cap_default, S_IRUGO, amdgpu_hwmon_show_power_cap_default, NULL, 0);
> static SENSOR_DEVICE_ATTR(power1_label, S_IRUGO, amdgpu_hwmon_show_power_label, NULL, 0);
> -static SENSOR_DEVICE_ATTR(power2_average, S_IRUGO, amdgpu_hwmon_show_power_avg, NULL, 1);
> static SENSOR_DEVICE_ATTR(power2_cap_max, S_IRUGO, amdgpu_hwmon_show_power_cap_max, NULL, 1);
> static SENSOR_DEVICE_ATTR(power2_cap_min, S_IRUGO, amdgpu_hwmon_show_power_cap_min, NULL, 1);
> static SENSOR_DEVICE_ATTR(power2_cap, S_IRUGO | S_IWUSR, amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 1);
> @@ -3627,7 +3628,6 @@ static struct attribute *hwmon_attributes[] = {
> &sensor_dev_attr_power1_cap.dev_attr.attr,
> &sensor_dev_attr_power1_cap_default.dev_attr.attr,
> &sensor_dev_attr_power1_label.dev_attr.attr,
> - &sensor_dev_attr_power2_average.dev_attr.attr,
> &sensor_dev_attr_power2_cap_max.dev_attr.attr,
> &sensor_dev_attr_power2_cap_min.dev_attr.attr,
> &sensor_dev_attr_power2_cap.dev_attr.attr,
> @@ -3826,13 +3826,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
> return 0;
>
> /* only Vangogh has fast PPT limit and power labels */
> - if (!(gc_ver == IP_VERSION(10, 3, 1)) &&
> - (attr == &sensor_dev_attr_power2_average.dev_attr.attr ||
> - attr == &sensor_dev_attr_power2_cap_max.dev_attr.attr ||
> + if ((attr == &sensor_dev_attr_power2_cap_max.dev_attr.attr ||
> attr == &sensor_dev_attr_power2_cap_min.dev_attr.attr ||
> attr == &sensor_dev_attr_power2_cap.dev_attr.attr ||
> attr == &sensor_dev_attr_power2_cap_default.dev_attr.attr ||
> - attr == &sensor_dev_attr_power2_label.dev_attr.attr))
> + attr == &sensor_dev_attr_power2_label.dev_attr.attr) &&
> + (amdgpu_dpm_get_power_limit(adev, &tmp,
> + PP_PWR_LIMIT_MAX,
> + PP_PWR_TYPE_FAST) == -EOPNOTSUPP))
> return 0;
>
> return effective_mode;
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index c0e7c45ac0e6..8b49fb86c77b 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -2938,6 +2938,8 @@ int smu_get_power_limit(void *handle,
> if (limit_type != SMU_DEFAULT_PPT_LIMIT) {
> if (smu->ppt_funcs->get_ppt_limit)
> ret = smu->ppt_funcs->get_ppt_limit(smu, limit, limit_type, limit_level);
> + else
> + return -EOPNOTSUPP;
> } else {
> switch (limit_level) {
> case SMU_PPT_LIMIT_CURRENT:
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 4/4] drm/amd/pm: Enable ppt1 caps for smu_v13_0_12
2025-11-06 15:33 ` [PATCH v3 4/4] drm/amd/pm: Enable ppt1 caps for smu_v13_0_12 Asad Kamal
@ 2025-11-06 16:13 ` Lazar, Lijo
0 siblings, 0 replies; 6+ messages in thread
From: Lazar, Lijo @ 2025-11-06 16:13 UTC (permalink / raw)
To: Asad Kamal, amd-gfx
Cc: hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
KevinYang.Wang
On 11/6/2025 9:03 PM, Asad Kamal wrote:
> Enable ppt1 caps to fetch and configure ppt1 for smu_v13_0_12
>
> Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Patches 1, 2, 4 are
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
For 3, power2_average can be kept for now and later be removed separately.
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
> index f9e04df7e472..44e1cd821eec 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
> @@ -356,6 +356,9 @@ static void smu_v13_0_12_init_caps(struct smu_context *smu)
> if (fw_ver > 0x04560900)
> smu_v13_0_6_cap_set(smu, SMU_CAP(VCN_RESET));
>
> + if (fw_ver >= 0x04560D00)
> + smu_v13_0_6_cap_set(smu, SMU_CAP(FAST_PPT));
> +
> if (fw_ver >= 0x04560700) {
> if (fw_ver >= 0x04560900) {
> smu_v13_0_6_cap_set(smu, SMU_CAP(TEMP_METRICS));
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-06 16:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 15:33 [PATCH v3 1/4] drm/amd/pm: Update pmfw headers for smuv_13_0_12 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 2/4] drm/amd/pm: Add ppt1 support for smu_v13_0_12 Asad Kamal
2025-11-06 15:33 ` [PATCH v3 3/4] drm/amd/pm: Expose ppt1 limit for gc_v9_5_0 Asad Kamal
2025-11-06 16:12 ` Lazar, Lijo
2025-11-06 15:33 ` [PATCH v3 4/4] drm/amd/pm: Enable ppt1 caps for smu_v13_0_12 Asad Kamal
2025-11-06 16:13 ` Lazar, Lijo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox