diff options
| author | Adrián Larumbe <adrian.larumbe@collabora.com> | 2025-01-30 17:28:10 +0000 |
|---|---|---|
| committer | Boris Brezillon <boris.brezillon@collabora.com> | 2025-02-07 15:23:36 +0100 |
| commit | af6c2b7c46e16701fba44a21326cb634786e3e71 (patch) | |
| tree | e019bc28ba1384fa378258c3805dc5339b29e6eb /include/drm | |
| parent | Documentation/gpu: Clarify format of driver-specific fidnfo keys (diff) | |
| download | linux-af6c2b7c46e16701fba44a21326cb634786e3e71.tar.gz linux-af6c2b7c46e16701fba44a21326cb634786e3e71.zip | |
drm/file: Add fdinfo helper for printing regions with prefix
This is motivated by the desire of some drivers (eg. Panthor) to print the
size of internal memory regions with a prefix that reflects the driver
name, as suggested in the previous documentation commit.
That means adding a new argument to print_size and making it available for
DRM users.
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250130172851.941597-3-adrian.larumbe@collabora.com
Diffstat (limited to 'include/drm')
| -rw-r--r-- | include/drm/drm_file.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index ef817926cddd..94d365b22505 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -495,6 +495,11 @@ struct drm_memory_stats { enum drm_gem_object_status; int drm_memory_stats_is_zero(const struct drm_memory_stats *stats); +void drm_fdinfo_print_size(struct drm_printer *p, + const char *prefix, + const char *stat, + const char *region, + u64 sz); void drm_print_memory_stats(struct drm_printer *p, const struct drm_memory_stats *stats, enum drm_gem_object_status supported_status, |
