The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: Fix incorrect avg vcn utilization in gpu_metrics
@ 2026-08-05 14:02 Boqun Feng
  0 siblings, 0 replies; only message in thread
From: Boqun Feng @ 2026-08-05 14:02 UTC (permalink / raw)
  To: amd-gfx
  Cc: Boqun Feng, Mark Janes, Kenneth Feng, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Lijo Lazar,
	Asad Kamal, Yang Wang, Priya Hosur, mythilam, Mario Limonciello,
	dri-devel, linux-kernel

In a Strix Halo system, a >100 average_vcn_activity in gpu_metrics can
be observed by running the following command:

    ffmpeg -hwaccel vappi -vappi_device /dev/dri/renderD128 -i \
    ~/sample-10s.mp4 -vf hwupload,scale_vappi=format=nv12 -c:v \
    h264_vappi /tmp/output.mp4

This is incorrect because the value is supposed to be in [0-100] range.

The cause of the issue is that the metrics.VcnActivity reported by
smu_cmn_get_metrics_table() is a permyriad value instead of a percentage
value (e.g. smu_v14_0_0_get_smu_metrics_data() has a division by 100 to
report the vcn_busy_percent). Therefore fix this by applying the same
division in smu_v14_0_0_get_gpu_metrics().

Reported-by: Mark Janes <mjanes@netflix.com>
Signed-off-by: Boqun Feng <boqun@kernel.org>
---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c
index 568665265a13..1058338344b0 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c
@@ -566,7 +566,8 @@ static ssize_t smu_v14_0_0_get_gpu_metrics(struct smu_context *smu,
 	gpu_metrics->temperature_skin = metrics.SkinTemp;
 
 	gpu_metrics->average_gfx_activity = metrics.GfxActivity;
-	gpu_metrics->average_vcn_activity = metrics.VcnActivity;
+	/* metrics.VcnActivity is permyriad, convert it to percentage. */
+	gpu_metrics->average_vcn_activity = metrics.VcnActivity / 100;
 	memcpy(&gpu_metrics->average_ipu_activity[0],
 		&metrics.IpuBusy[0],
 		sizeof(uint16_t) * 8);
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-05 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 14:02 [PATCH] drm/amd/pm: Fix incorrect avg vcn utilization in gpu_metrics Boqun Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox