Re: [PATCH 1/2] drm/amd/pm: new gpu_metrics structure for pmfw attached timestamp

2021-04-28 Thread Deucher, Alexander
[AMD Public Use]

Assuming the updated table it 64 bit aligned, the series is:
Reviewed-by: Alex Deucher 

From: Quan, Evan 
Sent: Tuesday, April 27, 2021 9:43 PM
To: amd-gfx@lists.freedesktop.org 
Cc: Deucher, Alexander ; Kasiviswanathan, Harish 
; Quan, Evan 
Subject: [PATCH 1/2] drm/amd/pm: new gpu_metrics structure for pmfw attached 
timestamp

Supported by some latest ASICs.

Change-Id: I0bb26df87d10f1b356b5b9bf008a1422a8fe60d9
Signed-off-by: Evan Quan 
---
 .../gpu/drm/amd/include/kgd_pp_interface.h| 62 +++
 1 file changed, 62 insertions(+)

diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h 
b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 71018a5fb0b0..f6818dd84145 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -474,6 +474,68 @@ struct gpu_metrics_v1_1 {
 uint16_ttemperature_hbm[NUM_HBM_INSTANCES];
 };

+struct gpu_metrics_v1_2 {
+   struct metrics_table_header common_header;
+
+   /* Temperature */
+   uint16_ttemperature_edge;
+   uint16_ttemperature_hotspot;
+   uint16_ttemperature_mem;
+   uint16_ttemperature_vrgfx;
+   uint16_ttemperature_vrsoc;
+   uint16_ttemperature_vrmem;
+
+   /* Utilization */
+   uint16_taverage_gfx_activity;
+   uint16_taverage_umc_activity; // memory 
controller
+   uint16_taverage_mm_activity; // UVD or VCN
+
+   /* Power/Energy */
+   uint16_taverage_socket_power;
+   uint64_tenergy_accumulator;
+
+   /* Driver attached timestamp (in ns) */
+   uint64_tsystem_clock_counter;
+
+   /* Average clocks */
+   uint16_taverage_gfxclk_frequency;
+   uint16_taverage_socclk_frequency;
+   uint16_taverage_uclk_frequency;
+   uint16_taverage_vclk0_frequency;
+   uint16_taverage_dclk0_frequency;
+   uint16_taverage_vclk1_frequency;
+   uint16_taverage_dclk1_frequency;
+
+   /* Current clocks */
+   uint16_tcurrent_gfxclk;
+   uint16_tcurrent_socclk;
+   uint16_tcurrent_uclk;
+   uint16_tcurrent_vclk0;
+   uint16_tcurrent_dclk0;
+   uint16_tcurrent_vclk1;
+   uint16_tcurrent_dclk1;
+
+   /* Throttle status */
+   uint32_tthrottle_status;
+
+   /* Fans */
+   uint16_tcurrent_fan_speed;
+
+   /* Link width/speed */
+   uint16_tpcie_link_width;
+   uint16_tpcie_link_speed; // in 0.1 GT/s
+
+   uint16_tpadding;
+
+   uint32_tgfx_activity_acc;
+   uint32_tmem_activity_acc;
+
+   uint16_ttemperature_hbm[NUM_HBM_INSTANCES];
+
+   /* PMFW attached timestamp (10ns resolution) */
+   uint64_tfirmware_timestamp;
+};
+
 /*
  * gpu_metrics_v2_0 is not recommended as it's not naturally aligned.
  * Use gpu_metrics_v2_1 or later instead.
--
2.29.0

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/amd/pm: new gpu_metrics structure for pmfw attached timestamp

2021-04-27 Thread Evan Quan
Supported by some latest ASICs.

Change-Id: I0bb26df87d10f1b356b5b9bf008a1422a8fe60d9
Signed-off-by: Evan Quan 
---
 .../gpu/drm/amd/include/kgd_pp_interface.h| 62 +++
 1 file changed, 62 insertions(+)

diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h 
b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 71018a5fb0b0..f6818dd84145 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -474,6 +474,68 @@ struct gpu_metrics_v1_1 {
uint16_ttemperature_hbm[NUM_HBM_INSTANCES];
 };
 
+struct gpu_metrics_v1_2 {
+   struct metrics_table_header common_header;
+
+   /* Temperature */
+   uint16_ttemperature_edge;
+   uint16_ttemperature_hotspot;
+   uint16_ttemperature_mem;
+   uint16_ttemperature_vrgfx;
+   uint16_ttemperature_vrsoc;
+   uint16_ttemperature_vrmem;
+
+   /* Utilization */
+   uint16_taverage_gfx_activity;
+   uint16_taverage_umc_activity; // memory 
controller
+   uint16_taverage_mm_activity; // UVD or VCN
+
+   /* Power/Energy */
+   uint16_taverage_socket_power;
+   uint64_tenergy_accumulator;
+
+   /* Driver attached timestamp (in ns) */
+   uint64_tsystem_clock_counter;
+
+   /* Average clocks */
+   uint16_taverage_gfxclk_frequency;
+   uint16_taverage_socclk_frequency;
+   uint16_taverage_uclk_frequency;
+   uint16_taverage_vclk0_frequency;
+   uint16_taverage_dclk0_frequency;
+   uint16_taverage_vclk1_frequency;
+   uint16_taverage_dclk1_frequency;
+
+   /* Current clocks */
+   uint16_tcurrent_gfxclk;
+   uint16_tcurrent_socclk;
+   uint16_tcurrent_uclk;
+   uint16_tcurrent_vclk0;
+   uint16_tcurrent_dclk0;
+   uint16_tcurrent_vclk1;
+   uint16_tcurrent_dclk1;
+
+   /* Throttle status */
+   uint32_tthrottle_status;
+
+   /* Fans */
+   uint16_tcurrent_fan_speed;
+
+   /* Link width/speed */
+   uint16_tpcie_link_width;
+   uint16_tpcie_link_speed; // in 0.1 GT/s
+
+   uint16_tpadding;
+
+   uint32_tgfx_activity_acc;
+   uint32_tmem_activity_acc;
+
+   uint16_ttemperature_hbm[NUM_HBM_INSTANCES];
+
+   /* PMFW attached timestamp (10ns resolution) */
+   uint64_tfirmware_timestamp;
+};
+
 /*
  * gpu_metrics_v2_0 is not recommended as it's not naturally aligned.
  * Use gpu_metrics_v2_1 or later instead.
-- 
2.29.0

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx