Skip to content

Commit 502756e

Browse files
committed
drm/v3d: Show the memory-management stats on debugfs
Dump the contents of the DRM MM allocator of the V3D driver. This will help us to debug the VA ranges allocated. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Melissa Wen <mwen@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240105145851.193492-1-mcanal@igalia.com
1 parent b9bc054 commit 502756e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/gpu/drm/v3d/v3d_debugfs.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,26 @@ static int v3d_measure_clock(struct seq_file *m, void *unused)
260260
return 0;
261261
}
262262

263+
static int v3d_debugfs_mm(struct seq_file *m, void *unused)
264+
{
265+
struct drm_printer p = drm_seq_file_printer(m);
266+
struct drm_debugfs_entry *entry = m->private;
267+
struct drm_device *dev = entry->dev;
268+
struct v3d_dev *v3d = to_v3d_dev(dev);
269+
270+
spin_lock(&v3d->mm_lock);
271+
drm_mm_print(&v3d->mm, &p);
272+
spin_unlock(&v3d->mm_lock);
273+
274+
return 0;
275+
}
276+
263277
static const struct drm_debugfs_info v3d_debugfs_list[] = {
264278
{"v3d_ident", v3d_v3d_debugfs_ident, 0},
265279
{"v3d_regs", v3d_v3d_debugfs_regs, 0},
266280
{"measure_clock", v3d_measure_clock, 0},
267281
{"bo_stats", v3d_debugfs_bo_stats, 0},
282+
{"v3d_mm", v3d_debugfs_mm, 0},
268283
};
269284

270285
void

0 commit comments

Comments
 (0)