* [PATCH 2/6] drm/amdgpu/pm: add VCN activity for SMU 13.0.0/7
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
@ 2025-03-11 20:44 ` Alex Deucher
2025-03-11 20:44 ` [PATCH 3/6] drm/amdgpu/pm: add VCN activity for SMU 14.0.2 Alex Deucher
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-03-11 20:44 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Wire up the query.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 10 ++++++++++
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
index 898487ad6cd2e..5a9711e8cf689 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
@@ -836,6 +836,10 @@ static int smu_v13_0_0_get_smu_metrics_data(struct smu_context *smu,
case METRICS_AVERAGE_MEMACTIVITY:
*value = metrics->AverageUclkActivity;
break;
+ case METRICS_AVERAGE_VCNACTIVITY:
+ *value = max(metrics->Vcn0ActivityPercentage,
+ metrics->Vcn1ActivityPercentage);
+ break;
case METRICS_AVERAGE_SOCKETPOWER:
*value = metrics->AverageSocketPower << 8;
break;
@@ -962,6 +966,12 @@ static int smu_v13_0_0_read_sensor(struct smu_context *smu,
(uint32_t *)data);
*size = 4;
break;
+ case AMDGPU_PP_SENSOR_VCN_LOAD:
+ ret = smu_v13_0_0_get_smu_metrics_data(smu,
+ METRICS_AVERAGE_VCNACTIVITY,
+ (uint32_t *)data);
+ *size = 4;
+ break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = smu_v13_0_0_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER,
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
index 19f47811f6db2..c8f4f6fb40834 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
@@ -807,6 +807,10 @@ static int smu_v13_0_7_get_smu_metrics_data(struct smu_context *smu,
else
*value = metrics->AverageMemclkFrequencyPreDs;
break;
+ case METRICS_AVERAGE_VCNACTIVITY:
+ *value = max(metrics->Vcn0ActivityPercentage,
+ metrics->Vcn1ActivityPercentage);
+ break;
case METRICS_AVERAGE_VCLK:
*value = metrics->AverageVclk0Frequency;
break;
@@ -951,6 +955,12 @@ static int smu_v13_0_7_read_sensor(struct smu_context *smu,
(uint32_t *)data);
*size = 4;
break;
+ case AMDGPU_PP_SENSOR_VCN_LOAD:
+ ret = smu_v13_0_7_get_smu_metrics_data(smu,
+ METRICS_AVERAGE_VCNACTIVITY,
+ (uint32_t *)data);
+ *size = 4;
+ break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = smu_v13_0_7_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER,
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/6] drm/amdgpu/pm: add VCN activity for SMU 14.0.2
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
2025-03-11 20:44 ` [PATCH 2/6] drm/amdgpu/pm: add VCN activity for SMU 13.0.0/7 Alex Deucher
@ 2025-03-11 20:44 ` Alex Deucher
2025-03-11 20:44 ` [PATCH 4/6] drm/amdgpu/pm: enable vcn busy sysfs for additional GC 11.x Alex Deucher
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-03-11 20:44 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Wire up the query.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
index e4089fd58711c..21d1b34ada053 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
@@ -756,6 +756,10 @@ static int smu_v14_0_2_get_smu_metrics_data(struct smu_context *smu,
case METRICS_AVERAGE_MEMACTIVITY:
*value = metrics->AverageUclkActivity;
break;
+ case METRICS_AVERAGE_VCNACTIVITY:
+ *value = max(metrics->AverageVcn0ActivityPercentage,
+ metrics->Vcn1ActivityPercentage);
+ break;
case METRICS_AVERAGE_SOCKETPOWER:
*value = metrics->AverageSocketPower << 8;
break;
@@ -882,6 +886,12 @@ static int smu_v14_0_2_read_sensor(struct smu_context *smu,
(uint32_t *)data);
*size = 4;
break;
+ case AMDGPU_PP_SENSOR_VCN_LOAD:
+ ret = smu_v14_0_2_get_smu_metrics_data(smu,
+ METRICS_AVERAGE_VCNACTIVITY,
+ (uint32_t *)data);
+ *size = 4;
+ break;
case AMDGPU_PP_SENSOR_GPU_AVG_POWER:
ret = smu_v14_0_2_get_smu_metrics_data(smu,
METRICS_AVERAGE_SOCKETPOWER,
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/6] drm/amdgpu/pm: enable vcn busy sysfs for additional GC 11.x
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
2025-03-11 20:44 ` [PATCH 2/6] drm/amdgpu/pm: add VCN activity for SMU 13.0.0/7 Alex Deucher
2025-03-11 20:44 ` [PATCH 3/6] drm/amdgpu/pm: add VCN activity for SMU 14.0.2 Alex Deucher
@ 2025-03-11 20:44 ` Alex Deucher
2025-03-11 20:44 ` [PATCH 5/6] drm/amdgpu/pm: enable vcn busy sysfs for GC 12.x Alex Deucher
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-03-11 20:44 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Make it visible for the all GC 11.x chips that support it.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index e463f7a739988..bb39e7f83341b 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2315,12 +2315,18 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
*states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(vcn_busy_percent)) {
if (!(gc_ver == IP_VERSION(10, 3, 1) ||
- gc_ver == IP_VERSION(10, 3, 3) ||
- gc_ver == IP_VERSION(10, 3, 6) ||
- gc_ver == IP_VERSION(10, 3, 7) ||
- gc_ver == IP_VERSION(11, 0, 1) ||
- gc_ver == IP_VERSION(11, 0, 4) ||
- gc_ver == IP_VERSION(11, 5, 0)))
+ gc_ver == IP_VERSION(10, 3, 3) ||
+ gc_ver == IP_VERSION(10, 3, 6) ||
+ gc_ver == IP_VERSION(10, 3, 7) ||
+ gc_ver == IP_VERSION(11, 0, 0) ||
+ gc_ver == IP_VERSION(11, 0, 1) ||
+ gc_ver == IP_VERSION(11, 0, 2) ||
+ gc_ver == IP_VERSION(11, 0, 3) ||
+ gc_ver == IP_VERSION(11, 0, 4) ||
+ gc_ver == IP_VERSION(11, 5, 0) ||
+ gc_ver == IP_VERSION(11, 5, 1) ||
+ gc_ver == IP_VERSION(11, 5, 2) ||
+ gc_ver == IP_VERSION(11, 5, 3)))
*states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(pcie_bw)) {
/* PCIe Perf counters won't work on APU nodes */
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/6] drm/amdgpu/pm: enable vcn busy sysfs for GC 12.x
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
` (2 preceding siblings ...)
2025-03-11 20:44 ` [PATCH 4/6] drm/amdgpu/pm: enable vcn busy sysfs for additional GC 11.x Alex Deucher
@ 2025-03-11 20:44 ` Alex Deucher
2025-03-11 20:44 ` [PATCH 6/6] drm/amdgpu/pm: enable vcn busy sysfs for GC 9.3.0 Alex Deucher
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-03-11 20:44 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Make it visible for the all GC 12.x chips that support it.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index bb39e7f83341b..c5abf4eacbfcd 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2326,7 +2326,9 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
gc_ver == IP_VERSION(11, 5, 0) ||
gc_ver == IP_VERSION(11, 5, 1) ||
gc_ver == IP_VERSION(11, 5, 2) ||
- gc_ver == IP_VERSION(11, 5, 3)))
+ gc_ver == IP_VERSION(11, 5, 3) ||
+ gc_ver == IP_VERSION(12, 0, 0) ||
+ gc_ver == IP_VERSION(12, 0, 1)))
*states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(pcie_bw)) {
/* PCIe Perf counters won't work on APU nodes */
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/6] drm/amdgpu/pm: enable vcn busy sysfs for GC 9.3.0
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
` (3 preceding siblings ...)
2025-03-11 20:44 ` [PATCH 5/6] drm/amdgpu/pm: enable vcn busy sysfs for GC 12.x Alex Deucher
@ 2025-03-11 20:44 ` Alex Deucher
2025-03-12 5:28 ` [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Feng, Kenneth
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-03-11 20:44 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Make it visible for the all GC 9.3.0 chips that support it.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index c5abf4eacbfcd..3ff9750baa0c3 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2314,7 +2314,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
gc_ver == IP_VERSION(9, 0, 1))
*states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(vcn_busy_percent)) {
- if (!(gc_ver == IP_VERSION(10, 3, 1) ||
+ if (!(gc_ver == IP_VERSION(9, 3, 0) ||
+ gc_ver == IP_VERSION(10, 3, 1) ||
gc_ver == IP_VERSION(10, 3, 3) ||
gc_ver == IP_VERSION(10, 3, 6) ||
gc_ver == IP_VERSION(10, 3, 7) ||
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* RE: [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
` (4 preceding siblings ...)
2025-03-11 20:44 ` [PATCH 6/6] drm/amdgpu/pm: enable vcn busy sysfs for GC 9.3.0 Alex Deucher
@ 2025-03-12 5:28 ` Feng, Kenneth
2025-03-12 5:35 ` Lazar, Lijo
2025-03-12 5:59 ` Lazar, Lijo
7 siblings, 0 replies; 9+ messages in thread
From: Feng, Kenneth @ 2025-03-12 5:28 UTC (permalink / raw)
To: Deucher, Alexander, amd-gfx@lists.freedesktop.org; +Cc: Deucher, Alexander
[AMD Official Use Only - AMD Internal Distribution Only]
Series is Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Wednesday, March 12, 2025 4:45 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Wire up the query.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
index 37d82a71a2d7c..9481f897432d7 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
@@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
(uint32_t *)data);
*size = 4;
break;
+ case AMDGPU_PP_SENSOR_VCN_LOAD:
+ ret = renoir_get_smu_metrics_data(smu,
+ METRICS_AVERAGE_VCNACTIVITY,
+ (uint32_t *)data);
+ *size = 4;
+ break;
case AMDGPU_PP_SENSOR_EDGE_TEMP:
ret = renoir_get_smu_metrics_data(smu,
METRICS_TEMPERATURE_EDGE,
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
` (5 preceding siblings ...)
2025-03-12 5:28 ` [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Feng, Kenneth
@ 2025-03-12 5:35 ` Lazar, Lijo
2025-03-12 5:59 ` Lazar, Lijo
7 siblings, 0 replies; 9+ messages in thread
From: Lazar, Lijo @ 2025-03-12 5:35 UTC (permalink / raw)
To: Alex Deucher, amd-gfx
On 3/12/2025 2:14 AM, Alex Deucher wrote:
> Wire up the query.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Series is -
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> index 37d82a71a2d7c..9481f897432d7 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> @@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
> (uint32_t *)data);
> *size = 4;
> break;
> + case AMDGPU_PP_SENSOR_VCN_LOAD:
> + ret = renoir_get_smu_metrics_data(smu,
> + METRICS_AVERAGE_VCNACTIVITY,
> + (uint32_t *)data);
> + *size = 4;
> + break;
> case AMDGPU_PP_SENSOR_EDGE_TEMP:
> ret = renoir_get_smu_metrics_data(smu,
> METRICS_TEMPERATURE_EDGE,
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir
2025-03-11 20:44 [PATCH 1/6] drm/amdgpu/pm: add VCN activity for renoir Alex Deucher
` (6 preceding siblings ...)
2025-03-12 5:35 ` Lazar, Lijo
@ 2025-03-12 5:59 ` Lazar, Lijo
7 siblings, 0 replies; 9+ messages in thread
From: Lazar, Lijo @ 2025-03-12 5:59 UTC (permalink / raw)
To: Alex Deucher, amd-gfx
On 3/12/2025 2:14 AM, Alex Deucher wrote:
> Wire up the query.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Series is -
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> index 37d82a71a2d7c..9481f897432d7 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> @@ -1285,6 +1285,12 @@ static int renoir_read_sensor(struct smu_context *smu,
> (uint32_t *)data);
> *size = 4;
> break;
> + case AMDGPU_PP_SENSOR_VCN_LOAD:
> + ret = renoir_get_smu_metrics_data(smu,
> + METRICS_AVERAGE_VCNACTIVITY,
> + (uint32_t *)data);
> + *size = 4;
> + break;
> case AMDGPU_PP_SENSOR_EDGE_TEMP:
> ret = renoir_get_smu_metrics_data(smu,
> METRICS_TEMPERATURE_EDGE,
^ permalink raw reply [flat|nested] 9+ messages in thread