drm-memory-all: memory hold by this context. Not that all the memory is
not necessarily resident: heap BO size is counted even though only part
of the memory reserved for those BOs might be allocated.

drm-memory-resident: resident memory size. For normal BOs it's the same
as drm-memory-all, but for heap BOs, only the memory actually allocated
is counted.

drm-memory-purgeable: amount of memory that can be reclaimed by the
system (madvise(DONT_NEED)).

drm-memory-shared: amount of memory shared through dma-buf.

Signed-off-by: Boris Brezillon <boris.brezil...@collabora.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c 
b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 6ee43559fc14..05d5d480df2a 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -519,9 +519,16 @@ static void panfrost_show_fdinfo(struct seq_file *m, 
struct file *f)
 {
        struct drm_file *file = f->private_data;
        struct panfrost_file_priv *panfrost_priv = file->driver_priv;
+       struct panfrost_mmu_stats mmu_stats;
+
+       panfrost_mmu_get_stats(panfrost_priv->mmu, &mmu_stats);
 
        seq_printf(m, "drm-driver:\t%s\n", file->minor->dev->driver->name);
        seq_printf(m, "drm-client-id:\t%llu\n", 
panfrost_priv->sched_entity[0].fence_context);
+       seq_printf(m, "drm-memory-all:\t%llu KiB\n", mmu_stats.all >> 10);
+       seq_printf(m, "drm-memory-resident:\t%llu KiB\n", mmu_stats.resident >> 
10);
+       seq_printf(m, "drm-memory-purgeable:\t%llu KiB\n", mmu_stats.purgeable 
>> 10);
+       seq_printf(m, "drm-memory-shared:\t%llu KiB\n", mmu_stats.shared >> 10);
 }
 
 static const struct file_operations panfrost_drm_driver_fops = {
-- 
2.38.1

Reply via email to