]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu/pm: Update metrics table (v2)
authorDavid M Nieto <david.nieto@amd.com>
Fri, 14 May 2021 20:36:26 +0000 (13:36 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 May 2021 14:31:30 +0000 (10:31 -0400)
v2: removed static dpm and frequency ranges from table

expand metrics table with voltages and frequency ranges

Signed-off-by: David M Nieto <david.nieto@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/include/kgd_pp_interface.h
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

index e2d13131a432c1d9909077e18f81200308bbb18b..b1cd52a9d6846e093f15236aa9451b6d978cf7b1 100644 (file)
@@ -536,6 +536,75 @@ struct gpu_metrics_v1_2 {
        uint64_t                        firmware_timestamp;
 };
 
+struct gpu_metrics_v1_3 {
+       struct metrics_table_header     common_header;
+
+       /* Temperature */
+       uint16_t                        temperature_edge;
+       uint16_t                        temperature_hotspot;
+       uint16_t                        temperature_mem;
+       uint16_t                        temperature_vrgfx;
+       uint16_t                        temperature_vrsoc;
+       uint16_t                        temperature_vrmem;
+
+       /* Utilization */
+       uint16_t                        average_gfx_activity;
+       uint16_t                        average_umc_activity; // memory controller
+       uint16_t                        average_mm_activity; // UVD or VCN
+
+       /* Power/Energy */
+       uint16_t                        average_socket_power;
+       uint64_t                        energy_accumulator;
+
+       /* Driver attached timestamp (in ns) */
+       uint64_t                        system_clock_counter;
+
+       /* Average clocks */
+       uint16_t                        average_gfxclk_frequency;
+       uint16_t                        average_socclk_frequency;
+       uint16_t                        average_uclk_frequency;
+       uint16_t                        average_vclk0_frequency;
+       uint16_t                        average_dclk0_frequency;
+       uint16_t                        average_vclk1_frequency;
+       uint16_t                        average_dclk1_frequency;
+
+       /* Current clocks */
+       uint16_t                        current_gfxclk;
+       uint16_t                        current_socclk;
+       uint16_t                        current_uclk;
+       uint16_t                        current_vclk0;
+       uint16_t                        current_dclk0;
+       uint16_t                        current_vclk1;
+       uint16_t                        current_dclk1;
+
+       /* Throttle status */
+       uint32_t                        throttle_status;
+
+       /* Fans */
+       uint16_t                        current_fan_speed;
+
+       /* Link width/speed */
+       uint16_t                        pcie_link_width;
+       uint16_t                        pcie_link_speed; // in 0.1 GT/s
+
+       uint16_t                        padding;
+
+       uint32_t                        gfx_activity_acc;
+       uint32_t                        mem_activity_acc;
+
+       uint16_t                        temperature_hbm[NUM_HBM_INSTANCES];
+
+       /* PMFW attached timestamp (10ns resolution) */
+       uint64_t                        firmware_timestamp;
+
+       /* Voltage (mV) */
+       uint16_t                        voltage_soc;
+       uint16_t                        voltage_gfx;
+       uint16_t                        voltage_mem;
+
+       uint16_t                        padding1;
+};
+
 /*
  * gpu_metrics_v2_0 is not recommended as it's not naturally aligned.
  * Use gpu_metrics_v2_1 or later instead.
index 0934e5b3aa171f5ad0f56b38a4e7a44cb982b55d..0ceb7329838c9da409dab700534153c4f2357492 100644 (file)
@@ -764,6 +764,9 @@ void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev)
        case METRICS_VERSION(1, 2):
                structure_size = sizeof(struct gpu_metrics_v1_2);
                break;
+       case METRICS_VERSION(1, 3):
+               structure_size = sizeof(struct gpu_metrics_v1_3);
+               break;
        case METRICS_VERSION(2, 0):
                structure_size = sizeof(struct gpu_metrics_v2_0);
                break;