drivers/gpu/drm/panfrost/panfrost_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Otherwise it would display the virtual allocation size, which is often
much bigger than the RSS.
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Fixes: e48ade5e23ba ("drm/panfrost: show device-wide list of DRM GEM objects over DebugFS")
---
drivers/gpu/drm/panfrost/panfrost_gem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
index bb73f2a68a12..da7613801ac0 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
@@ -432,7 +432,8 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo,
if (!refcount)
return;
- resident_size = bo->base.pages ? bo->base.base.size : 0;
+ resident_size = bo->base.pages ?
+ (bo->is_heap ? bo->heap_rss_size : bo->base.base.size) : 0;
snprintf(creator_info, sizeof(creator_info),
"%s/%d", bo->debugfs.creator.process_name, bo->debugfs.creator.tgid);
base-commit: 934452cbb16e1e3609ba52acb48c503b9aaf3154
--
2.50.0
Hi Adrián, On Thu, 31 Jul 2025 at 18:36, Adrián Larumbe <adrian.larumbe@collabora.com> wrote: > @@ -432,7 +432,8 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo, > if (!refcount) > return; > > - resident_size = bo->base.pages ? bo->base.base.size : 0; > + resident_size = bo->base.pages ? > + (bo->is_heap ? bo->heap_rss_size : bo->base.base.size) : 0; Just use panfrost_gem_rss() here, though you'll need to make it non-static. With that: Reviewed-by: Daniel Stone <daniels@collabora.com> Cheers, Daniel
On 06.08.2025 16:19, Daniel Stone wrote: Hi Adrián, On Thu, 31 Jul 2025 at 18:36, Adrián Larumbe > <adrian.larumbe@collabora.com> wrote: > > @@ -432,7 +432,8 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo, > > if (!refcount) > > return; > > > > - resident_size = bo->base.pages ? bo->base.base.size : 0; > > + resident_size = bo->base.pages ? > > + (bo->is_heap ? bo->heap_rss_size : bo->base.base.size) : 0; > > Just use panfrost_gem_rss() here, though you'll need to make it non-static. It's still within the same compilation unit (panfrost_gem.c) so it can remain static. > > With that: > Reviewed-by: Daniel Stone <daniels@collabora.com> > > Cheers, > Daniel Adrian Larumbe
© 2016 - 2025 Red Hat, Inc.