2 * Copyright 2017 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
24 #ifndef __KGD_PP_INTERFACE_H__
25 #define __KGD_PP_INTERFACE_H__
27 extern const struct amdgpu_ip_block_version pp_smu_ip_block;
28 extern const struct amdgpu_ip_block_version smu_v11_0_ip_block;
29 extern const struct amdgpu_ip_block_version smu_v12_0_ip_block;
30 extern const struct amdgpu_ip_block_version smu_v13_0_ip_block;
31 extern const struct amdgpu_ip_block_version smu_v14_0_ip_block;
34 SMU_EVENT_RESET_COMPLETE = 0,
37 struct amd_vce_state {
49 enum amd_dpm_forced_level {
50 AMD_DPM_FORCED_LEVEL_AUTO = 0x1,
51 AMD_DPM_FORCED_LEVEL_MANUAL = 0x2,
52 AMD_DPM_FORCED_LEVEL_LOW = 0x4,
53 AMD_DPM_FORCED_LEVEL_HIGH = 0x8,
54 AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD = 0x10,
55 AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK = 0x20,
56 AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK = 0x40,
57 AMD_DPM_FORCED_LEVEL_PROFILE_PEAK = 0x80,
58 AMD_DPM_FORCED_LEVEL_PROFILE_EXIT = 0x100,
59 AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM = 0x200,
62 enum amd_pm_state_type {
63 /* not used for dpm */
64 POWER_STATE_TYPE_DEFAULT,
65 POWER_STATE_TYPE_POWERSAVE,
66 /* user selectable states */
67 POWER_STATE_TYPE_BATTERY,
68 POWER_STATE_TYPE_BALANCED,
69 POWER_STATE_TYPE_PERFORMANCE,
71 POWER_STATE_TYPE_INTERNAL_UVD,
72 POWER_STATE_TYPE_INTERNAL_UVD_SD,
73 POWER_STATE_TYPE_INTERNAL_UVD_HD,
74 POWER_STATE_TYPE_INTERNAL_UVD_HD2,
75 POWER_STATE_TYPE_INTERNAL_UVD_MVC,
76 POWER_STATE_TYPE_INTERNAL_BOOT,
77 POWER_STATE_TYPE_INTERNAL_THERMAL,
78 POWER_STATE_TYPE_INTERNAL_ACPI,
79 POWER_STATE_TYPE_INTERNAL_ULV,
80 POWER_STATE_TYPE_INTERNAL_3DPERF,
83 #define AMD_MAX_VCE_LEVELS 6
86 AMD_VCE_LEVEL_AC_ALL = 0, /* AC, All cases */
87 AMD_VCE_LEVEL_DC_EE = 1, /* DC, entropy encoding */
88 AMD_VCE_LEVEL_DC_LL_LOW = 2, /* DC, low latency queue, res <= 720 */
89 AMD_VCE_LEVEL_DC_LL_HIGH = 3, /* DC, low latency queue, 1080 >= res > 720 */
90 AMD_VCE_LEVEL_DC_GP_LOW = 4, /* DC, general purpose queue, res <= 720 */
91 AMD_VCE_LEVEL_DC_GP_HIGH = 5, /* DC, general purpose queue, 1080 >= res > 720 */
94 enum amd_fan_ctrl_mode {
95 AMD_FAN_CTRL_NONE = 0,
96 AMD_FAN_CTRL_MANUAL = 1,
97 AMD_FAN_CTRL_AUTO = 2,
120 OD_FAN_TARGET_TEMPERATURE,
122 OD_FAN_ZERO_RPM_ENABLE,
123 OD_FAN_ZERO_RPM_STOP_TEMP,
126 enum amd_pp_sensors {
127 AMDGPU_PP_SENSOR_GFX_SCLK = 0,
128 AMDGPU_PP_SENSOR_CPU_CLK,
129 AMDGPU_PP_SENSOR_VDDNB,
130 AMDGPU_PP_SENSOR_VDDGFX,
131 AMDGPU_PP_SENSOR_UVD_VCLK,
132 AMDGPU_PP_SENSOR_UVD_DCLK,
133 AMDGPU_PP_SENSOR_VCE_ECCLK,
134 AMDGPU_PP_SENSOR_GPU_LOAD,
135 AMDGPU_PP_SENSOR_MEM_LOAD,
136 AMDGPU_PP_SENSOR_GFX_MCLK,
137 AMDGPU_PP_SENSOR_GPU_TEMP,
138 AMDGPU_PP_SENSOR_EDGE_TEMP = AMDGPU_PP_SENSOR_GPU_TEMP,
139 AMDGPU_PP_SENSOR_HOTSPOT_TEMP,
140 AMDGPU_PP_SENSOR_MEM_TEMP,
141 AMDGPU_PP_SENSOR_VCE_POWER,
142 AMDGPU_PP_SENSOR_UVD_POWER,
143 AMDGPU_PP_SENSOR_GPU_AVG_POWER,
144 AMDGPU_PP_SENSOR_GPU_INPUT_POWER,
145 AMDGPU_PP_SENSOR_SS_APU_SHARE,
146 AMDGPU_PP_SENSOR_SS_DGPU_SHARE,
147 AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK,
148 AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK,
149 AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK,
150 AMDGPU_PP_SENSOR_MIN_FAN_RPM,
151 AMDGPU_PP_SENSOR_MAX_FAN_RPM,
152 AMDGPU_PP_SENSOR_VCN_POWER_STATE,
153 AMDGPU_PP_SENSOR_PEAK_PSTATE_SCLK,
154 AMDGPU_PP_SENSOR_PEAK_PSTATE_MCLK,
155 AMDGPU_PP_SENSOR_VCN_LOAD,
159 AMD_PP_TASK_DISPLAY_CONFIG_CHANGE,
160 AMD_PP_TASK_ENABLE_USER_STATE,
161 AMD_PP_TASK_READJUST_POWER_STATE,
162 AMD_PP_TASK_COMPLETE_INIT,
166 enum PP_SMC_POWER_PROFILE {
167 PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT = 0x0,
168 PP_SMC_POWER_PROFILE_FULLSCREEN3D = 0x1,
169 PP_SMC_POWER_PROFILE_POWERSAVING = 0x2,
170 PP_SMC_POWER_PROFILE_VIDEO = 0x3,
171 PP_SMC_POWER_PROFILE_VR = 0x4,
172 PP_SMC_POWER_PROFILE_COMPUTE = 0x5,
173 PP_SMC_POWER_PROFILE_CUSTOM = 0x6,
174 PP_SMC_POWER_PROFILE_WINDOW3D = 0x7,
175 PP_SMC_POWER_PROFILE_CAPPED = 0x8,
176 PP_SMC_POWER_PROFILE_UNCAPPED = 0x9,
177 PP_SMC_POWER_PROFILE_COUNT,
180 extern const char * const amdgpu_pp_profile_name[PP_SMC_POWER_PROFILE_COUNT];
185 PP_GROUP_UNKNOWN = 0,
191 enum PP_OD_DPM_TABLE_COMMAND {
192 PP_OD_EDIT_SCLK_VDDC_TABLE,
193 PP_OD_EDIT_MCLK_VDDC_TABLE,
194 PP_OD_EDIT_CCLK_VDDC_TABLE,
195 PP_OD_EDIT_VDDC_CURVE,
196 PP_OD_RESTORE_DEFAULT_TABLE,
197 PP_OD_COMMIT_DPM_TABLE,
198 PP_OD_EDIT_VDDGFX_OFFSET,
199 PP_OD_EDIT_FAN_CURVE,
200 PP_OD_EDIT_ACOUSTIC_LIMIT,
201 PP_OD_EDIT_ACOUSTIC_TARGET,
202 PP_OD_EDIT_FAN_TARGET_TEMPERATURE,
203 PP_OD_EDIT_FAN_MINIMUM_PWM,
204 PP_OD_EDIT_FAN_ZERO_RPM_ENABLE,
205 PP_OD_EDIT_FAN_ZERO_RPM_STOP_TEMP,
208 struct pp_states_info {
222 PP_MP1_STATE_SHUTDOWN,
229 DF_CSTATE_DISALLOW = 0,
234 * DOC: amdgpu_pp_power
236 * APU power is managed to system-level requirements through the PPT
237 * (package power tracking) feature. PPT is intended to limit power to the
238 * requirements of the power source and could be dynamically updated to
239 * maximize APU performance within the system power budget.
241 * Two types of power measurement can be requested, where supported, with
242 * :c:type:`enum pp_power_type <pp_power_type>`.
246 * enum pp_power_limit_level - Used to query the power limits
248 * @PP_PWR_LIMIT_MIN: Minimum Power Limit
249 * @PP_PWR_LIMIT_CURRENT: Current Power Limit
250 * @PP_PWR_LIMIT_DEFAULT: Default Power Limit
251 * @PP_PWR_LIMIT_MAX: Maximum Power Limit
253 enum pp_power_limit_level {
254 PP_PWR_LIMIT_MIN = -1,
255 PP_PWR_LIMIT_CURRENT,
256 PP_PWR_LIMIT_DEFAULT,
261 * enum pp_power_type - Used to specify the type of the requested power
263 * @PP_PWR_TYPE_SUSTAINED: manages the configurable, thermally significant
264 * moving average of APU power (default ~5000 ms).
265 * @PP_PWR_TYPE_FAST: manages the ~10 ms moving average of APU power,
269 PP_PWR_TYPE_SUSTAINED,
273 enum pp_xgmi_plpd_mode {
282 PP_PM_POLICY_NONE = -1,
283 PP_PM_POLICY_SOC_PSTATE = 0,
284 PP_PM_POLICY_XGMI_PLPD,
288 enum pp_policy_soc_pstate {
289 SOC_PSTATE_DEFAULT = 0,
296 #define PP_POLICY_MAX_LEVELS 5
298 #define PP_GROUP_MASK 0xF0000000
299 #define PP_GROUP_SHIFT 28
301 #define PP_BLOCK_MASK 0x0FFFFF00
302 #define PP_BLOCK_SHIFT 8
304 #define PP_BLOCK_GFX_CG 0x01
305 #define PP_BLOCK_GFX_MG 0x02
306 #define PP_BLOCK_GFX_3D 0x04
307 #define PP_BLOCK_GFX_RLC 0x08
308 #define PP_BLOCK_GFX_CP 0x10
309 #define PP_BLOCK_SYS_BIF 0x01
310 #define PP_BLOCK_SYS_MC 0x02
311 #define PP_BLOCK_SYS_ROM 0x04
312 #define PP_BLOCK_SYS_DRM 0x08
313 #define PP_BLOCK_SYS_HDP 0x10
314 #define PP_BLOCK_SYS_SDMA 0x20
316 #define PP_STATE_MASK 0x0000000F
317 #define PP_STATE_SHIFT 0
318 #define PP_STATE_SUPPORT_MASK 0x000000F0
319 #define PP_STATE_SUPPORT_SHIFT 0
321 #define PP_STATE_CG 0x01
322 #define PP_STATE_LS 0x02
323 #define PP_STATE_DS 0x04
324 #define PP_STATE_SD 0x08
325 #define PP_STATE_SUPPORT_CG 0x10
326 #define PP_STATE_SUPPORT_LS 0x20
327 #define PP_STATE_SUPPORT_DS 0x40
328 #define PP_STATE_SUPPORT_SD 0x80
330 #define PP_CG_MSG_ID(group, block, support, state) \
331 ((group) << PP_GROUP_SHIFT | (block) << PP_BLOCK_SHIFT | \
332 (support) << PP_STATE_SUPPORT_SHIFT | (state) << PP_STATE_SHIFT)
334 #define XGMI_MODE_PSTATE_D3 0
335 #define XGMI_MODE_PSTATE_D0 1
337 #define NUM_HBM_INSTANCES 4
338 #define NUM_XGMI_LINKS 8
339 #define MAX_GFX_CLKS 8
342 #define NUM_JPEG_ENG 32
346 enum amd_pp_clock_type;
347 struct amd_pp_simple_clock_info;
348 struct amd_pp_display_configuration;
349 struct amd_pp_clock_info;
350 struct pp_display_clock_request;
351 struct pp_clock_levels_with_voltage;
352 struct pp_clock_levels_with_latency;
353 struct amd_pp_clocks;
354 struct pp_smu_wm_range_sets;
355 struct pp_smu_nv_clock_table;
358 struct amdgpu_xcp_metrics {
359 /* Utilization Instantaneous (%) */
360 u32 gfx_busy_inst[MAX_XCC];
361 u16 jpeg_busy[NUM_JPEG_ENG];
362 u16 vcn_busy[NUM_VCN];
363 /* Utilization Accumulated (%) */
364 u64 gfx_busy_acc[MAX_XCC];
367 struct amd_pm_funcs {
368 /* export for dpm on ci and si */
369 int (*pre_set_power_state)(void *handle);
370 int (*set_power_state)(void *handle);
371 void (*post_set_power_state)(void *handle);
372 void (*display_configuration_changed)(void *handle);
373 void (*print_power_state)(void *handle, void *ps);
374 bool (*vblank_too_short)(void *handle);
375 void (*enable_bapm)(void *handle, bool enable);
376 int (*check_state_equal)(void *handle,
380 /* export for sysfs */
381 int (*set_fan_control_mode)(void *handle, u32 mode);
382 int (*get_fan_control_mode)(void *handle, u32 *fan_mode);
383 int (*set_fan_speed_pwm)(void *handle, u32 speed);
384 int (*get_fan_speed_pwm)(void *handle, u32 *speed);
385 int (*force_clock_level)(void *handle, enum pp_clock_type type, uint32_t mask);
386 int (*print_clock_levels)(void *handle, enum pp_clock_type type, char *buf);
387 int (*emit_clock_levels)(void *handle, enum pp_clock_type type, char *buf, int *offset);
388 int (*force_performance_level)(void *handle, enum amd_dpm_forced_level level);
389 int (*get_sclk_od)(void *handle);
390 int (*set_sclk_od)(void *handle, uint32_t value);
391 int (*get_mclk_od)(void *handle);
392 int (*set_mclk_od)(void *handle, uint32_t value);
393 int (*read_sensor)(void *handle, int idx, void *value, int *size);
394 int (*get_apu_thermal_limit)(void *handle, uint32_t *limit);
395 int (*set_apu_thermal_limit)(void *handle, uint32_t limit);
396 enum amd_dpm_forced_level (*get_performance_level)(void *handle);
397 enum amd_pm_state_type (*get_current_power_state)(void *handle);
398 int (*get_fan_speed_rpm)(void *handle, uint32_t *rpm);
399 int (*set_fan_speed_rpm)(void *handle, uint32_t rpm);
400 int (*get_pp_num_states)(void *handle, struct pp_states_info *data);
401 int (*get_pp_table)(void *handle, char **table);
402 int (*set_pp_table)(void *handle, const char *buf, size_t size);
403 void (*debugfs_print_current_performance_level)(void *handle, struct seq_file *m);
404 int (*switch_power_profile)(void *handle, enum PP_SMC_POWER_PROFILE type, bool en);
405 /* export to amdgpu */
406 struct amd_vce_state *(*get_vce_clock_state)(void *handle, u32 idx);
407 int (*dispatch_tasks)(void *handle, enum amd_pp_task task_id,
408 enum amd_pm_state_type *user_state);
409 int (*load_firmware)(void *handle);
410 int (*wait_for_fw_loading_complete)(void *handle);
411 int (*set_powergating_by_smu)(void *handle,
412 uint32_t block_type, bool gate);
413 int (*set_clockgating_by_smu)(void *handle, uint32_t msg_id);
414 int (*set_power_limit)(void *handle, uint32_t n);
415 int (*get_power_limit)(void *handle, uint32_t *limit,
416 enum pp_power_limit_level pp_limit_level,
417 enum pp_power_type power_type);
418 int (*get_power_profile_mode)(void *handle, char *buf);
419 int (*set_power_profile_mode)(void *handle, long *input, uint32_t size);
420 int (*set_fine_grain_clk_vol)(void *handle, uint32_t type, long *input, uint32_t size);
421 int (*odn_edit_dpm_table)(void *handle, enum PP_OD_DPM_TABLE_COMMAND type,
422 long *input, uint32_t size);
423 int (*set_mp1_state)(void *handle, enum pp_mp1_state mp1_state);
424 int (*smu_i2c_bus_access)(void *handle, bool acquire);
425 int (*gfx_state_change_set)(void *handle, uint32_t state);
427 u32 (*get_sclk)(void *handle, bool low);
428 u32 (*get_mclk)(void *handle, bool low);
429 int (*display_configuration_change)(void *handle,
430 const struct amd_pp_display_configuration *input);
431 int (*get_display_power_level)(void *handle,
432 struct amd_pp_simple_clock_info *output);
433 int (*get_current_clocks)(void *handle,
434 struct amd_pp_clock_info *clocks);
435 int (*get_clock_by_type)(void *handle,
436 enum amd_pp_clock_type type,
437 struct amd_pp_clocks *clocks);
438 int (*get_clock_by_type_with_latency)(void *handle,
439 enum amd_pp_clock_type type,
440 struct pp_clock_levels_with_latency *clocks);
441 int (*get_clock_by_type_with_voltage)(void *handle,
442 enum amd_pp_clock_type type,
443 struct pp_clock_levels_with_voltage *clocks);
444 int (*set_watermarks_for_clocks_ranges)(void *handle,
446 int (*display_clock_voltage_request)(void *handle,
447 struct pp_display_clock_request *clock);
448 int (*get_display_mode_validation_clocks)(void *handle,
449 struct amd_pp_simple_clock_info *clocks);
450 int (*notify_smu_enable_pwe)(void *handle);
451 int (*enable_mgpu_fan_boost)(void *handle);
452 int (*set_active_display_count)(void *handle, uint32_t count);
453 int (*set_hard_min_dcefclk_by_freq)(void *handle, uint32_t clock);
454 int (*set_hard_min_fclk_by_freq)(void *handle, uint32_t clock);
455 int (*set_min_deep_sleep_dcefclk)(void *handle, uint32_t clock);
456 int (*get_asic_baco_capability)(void *handle);
457 int (*get_asic_baco_state)(void *handle, int *state);
458 int (*set_asic_baco_state)(void *handle, int state);
459 int (*get_ppfeature_status)(void *handle, char *buf);
460 int (*set_ppfeature_status)(void *handle, uint64_t ppfeature_masks);
461 int (*asic_reset_mode_2)(void *handle);
462 int (*asic_reset_enable_gfx_features)(void *handle);
463 int (*set_df_cstate)(void *handle, enum pp_df_cstate state);
464 int (*set_xgmi_pstate)(void *handle, uint32_t pstate);
465 ssize_t (*get_gpu_metrics)(void *handle, void **table);
466 ssize_t (*get_pm_metrics)(void *handle, void *pmmetrics, size_t size);
467 int (*set_watermarks_for_clock_ranges)(void *handle,
468 struct pp_smu_wm_range_sets *ranges);
469 int (*display_disable_memory_clock_switch)(void *handle,
470 bool disable_memory_clock_switch);
471 int (*get_max_sustainable_clocks_by_dc)(void *handle,
472 struct pp_smu_nv_clock_table *max_clocks);
473 int (*get_uclk_dpm_states)(void *handle,
474 unsigned int *clock_values_in_khz,
475 unsigned int *num_states);
476 int (*get_dpm_clock_table)(void *handle,
477 struct dpm_clocks *clock_table);
478 int (*get_smu_prv_buf_details)(void *handle, void **addr, size_t *size);
479 void (*pm_compute_clocks)(void *handle);
480 int (*notify_rlc_state)(void *handle, bool en);
483 struct metrics_table_header {
484 uint16_t structure_size;
485 uint8_t format_revision;
486 uint8_t content_revision;
490 * gpu_metrics_v1_0 is not recommended as it's not naturally aligned.
491 * Use gpu_metrics_v1_1 or later instead.
493 struct gpu_metrics_v1_0 {
494 struct metrics_table_header common_header;
496 /* Driver attached timestamp (in ns) */
497 uint64_t system_clock_counter;
500 uint16_t temperature_edge;
501 uint16_t temperature_hotspot;
502 uint16_t temperature_mem;
503 uint16_t temperature_vrgfx;
504 uint16_t temperature_vrsoc;
505 uint16_t temperature_vrmem;
508 uint16_t average_gfx_activity;
509 uint16_t average_umc_activity; // memory controller
510 uint16_t average_mm_activity; // UVD or VCN
513 uint16_t average_socket_power;
514 uint32_t energy_accumulator;
517 uint16_t average_gfxclk_frequency;
518 uint16_t average_socclk_frequency;
519 uint16_t average_uclk_frequency;
520 uint16_t average_vclk0_frequency;
521 uint16_t average_dclk0_frequency;
522 uint16_t average_vclk1_frequency;
523 uint16_t average_dclk1_frequency;
526 uint16_t current_gfxclk;
527 uint16_t current_socclk;
528 uint16_t current_uclk;
529 uint16_t current_vclk0;
530 uint16_t current_dclk0;
531 uint16_t current_vclk1;
532 uint16_t current_dclk1;
534 /* Throttle status */
535 uint32_t throttle_status;
538 uint16_t current_fan_speed;
540 /* Link width/speed */
541 uint8_t pcie_link_width;
542 uint8_t pcie_link_speed; // in 0.1 GT/s
545 struct gpu_metrics_v1_1 {
546 struct metrics_table_header common_header;
549 uint16_t temperature_edge;
550 uint16_t temperature_hotspot;
551 uint16_t temperature_mem;
552 uint16_t temperature_vrgfx;
553 uint16_t temperature_vrsoc;
554 uint16_t temperature_vrmem;
557 uint16_t average_gfx_activity;
558 uint16_t average_umc_activity; // memory controller
559 uint16_t average_mm_activity; // UVD or VCN
562 uint16_t average_socket_power;
563 uint64_t energy_accumulator;
565 /* Driver attached timestamp (in ns) */
566 uint64_t system_clock_counter;
569 uint16_t average_gfxclk_frequency;
570 uint16_t average_socclk_frequency;
571 uint16_t average_uclk_frequency;
572 uint16_t average_vclk0_frequency;
573 uint16_t average_dclk0_frequency;
574 uint16_t average_vclk1_frequency;
575 uint16_t average_dclk1_frequency;
578 uint16_t current_gfxclk;
579 uint16_t current_socclk;
580 uint16_t current_uclk;
581 uint16_t current_vclk0;
582 uint16_t current_dclk0;
583 uint16_t current_vclk1;
584 uint16_t current_dclk1;
586 /* Throttle status */
587 uint32_t throttle_status;
590 uint16_t current_fan_speed;
592 /* Link width/speed */
593 uint16_t pcie_link_width;
594 uint16_t pcie_link_speed; // in 0.1 GT/s
598 uint32_t gfx_activity_acc;
599 uint32_t mem_activity_acc;
601 uint16_t temperature_hbm[NUM_HBM_INSTANCES];
604 struct gpu_metrics_v1_2 {
605 struct metrics_table_header common_header;
608 uint16_t temperature_edge;
609 uint16_t temperature_hotspot;
610 uint16_t temperature_mem;
611 uint16_t temperature_vrgfx;
612 uint16_t temperature_vrsoc;
613 uint16_t temperature_vrmem;
616 uint16_t average_gfx_activity;
617 uint16_t average_umc_activity; // memory controller
618 uint16_t average_mm_activity; // UVD or VCN
621 uint16_t average_socket_power;
622 uint64_t energy_accumulator;
624 /* Driver attached timestamp (in ns) */
625 uint64_t system_clock_counter;
628 uint16_t average_gfxclk_frequency;
629 uint16_t average_socclk_frequency;
630 uint16_t average_uclk_frequency;
631 uint16_t average_vclk0_frequency;
632 uint16_t average_dclk0_frequency;
633 uint16_t average_vclk1_frequency;
634 uint16_t average_dclk1_frequency;
637 uint16_t current_gfxclk;
638 uint16_t current_socclk;
639 uint16_t current_uclk;
640 uint16_t current_vclk0;
641 uint16_t current_dclk0;
642 uint16_t current_vclk1;
643 uint16_t current_dclk1;
645 /* Throttle status (ASIC dependent) */
646 uint32_t throttle_status;
649 uint16_t current_fan_speed;
651 /* Link width/speed */
652 uint16_t pcie_link_width;
653 uint16_t pcie_link_speed; // in 0.1 GT/s
657 uint32_t gfx_activity_acc;
658 uint32_t mem_activity_acc;
660 uint16_t temperature_hbm[NUM_HBM_INSTANCES];
662 /* PMFW attached timestamp (10ns resolution) */
663 uint64_t firmware_timestamp;
666 struct gpu_metrics_v1_3 {
667 struct metrics_table_header common_header;
670 uint16_t temperature_edge;
671 uint16_t temperature_hotspot;
672 uint16_t temperature_mem;
673 uint16_t temperature_vrgfx;
674 uint16_t temperature_vrsoc;
675 uint16_t temperature_vrmem;
678 uint16_t average_gfx_activity;
679 uint16_t average_umc_activity; // memory controller
680 uint16_t average_mm_activity; // UVD or VCN
683 uint16_t average_socket_power;
684 uint64_t energy_accumulator;
686 /* Driver attached timestamp (in ns) */
687 uint64_t system_clock_counter;
690 uint16_t average_gfxclk_frequency;
691 uint16_t average_socclk_frequency;
692 uint16_t average_uclk_frequency;
693 uint16_t average_vclk0_frequency;
694 uint16_t average_dclk0_frequency;
695 uint16_t average_vclk1_frequency;
696 uint16_t average_dclk1_frequency;
699 uint16_t current_gfxclk;
700 uint16_t current_socclk;
701 uint16_t current_uclk;
702 uint16_t current_vclk0;
703 uint16_t current_dclk0;
704 uint16_t current_vclk1;
705 uint16_t current_dclk1;
707 /* Throttle status */
708 uint32_t throttle_status;
711 uint16_t current_fan_speed;
713 /* Link width/speed */
714 uint16_t pcie_link_width;
715 uint16_t pcie_link_speed; // in 0.1 GT/s
719 uint32_t gfx_activity_acc;
720 uint32_t mem_activity_acc;
722 uint16_t temperature_hbm[NUM_HBM_INSTANCES];
724 /* PMFW attached timestamp (10ns resolution) */
725 uint64_t firmware_timestamp;
728 uint16_t voltage_soc;
729 uint16_t voltage_gfx;
730 uint16_t voltage_mem;
734 /* Throttle status (ASIC independent) */
735 uint64_t indep_throttle_status;
738 struct gpu_metrics_v1_4 {
739 struct metrics_table_header common_header;
741 /* Temperature (Celsius) */
742 uint16_t temperature_hotspot;
743 uint16_t temperature_mem;
744 uint16_t temperature_vrsoc;
747 uint16_t curr_socket_power;
749 /* Utilization (%) */
750 uint16_t average_gfx_activity;
751 uint16_t average_umc_activity; // memory controller
752 uint16_t vcn_activity[NUM_VCN];
754 /* Energy (15.259uJ (2^-16) units) */
755 uint64_t energy_accumulator;
757 /* Driver attached timestamp (in ns) */
758 uint64_t system_clock_counter;
760 /* Throttle status */
761 uint32_t throttle_status;
763 /* Clock Lock Status. Each bit corresponds to clock instance */
764 uint32_t gfxclk_lock_status;
766 /* Link width (number of lanes) and speed (in 0.1 GT/s) */
767 uint16_t pcie_link_width;
768 uint16_t pcie_link_speed;
770 /* XGMI bus width and bitrate (in Gbps) */
771 uint16_t xgmi_link_width;
772 uint16_t xgmi_link_speed;
774 /* Utilization Accumulated (%) */
775 uint32_t gfx_activity_acc;
776 uint32_t mem_activity_acc;
778 /*PCIE accumulated bandwidth (GB/sec) */
779 uint64_t pcie_bandwidth_acc;
781 /*PCIE instantaneous bandwidth (GB/sec) */
782 uint64_t pcie_bandwidth_inst;
784 /* PCIE L0 to recovery state transition accumulated count */
785 uint64_t pcie_l0_to_recov_count_acc;
787 /* PCIE replay accumulated count */
788 uint64_t pcie_replay_count_acc;
790 /* PCIE replay rollover accumulated count */
791 uint64_t pcie_replay_rover_count_acc;
793 /* XGMI accumulated data transfer size(KiloBytes) */
794 uint64_t xgmi_read_data_acc[NUM_XGMI_LINKS];
795 uint64_t xgmi_write_data_acc[NUM_XGMI_LINKS];
797 /* PMFW attached timestamp (10ns resolution) */
798 uint64_t firmware_timestamp;
800 /* Current clocks (Mhz) */
801 uint16_t current_gfxclk[MAX_GFX_CLKS];
802 uint16_t current_socclk[MAX_CLKS];
803 uint16_t current_vclk0[MAX_CLKS];
804 uint16_t current_dclk0[MAX_CLKS];
805 uint16_t current_uclk;
810 struct gpu_metrics_v1_5 {
811 struct metrics_table_header common_header;
813 /* Temperature (Celsius) */
814 uint16_t temperature_hotspot;
815 uint16_t temperature_mem;
816 uint16_t temperature_vrsoc;
819 uint16_t curr_socket_power;
821 /* Utilization (%) */
822 uint16_t average_gfx_activity;
823 uint16_t average_umc_activity; // memory controller
824 uint16_t vcn_activity[NUM_VCN];
825 uint16_t jpeg_activity[NUM_JPEG_ENG];
827 /* Energy (15.259uJ (2^-16) units) */
828 uint64_t energy_accumulator;
830 /* Driver attached timestamp (in ns) */
831 uint64_t system_clock_counter;
833 /* Throttle status */
834 uint32_t throttle_status;
836 /* Clock Lock Status. Each bit corresponds to clock instance */
837 uint32_t gfxclk_lock_status;
839 /* Link width (number of lanes) and speed (in 0.1 GT/s) */
840 uint16_t pcie_link_width;
841 uint16_t pcie_link_speed;
843 /* XGMI bus width and bitrate (in Gbps) */
844 uint16_t xgmi_link_width;
845 uint16_t xgmi_link_speed;
847 /* Utilization Accumulated (%) */
848 uint32_t gfx_activity_acc;
849 uint32_t mem_activity_acc;
851 /*PCIE accumulated bandwidth (GB/sec) */
852 uint64_t pcie_bandwidth_acc;
854 /*PCIE instantaneous bandwidth (GB/sec) */
855 uint64_t pcie_bandwidth_inst;
857 /* PCIE L0 to recovery state transition accumulated count */
858 uint64_t pcie_l0_to_recov_count_acc;
860 /* PCIE replay accumulated count */
861 uint64_t pcie_replay_count_acc;
863 /* PCIE replay rollover accumulated count */
864 uint64_t pcie_replay_rover_count_acc;
866 /* PCIE NAK sent accumulated count */
867 uint32_t pcie_nak_sent_count_acc;
869 /* PCIE NAK received accumulated count */
870 uint32_t pcie_nak_rcvd_count_acc;
872 /* XGMI accumulated data transfer size(KiloBytes) */
873 uint64_t xgmi_read_data_acc[NUM_XGMI_LINKS];
874 uint64_t xgmi_write_data_acc[NUM_XGMI_LINKS];
876 /* PMFW attached timestamp (10ns resolution) */
877 uint64_t firmware_timestamp;
879 /* Current clocks (Mhz) */
880 uint16_t current_gfxclk[MAX_GFX_CLKS];
881 uint16_t current_socclk[MAX_CLKS];
882 uint16_t current_vclk0[MAX_CLKS];
883 uint16_t current_dclk0[MAX_CLKS];
884 uint16_t current_uclk;
889 struct gpu_metrics_v1_6 {
890 struct metrics_table_header common_header;
892 /* Temperature (Celsius) */
893 uint16_t temperature_hotspot;
894 uint16_t temperature_mem;
895 uint16_t temperature_vrsoc;
898 uint16_t curr_socket_power;
900 /* Utilization (%) */
901 uint16_t average_gfx_activity;
902 uint16_t average_umc_activity; // memory controller
904 /* Energy (15.259uJ (2^-16) units) */
905 uint64_t energy_accumulator;
907 /* Driver attached timestamp (in ns) */
908 uint64_t system_clock_counter;
910 /* Accumulation cycle counter */
911 uint32_t accumulation_counter;
913 /* Accumulated throttler residencies */
914 uint32_t prochot_residency_acc;
915 uint32_t ppt_residency_acc;
916 uint32_t socket_thm_residency_acc;
917 uint32_t vr_thm_residency_acc;
918 uint32_t hbm_thm_residency_acc;
920 /* Clock Lock Status. Each bit corresponds to clock instance */
921 uint32_t gfxclk_lock_status;
923 /* Link width (number of lanes) and speed (in 0.1 GT/s) */
924 uint16_t pcie_link_width;
925 uint16_t pcie_link_speed;
927 /* XGMI bus width and bitrate (in Gbps) */
928 uint16_t xgmi_link_width;
929 uint16_t xgmi_link_speed;
931 /* Utilization Accumulated (%) */
932 uint32_t gfx_activity_acc;
933 uint32_t mem_activity_acc;
935 /*PCIE accumulated bandwidth (GB/sec) */
936 uint64_t pcie_bandwidth_acc;
938 /*PCIE instantaneous bandwidth (GB/sec) */
939 uint64_t pcie_bandwidth_inst;
941 /* PCIE L0 to recovery state transition accumulated count */
942 uint64_t pcie_l0_to_recov_count_acc;
944 /* PCIE replay accumulated count */
945 uint64_t pcie_replay_count_acc;
947 /* PCIE replay rollover accumulated count */
948 uint64_t pcie_replay_rover_count_acc;
950 /* PCIE NAK sent accumulated count */
951 uint32_t pcie_nak_sent_count_acc;
953 /* PCIE NAK received accumulated count */
954 uint32_t pcie_nak_rcvd_count_acc;
956 /* XGMI accumulated data transfer size(KiloBytes) */
957 uint64_t xgmi_read_data_acc[NUM_XGMI_LINKS];
958 uint64_t xgmi_write_data_acc[NUM_XGMI_LINKS];
960 /* PMFW attached timestamp (10ns resolution) */
961 uint64_t firmware_timestamp;
963 /* Current clocks (Mhz) */
964 uint16_t current_gfxclk[MAX_GFX_CLKS];
965 uint16_t current_socclk[MAX_CLKS];
966 uint16_t current_vclk0[MAX_CLKS];
967 uint16_t current_dclk0[MAX_CLKS];
968 uint16_t current_uclk;
970 /* Number of current partition */
971 uint16_t num_partition;
973 /* XCP metrics stats */
974 struct amdgpu_xcp_metrics xcp_stats[NUM_XCP];
976 /* PCIE other end recovery counter */
977 uint32_t pcie_lc_perf_other_end_recovery;
981 * gpu_metrics_v2_0 is not recommended as it's not naturally aligned.
982 * Use gpu_metrics_v2_1 or later instead.
984 struct gpu_metrics_v2_0 {
985 struct metrics_table_header common_header;
987 /* Driver attached timestamp (in ns) */
988 uint64_t system_clock_counter;
991 uint16_t temperature_gfx; // gfx temperature on APUs
992 uint16_t temperature_soc; // soc temperature on APUs
993 uint16_t temperature_core[8]; // CPU core temperature on APUs
994 uint16_t temperature_l3[2];
997 uint16_t average_gfx_activity;
998 uint16_t average_mm_activity; // UVD or VCN
1001 uint16_t average_socket_power; // dGPU + APU power on A + A platform
1002 uint16_t average_cpu_power;
1003 uint16_t average_soc_power;
1004 uint16_t average_gfx_power;
1005 uint16_t average_core_power[8]; // CPU core power on APUs
1007 /* Average clocks */
1008 uint16_t average_gfxclk_frequency;
1009 uint16_t average_socclk_frequency;
1010 uint16_t average_uclk_frequency;
1011 uint16_t average_fclk_frequency;
1012 uint16_t average_vclk_frequency;
1013 uint16_t average_dclk_frequency;
1015 /* Current clocks */
1016 uint16_t current_gfxclk;
1017 uint16_t current_socclk;
1018 uint16_t current_uclk;
1019 uint16_t current_fclk;
1020 uint16_t current_vclk;
1021 uint16_t current_dclk;
1022 uint16_t current_coreclk[8]; // CPU core clocks
1023 uint16_t current_l3clk[2];
1025 /* Throttle status */
1026 uint32_t throttle_status;
1034 struct gpu_metrics_v2_1 {
1035 struct metrics_table_header common_header;
1038 uint16_t temperature_gfx; // gfx temperature on APUs
1039 uint16_t temperature_soc; // soc temperature on APUs
1040 uint16_t temperature_core[8]; // CPU core temperature on APUs
1041 uint16_t temperature_l3[2];
1044 uint16_t average_gfx_activity;
1045 uint16_t average_mm_activity; // UVD or VCN
1047 /* Driver attached timestamp (in ns) */
1048 uint64_t system_clock_counter;
1051 uint16_t average_socket_power; // dGPU + APU power on A + A platform
1052 uint16_t average_cpu_power;
1053 uint16_t average_soc_power;
1054 uint16_t average_gfx_power;
1055 uint16_t average_core_power[8]; // CPU core power on APUs
1057 /* Average clocks */
1058 uint16_t average_gfxclk_frequency;
1059 uint16_t average_socclk_frequency;
1060 uint16_t average_uclk_frequency;
1061 uint16_t average_fclk_frequency;
1062 uint16_t average_vclk_frequency;
1063 uint16_t average_dclk_frequency;
1065 /* Current clocks */
1066 uint16_t current_gfxclk;
1067 uint16_t current_socclk;
1068 uint16_t current_uclk;
1069 uint16_t current_fclk;
1070 uint16_t current_vclk;
1071 uint16_t current_dclk;
1072 uint16_t current_coreclk[8]; // CPU core clocks
1073 uint16_t current_l3clk[2];
1075 /* Throttle status */
1076 uint32_t throttle_status;
1081 uint16_t padding[3];
1084 struct gpu_metrics_v2_2 {
1085 struct metrics_table_header common_header;
1088 uint16_t temperature_gfx; // gfx temperature on APUs
1089 uint16_t temperature_soc; // soc temperature on APUs
1090 uint16_t temperature_core[8]; // CPU core temperature on APUs
1091 uint16_t temperature_l3[2];
1094 uint16_t average_gfx_activity;
1095 uint16_t average_mm_activity; // UVD or VCN
1097 /* Driver attached timestamp (in ns) */
1098 uint64_t system_clock_counter;
1101 uint16_t average_socket_power; // dGPU + APU power on A + A platform
1102 uint16_t average_cpu_power;
1103 uint16_t average_soc_power;
1104 uint16_t average_gfx_power;
1105 uint16_t average_core_power[8]; // CPU core power on APUs
1107 /* Average clocks */
1108 uint16_t average_gfxclk_frequency;
1109 uint16_t average_socclk_frequency;
1110 uint16_t average_uclk_frequency;
1111 uint16_t average_fclk_frequency;
1112 uint16_t average_vclk_frequency;
1113 uint16_t average_dclk_frequency;
1115 /* Current clocks */
1116 uint16_t current_gfxclk;
1117 uint16_t current_socclk;
1118 uint16_t current_uclk;
1119 uint16_t current_fclk;
1120 uint16_t current_vclk;
1121 uint16_t current_dclk;
1122 uint16_t current_coreclk[8]; // CPU core clocks
1123 uint16_t current_l3clk[2];
1125 /* Throttle status (ASIC dependent) */
1126 uint32_t throttle_status;
1131 uint16_t padding[3];
1133 /* Throttle status (ASIC independent) */
1134 uint64_t indep_throttle_status;
1137 struct gpu_metrics_v2_3 {
1138 struct metrics_table_header common_header;
1141 uint16_t temperature_gfx; // gfx temperature on APUs
1142 uint16_t temperature_soc; // soc temperature on APUs
1143 uint16_t temperature_core[8]; // CPU core temperature on APUs
1144 uint16_t temperature_l3[2];
1147 uint16_t average_gfx_activity;
1148 uint16_t average_mm_activity; // UVD or VCN
1150 /* Driver attached timestamp (in ns) */
1151 uint64_t system_clock_counter;
1154 uint16_t average_socket_power; // dGPU + APU power on A + A platform
1155 uint16_t average_cpu_power;
1156 uint16_t average_soc_power;
1157 uint16_t average_gfx_power;
1158 uint16_t average_core_power[8]; // CPU core power on APUs
1160 /* Average clocks */
1161 uint16_t average_gfxclk_frequency;
1162 uint16_t average_socclk_frequency;
1163 uint16_t average_uclk_frequency;
1164 uint16_t average_fclk_frequency;
1165 uint16_t average_vclk_frequency;
1166 uint16_t average_dclk_frequency;
1168 /* Current clocks */
1169 uint16_t current_gfxclk;
1170 uint16_t current_socclk;
1171 uint16_t current_uclk;
1172 uint16_t current_fclk;
1173 uint16_t current_vclk;
1174 uint16_t current_dclk;
1175 uint16_t current_coreclk[8]; // CPU core clocks
1176 uint16_t current_l3clk[2];
1178 /* Throttle status (ASIC dependent) */
1179 uint32_t throttle_status;
1184 uint16_t padding[3];
1186 /* Throttle status (ASIC independent) */
1187 uint64_t indep_throttle_status;
1189 /* Average Temperature */
1190 uint16_t average_temperature_gfx; // average gfx temperature on APUs
1191 uint16_t average_temperature_soc; // average soc temperature on APUs
1192 uint16_t average_temperature_core[8]; // average CPU core temperature on APUs
1193 uint16_t average_temperature_l3[2];
1196 struct gpu_metrics_v2_4 {
1197 struct metrics_table_header common_header;
1199 /* Temperature (unit: centi-Celsius) */
1200 uint16_t temperature_gfx;
1201 uint16_t temperature_soc;
1202 uint16_t temperature_core[8];
1203 uint16_t temperature_l3[2];
1205 /* Utilization (unit: centi) */
1206 uint16_t average_gfx_activity;
1207 uint16_t average_mm_activity;
1209 /* Driver attached timestamp (in ns) */
1210 uint64_t system_clock_counter;
1212 /* Power/Energy (unit: mW) */
1213 uint16_t average_socket_power;
1214 uint16_t average_cpu_power;
1215 uint16_t average_soc_power;
1216 uint16_t average_gfx_power;
1217 uint16_t average_core_power[8];
1219 /* Average clocks (unit: MHz) */
1220 uint16_t average_gfxclk_frequency;
1221 uint16_t average_socclk_frequency;
1222 uint16_t average_uclk_frequency;
1223 uint16_t average_fclk_frequency;
1224 uint16_t average_vclk_frequency;
1225 uint16_t average_dclk_frequency;
1227 /* Current clocks (unit: MHz) */
1228 uint16_t current_gfxclk;
1229 uint16_t current_socclk;
1230 uint16_t current_uclk;
1231 uint16_t current_fclk;
1232 uint16_t current_vclk;
1233 uint16_t current_dclk;
1234 uint16_t current_coreclk[8];
1235 uint16_t current_l3clk[2];
1237 /* Throttle status (ASIC dependent) */
1238 uint32_t throttle_status;
1243 uint16_t padding[3];
1245 /* Throttle status (ASIC independent) */
1246 uint64_t indep_throttle_status;
1248 /* Average Temperature (unit: centi-Celsius) */
1249 uint16_t average_temperature_gfx;
1250 uint16_t average_temperature_soc;
1251 uint16_t average_temperature_core[8];
1252 uint16_t average_temperature_l3[2];
1254 /* Power/Voltage (unit: mV) */
1255 uint16_t average_cpu_voltage;
1256 uint16_t average_soc_voltage;
1257 uint16_t average_gfx_voltage;
1259 /* Power/Current (unit: mA) */
1260 uint16_t average_cpu_current;
1261 uint16_t average_soc_current;
1262 uint16_t average_gfx_current;
1265 struct gpu_metrics_v3_0 {
1266 struct metrics_table_header common_header;
1269 /* gfx temperature on APUs */
1270 uint16_t temperature_gfx;
1271 /* soc temperature on APUs */
1272 uint16_t temperature_soc;
1273 /* CPU core temperature on APUs */
1274 uint16_t temperature_core[16];
1275 /* skin temperature on APUs */
1276 uint16_t temperature_skin;
1279 /* time filtered GFX busy % [0-100] */
1280 uint16_t average_gfx_activity;
1281 /* time filtered VCN busy % [0-100] */
1282 uint16_t average_vcn_activity;
1283 /* time filtered IPU per-column busy % [0-100] */
1284 uint16_t average_ipu_activity[8];
1285 /* time filtered per-core C0 residency % [0-100]*/
1286 uint16_t average_core_c0_activity[16];
1287 /* time filtered DRAM read bandwidth [MB/sec] */
1288 uint16_t average_dram_reads;
1289 /* time filtered DRAM write bandwidth [MB/sec] */
1290 uint16_t average_dram_writes;
1291 /* time filtered IPU read bandwidth [MB/sec] */
1292 uint16_t average_ipu_reads;
1293 /* time filtered IPU write bandwidth [MB/sec] */
1294 uint16_t average_ipu_writes;
1296 /* Driver attached timestamp (in ns) */
1297 uint64_t system_clock_counter;
1300 /* time filtered power used for PPT/STAPM [APU+dGPU] [mW] */
1301 uint32_t average_socket_power;
1302 /* time filtered IPU power [mW] */
1303 uint16_t average_ipu_power;
1304 /* time filtered APU power [mW] */
1305 uint32_t average_apu_power;
1306 /* time filtered GFX power [mW] */
1307 uint32_t average_gfx_power;
1308 /* time filtered dGPU power [mW] */
1309 uint32_t average_dgpu_power;
1310 /* time filtered sum of core power across all cores in the socket [mW] */
1311 uint32_t average_all_core_power;
1312 /* calculated core power [mW] */
1313 uint16_t average_core_power[16];
1314 /* time filtered total system power [mW] */
1315 uint16_t average_sys_power;
1316 /* maximum IRM defined STAPM power limit [mW] */
1317 uint16_t stapm_power_limit;
1318 /* time filtered STAPM power limit [mW] */
1319 uint16_t current_stapm_power_limit;
1321 /* time filtered clocks [MHz] */
1322 uint16_t average_gfxclk_frequency;
1323 uint16_t average_socclk_frequency;
1324 uint16_t average_vpeclk_frequency;
1325 uint16_t average_ipuclk_frequency;
1326 uint16_t average_fclk_frequency;
1327 uint16_t average_vclk_frequency;
1328 uint16_t average_uclk_frequency;
1329 uint16_t average_mpipu_frequency;
1331 /* Current clocks */
1332 /* target core frequency [MHz] */
1333 uint16_t current_coreclk[16];
1334 /* CCLK frequency limit enforced on classic cores [MHz] */
1335 uint16_t current_core_maxfreq;
1336 /* GFXCLK frequency limit enforced on GFX [MHz] */
1337 uint16_t current_gfx_maxfreq;
1339 /* Throttle Residency (ASIC dependent) */
1340 uint32_t throttle_residency_prochot;
1341 uint32_t throttle_residency_spl;
1342 uint32_t throttle_residency_fppt;
1343 uint32_t throttle_residency_sppt;
1344 uint32_t throttle_residency_thm_core;
1345 uint32_t throttle_residency_thm_gfx;
1346 uint32_t throttle_residency_thm_soc;
1348 /* Metrics table alpha filter time constant [us] */
1349 uint32_t time_filter_alphavalue;
1352 struct amdgpu_pmmetrics_header {
1353 uint16_t structure_size;
1355 uint32_t mp1_ip_discovery_version;
1356 uint32_t pmfw_version;
1357 uint32_t pmmetrics_version;
1360 struct amdgpu_pm_metrics {
1361 struct amdgpu_pmmetrics_header common_header;