Skip to content

Commit 36ed2f9

Browse files
committed
drm/vc4: Add hvs_dlist_allocs debugfs function.
Users are reporting running out of DLIST memory. Add a debugfs file to dump out all the allocations. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 328c513 commit 36ed2f9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

drivers/gpu/drm/vc4/vc4_hvs.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,36 @@ static int vc5_hvs_debugfs_gamma(struct seq_file *m, void *data)
347347
return 0;
348348
}
349349

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+
350380
/* The filter kernel is composed of dwords each containing 3 9-bit
351381
* signed integers packed next to each other.
352382
*/
@@ -1602,6 +1632,11 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor)
16021632
if (ret)
16031633
return ret;
16041634

1635+
ret = vc4_debugfs_add_file(minor, "hvs_dlist_allocs",
1636+
vc4_hvs_debugfs_dlist_allocs, NULL);
1637+
if (ret)
1638+
return ret;
1639+
16051640
ret = vc4_debugfs_add_regset32(minor, "hvs_regs",
16061641
&hvs->regset);
16071642
if (ret)

0 commit comments

Comments
 (0)