Re: [RFC 1/2] drm: Add fdinfo memory stats

2023-04-11 Thread Boris Brezillon
Hi Rob, On Thu, 6 Apr 2023 14:59:16 -0700 Rob Clark wrote: > From: Rob Clark > > Add a helper to dump memory stats to fdinfo. For the things the drm > core isn't aware of, use a callback. > > Signed-off-by: Rob Clark > --- > Documentation/gpu/drm-usage-stats.rst | 21 +++ > drivers/gp

Re: [RFC 1/2] drm: Add fdinfo memory stats

2023-04-10 Thread Rob Clark
On Sat, Apr 8, 2023 at 5:20 AM Emil Velikov wrote: > > Hey Rob, > > On Thu, 6 Apr 2023 at 22:59, Rob Clark wrote: > > > +- drm-purgeable-memory: [KiB|MiB] > > + > > +The total size of buffers that are purgable. > > s/purgable/purgeable/ > > > > +static void print_size(struct drm_printer *p, cons

Re: [RFC 1/2] drm: Add fdinfo memory stats

2023-04-08 Thread Emil Velikov
Hey Rob, On Thu, 6 Apr 2023 at 22:59, Rob Clark wrote: > +- drm-purgeable-memory: [KiB|MiB] > + > +The total size of buffers that are purgable. s/purgable/purgeable/ > +static void print_size(struct drm_printer *p, const char *stat, size_t sz) > +{ > + const char *units[] = {"B", "KiB"

[RFC 1/2] drm: Add fdinfo memory stats

2023-04-06 Thread Rob Clark
From: Rob Clark Add a helper to dump memory stats to fdinfo. For the things the drm core isn't aware of, use a callback. Signed-off-by: Rob Clark --- Documentation/gpu/drm-usage-stats.rst | 21 +++ drivers/gpu/drm/drm_file.c| 79 +++ include/drm/drm_fil