@@ -347,6 +347,36 @@ static int vc5_hvs_debugfs_gamma(struct seq_file *m, void *data)
347
347
return 0 ;
348
348
}
349
349
350
+ static int vc4_hvs_debugfs_dlist_allocs (struct seq_file * m , void * data )
351
+ {
352
+ struct drm_info_node * node = m -> private ;
353
+ struct drm_device * dev = node -> minor -> dev ;
354
+ struct vc4_dev * vc4 = to_vc4_dev (dev );
355
+ struct vc4_hvs * hvs = vc4 -> hvs ;
356
+ struct drm_printer p = drm_seq_file_printer (m );
357
+ struct vc4_hvs_dlist_allocation * cur , * next ;
358
+ struct drm_mm_node * mm_node ;
359
+ unsigned long flags ;
360
+
361
+ spin_lock_irqsave (& hvs -> mm_lock , flags );
362
+
363
+ drm_printf (& p , "Allocated nodes:\n" );
364
+ list_for_each_entry (mm_node , drm_mm_nodes (& hvs -> dlist_mm ), node_list ) {
365
+ drm_printf (& p , "node [%08llx + %08llx]\n" , mm_node -> start , mm_node -> size );
366
+ }
367
+
368
+ drm_printf (& p , "Stale nodes:\n" );
369
+ list_for_each_entry_safe (cur , next , & hvs -> stale_dlist_entries , node ) {
370
+ drm_printf (& p , "node [%08llx + %08llx] channel %u frcnt %u\n" ,
371
+ cur -> mm_node .start , cur -> mm_node .size , cur -> channel ,
372
+ cur -> target_frame_count );
373
+ }
374
+
375
+ spin_unlock_irqrestore (& hvs -> mm_lock , flags );
376
+
377
+ return 0 ;
378
+ }
379
+
350
380
/* The filter kernel is composed of dwords each containing 3 9-bit
351
381
* signed integers packed next to each other.
352
382
*/
@@ -1602,6 +1632,11 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor)
1602
1632
if (ret )
1603
1633
return ret ;
1604
1634
1635
+ ret = vc4_debugfs_add_file (minor , "hvs_dlist_allocs" ,
1636
+ vc4_hvs_debugfs_dlist_allocs , NULL );
1637
+ if (ret )
1638
+ return ret ;
1639
+
1605
1640
ret = vc4_debugfs_add_regset32 (minor , "hvs_regs" ,
1606
1641
& hvs -> regset );
1607
1642
if (ret )
0 commit comments