drm: Add fdinfo memory stats
authorRob Clark <robdclark@chromium.org>
Wed, 24 May 2023 15:59:35 +0000 (08:59 -0700)
committerNeil Armstrong <neil.armstrong@linaro.org>
Wed, 24 May 2023 16:03:30 +0000 (18:03 +0200)
commit686b21b5f6ca2f8a716f9a4ade07246dbfb2713e
tree3f5eb4dbc807e993c1c7ca7873d3e5579b0dc95a
parent376c25f8ca47084c4f0aff0f14684780756ccef4
drm: Add fdinfo memory stats

Add support to dump GEM stats to fdinfo.

v2: Fix typos, change size units to match docs, use div_u64
v3: Do it in core
v4: more kerneldoc
v5: doc fixes
v6: Actually use u64, bit more comment docs

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524155956.382440-6-robdclark@gmail.com
Documentation/gpu/drm-usage-stats.rst
drivers/gpu/drm/drm_file.c
include/drm/drm_file.h
include/drm/drm_gem.h