All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: Report SMU 15.0.8 XGMI bandwidth
@ 2026-10-22 12:32 Asad Kamal
  2026-10-22 14:07 ` Lazar, Lijo
  0 siblings, 1 reply; 2+ messages in thread
From: Asad Kamal @ 2026-10-22 12:32 UTC (permalink / raw)
  To: amd-gfx
  Cc: lijo.lazar, hawking.zhang, le.ma, shiwu.zhang, alexander.deucher,
	Kevin.Wang, asad.kamal

SMU 15.0.8 firmware reports accumulated XGMI read and write bandwidth.
The driver publishes those counters as transferred data, in KB.

Publish them as xgmi_read_bandwidth_acc and xgmi_write_bandwidth_acc,
with unit GB/s.

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
---
 drivers/gpu/drm/amd/include/kgd_pp_interface.h       | 2 ++
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c | 6 ++++--
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h | 8 ++++----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index f92bccb8cb41..17f76071b514 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -685,6 +685,8 @@ enum amdgpu_metrics_attr_id {
 	AMDGPU_METRICS_ATTR_ID_SYSTEM_TEMP_OAM_4_5_6_7_3V3_VR,
 	AMDGPU_METRICS_ATTR_ID_SYSTEM_TEMP_IBC_HSC,
 	AMDGPU_METRICS_ATTR_ID_SYSTEM_TEMP_IBC,
+	AMDGPU_METRICS_ATTR_ID_XGMI_READ_BANDWIDTH_ACC,
+	AMDGPU_METRICS_ATTR_ID_XGMI_WRITE_BANDWIDTH_ACC,
 	AMDGPU_METRICS_ATTR_ID_MAX,
 };
 
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
index 2254c2d414d2..bacdc1a2dd38 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
@@ -2041,8 +2041,10 @@ static ssize_t smu_v15_0_8_get_gpu_metrics(struct smu_context *smu, void **table
 			gpu_metrics->xgmi_link_status[j] = ret;
 	}
 
-	gpu_metrics->xgmi_read_data_acc = SMUQ10_ROUND(metrics->XgmiReadBandwidthAcc);
-	gpu_metrics->xgmi_write_data_acc = SMUQ10_ROUND(metrics->XgmiWriteBandwidthAcc);
+	gpu_metrics->xgmi_read_bandwidth_acc =
+		SMUQ10_ROUND(metrics->XgmiReadBandwidthAcc);
+	gpu_metrics->xgmi_write_bandwidth_acc =
+		SMUQ10_ROUND(metrics->XgmiWriteBandwidthAcc);
 
 	for (i = 0; i < NUM_XCC(adev->gfx.xcc_mask); ++i) {
 		inst = GET_INST(GC, i);
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h
index c3835c81d313..8c7e808aa8eb 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h
@@ -146,10 +146,10 @@ typedef struct {
 	SMU_ARRAY(SMU_MATTR(XGMI_LINK_STATUS), SMU_MUNIT(NONE),                \
 		  SMU_MTYPE(U16), xgmi_link_status,                            \
 		  SMU_15_0_8_NUM_XGMI_LINKS);                                  \
-	SMU_SCALAR(SMU_MATTR(XGMI_READ_DATA_ACC), SMU_MUNIT(DATA_1),           \
-		   SMU_MTYPE(U64), xgmi_read_data_acc);                        \
-	SMU_SCALAR(SMU_MATTR(XGMI_WRITE_DATA_ACC), SMU_MUNIT(DATA_1),          \
-		   SMU_MTYPE(U64), xgmi_write_data_acc);                                  \
+	SMU_SCALAR(SMU_MATTR(XGMI_READ_BANDWIDTH_ACC), SMU_MUNIT(BW_1),        \
+		   SMU_MTYPE(U64), xgmi_read_bandwidth_acc);                   \
+	SMU_SCALAR(SMU_MATTR(XGMI_WRITE_BANDWIDTH_ACC), SMU_MUNIT(BW_1),       \
+		   SMU_MTYPE(U64), xgmi_write_bandwidth_acc);                  \
 	SMU_SCALAR(SMU_MATTR(FIRMWARE_TIMESTAMP), SMU_MUNIT(TIME_2),           \
 		   SMU_MTYPE(U64), firmware_timestamp);                        \
 	SMU_ARRAY(SMU_MATTR(CURRENT_GFXCLK), SMU_MUNIT(CLOCK_1),               \
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-22 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22 12:32 [PATCH] drm/amd/pm: Report SMU 15.0.8 XGMI bandwidth Asad Kamal
2026-10-22 14:07 ` Lazar, Lijo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.