@@ -43,6 +43,9 @@ struct a6xx_gpu_state {
43
43
int nr_cx_debugbus ;
44
44
45
45
struct msm_gpu_state_bo * gmu_log ;
46
+ struct msm_gpu_state_bo * gmu_hfi ;
47
+
48
+ s32 hfi_queue_history [2 ][HFI_HISTORY_SZ ];
46
49
47
50
struct list_head objs ;
48
51
};
@@ -822,6 +825,25 @@ static struct msm_gpu_state_bo *a6xx_snapshot_gmu_bo(
822
825
return snapshot ;
823
826
}
824
827
828
+ static void a6xx_snapshot_gmu_hfi_history (struct msm_gpu * gpu ,
829
+ struct a6xx_gpu_state * a6xx_state )
830
+ {
831
+ struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
832
+ struct a6xx_gpu * a6xx_gpu = to_a6xx_gpu (adreno_gpu );
833
+ struct a6xx_gmu * gmu = & a6xx_gpu -> gmu ;
834
+ unsigned i , j ;
835
+
836
+ BUILD_BUG_ON (ARRAY_SIZE (gmu -> queues ) != ARRAY_SIZE (a6xx_state -> hfi_queue_history ));
837
+
838
+ for (i = 0 ; i < ARRAY_SIZE (gmu -> queues ); i ++ ) {
839
+ struct a6xx_hfi_queue * queue = & gmu -> queues [i ];
840
+ for (j = 0 ; j < HFI_HISTORY_SZ ; j ++ ) {
841
+ unsigned idx = (j + queue -> history_idx ) % HFI_HISTORY_SZ ;
842
+ a6xx_state -> hfi_queue_history [i ][j ] = queue -> history [idx ];
843
+ }
844
+ }
845
+ }
846
+
825
847
#define A6XX_GBIF_REGLIST_SIZE 1
826
848
static void a6xx_get_registers (struct msm_gpu * gpu ,
827
849
struct a6xx_gpu_state * a6xx_state ,
@@ -960,6 +982,9 @@ struct msm_gpu_state *a6xx_gpu_state_get(struct msm_gpu *gpu)
960
982
a6xx_get_gmu_registers (gpu , a6xx_state );
961
983
962
984
a6xx_state -> gmu_log = a6xx_snapshot_gmu_bo (a6xx_state , & a6xx_gpu -> gmu .log );
985
+ a6xx_state -> gmu_hfi = a6xx_snapshot_gmu_bo (a6xx_state , & a6xx_gpu -> gmu .hfi );
986
+
987
+ a6xx_snapshot_gmu_hfi_history (gpu , a6xx_state );
963
988
964
989
/* If GX isn't on the rest of the data isn't going to be accessible */
965
990
if (!a6xx_gmu_gx_is_on (& a6xx_gpu -> gmu ))
@@ -1005,6 +1030,9 @@ static void a6xx_gpu_state_destroy(struct kref *kref)
1005
1030
if (a6xx_state -> gmu_log )
1006
1031
kvfree (a6xx_state -> gmu_log -> data );
1007
1032
1033
+ if (a6xx_state -> gmu_hfi )
1034
+ kvfree (a6xx_state -> gmu_hfi -> data );
1035
+
1008
1036
list_for_each_entry_safe (obj , tmp , & a6xx_state -> objs , node )
1009
1037
kfree (obj );
1010
1038
@@ -1223,11 +1251,29 @@ void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
1223
1251
struct msm_gpu_state_bo * gmu_log = a6xx_state -> gmu_log ;
1224
1252
1225
1253
drm_printf (p , " iova: 0x%016llx\n" , gmu_log -> iova );
1226
- drm_printf (p , " size: %d \n" , gmu_log -> size );
1254
+ drm_printf (p , " size: %zu \n" , gmu_log -> size );
1227
1255
adreno_show_object (p , & gmu_log -> data , gmu_log -> size ,
1228
1256
& gmu_log -> encoded );
1229
1257
}
1230
1258
1259
+ drm_puts (p , "gmu-hfi:\n" );
1260
+ if (a6xx_state -> gmu_hfi ) {
1261
+ struct msm_gpu_state_bo * gmu_hfi = a6xx_state -> gmu_hfi ;
1262
+ unsigned i , j ;
1263
+
1264
+ drm_printf (p , " iova: 0x%016llx\n" , gmu_hfi -> iova );
1265
+ drm_printf (p , " size: %zu\n" , gmu_hfi -> size );
1266
+ for (i = 0 ; i < ARRAY_SIZE (a6xx_state -> hfi_queue_history ); i ++ ) {
1267
+ drm_printf (p , " queue-history[%u]:" , i );
1268
+ for (j = 0 ; j < HFI_HISTORY_SZ ; j ++ ) {
1269
+ drm_printf (p , " %d" , a6xx_state -> hfi_queue_history [i ][j ]);
1270
+ }
1271
+ drm_printf (p , "\n" );
1272
+ }
1273
+ adreno_show_object (p , & gmu_hfi -> data , gmu_hfi -> size ,
1274
+ & gmu_hfi -> encoded );
1275
+ }
1276
+
1231
1277
drm_puts (p , "registers:\n" );
1232
1278
for (i = 0 ; i < a6xx_state -> nr_registers ; i ++ ) {
1233
1279
struct a6xx_gpu_state_obj * obj = & a6xx_state -> registers [i ];
0 commit comments