@@ -344,7 +344,7 @@ static int smu_v13_0_6_tables_init(struct smu_context *smu)
344
344
return - ENOMEM ;
345
345
smu_table -> metrics_time = 0 ;
346
346
347
- smu_table -> gpu_metrics_table_size = sizeof (struct gpu_metrics_v1_4 );
347
+ smu_table -> gpu_metrics_table_size = sizeof (struct gpu_metrics_v1_5 );
348
348
smu_table -> gpu_metrics_table =
349
349
kzalloc (smu_table -> gpu_metrics_table_size , GFP_KERNEL );
350
350
if (!smu_table -> gpu_metrics_table ) {
@@ -2029,10 +2029,10 @@ static int smu_v13_0_6_get_current_pcie_link_speed(struct smu_context *smu)
2029
2029
static ssize_t smu_v13_0_6_get_gpu_metrics (struct smu_context * smu , void * * table )
2030
2030
{
2031
2031
struct smu_table_context * smu_table = & smu -> smu_table ;
2032
- struct gpu_metrics_v1_4 * gpu_metrics =
2033
- (struct gpu_metrics_v1_4 * )smu_table -> gpu_metrics_table ;
2032
+ struct gpu_metrics_v1_5 * gpu_metrics =
2033
+ (struct gpu_metrics_v1_5 * )smu_table -> gpu_metrics_table ;
2034
2034
struct amdgpu_device * adev = smu -> adev ;
2035
- int ret = 0 , xcc_id , inst , i ;
2035
+ int ret = 0 , xcc_id , inst , i , j ;
2036
2036
MetricsTableX_t * metrics_x ;
2037
2037
MetricsTableA_t * metrics_a ;
2038
2038
u16 link_width_level ;
@@ -2046,7 +2046,7 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
2046
2046
2047
2047
metrics_a = (MetricsTableA_t * )metrics_x ;
2048
2048
2049
- smu_cmn_init_soft_gpu_metrics (gpu_metrics , 1 , 4 );
2049
+ smu_cmn_init_soft_gpu_metrics (gpu_metrics , 1 , 5 );
2050
2050
2051
2051
gpu_metrics -> temperature_hotspot =
2052
2052
SMUQ10_ROUND (GET_METRIC_FIELD (MaxSocketTemperature ));
@@ -2113,6 +2113,10 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
2113
2113
metrics_x -> PCIenReplayAAcc ;
2114
2114
gpu_metrics -> pcie_replay_rover_count_acc =
2115
2115
metrics_x -> PCIenReplayARolloverCountAcc ;
2116
+ gpu_metrics -> pcie_nak_sent_count_acc =
2117
+ metrics_x -> PCIeNAKSentCountAcc ;
2118
+ gpu_metrics -> pcie_nak_rcvd_count_acc =
2119
+ metrics_x -> PCIeNAKReceivedCountAcc ;
2116
2120
}
2117
2121
2118
2122
gpu_metrics -> system_clock_counter = ktime_get_boottime_ns ();
@@ -2129,6 +2133,21 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
2129
2133
SMUQ10_ROUND (GET_METRIC_FIELD (XgmiWriteDataSizeAcc )[i ]);
2130
2134
}
2131
2135
2136
+ for (i = 0 ; i < adev -> jpeg .num_jpeg_inst ; ++ i ) {
2137
+ inst = GET_INST (JPEG , i );
2138
+ for (j = 0 ; j < adev -> jpeg .num_jpeg_rings ; ++ j ) {
2139
+ gpu_metrics -> jpeg_activity [(i * adev -> jpeg .num_jpeg_rings ) + j ] =
2140
+ SMUQ10_ROUND (GET_METRIC_FIELD (JpegBusy )
2141
+ [(inst * adev -> jpeg .num_jpeg_rings ) + j ]);
2142
+ }
2143
+ }
2144
+
2145
+ for (i = 0 ; i < adev -> vcn .num_vcn_inst ; ++ i ) {
2146
+ inst = GET_INST (VCN , i );
2147
+ gpu_metrics -> vcn_activity [i ] =
2148
+ SMUQ10_ROUND (GET_METRIC_FIELD (VcnBusy )[inst ]);
2149
+ }
2150
+
2132
2151
gpu_metrics -> xgmi_link_width = SMUQ10_ROUND (GET_METRIC_FIELD (XgmiWidth ));
2133
2152
gpu_metrics -> xgmi_link_speed = SMUQ10_ROUND (GET_METRIC_FIELD (XgmiBitrate ));
2134
2153
0 commit comments