Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: update drm_show_memory_stats() for dma-bufs

Show buffers as shared if they are shared via dma-buf as well
(e.g., shared with v4l or some other subsystem).

v2: switch to gem helper

Link: https://lore.kernel.org/all/20231207180225.439482-1-alexander.deucher@amd.com/
Reviewed-by: Rob Clark <robdclark@gmail.com> (v1)
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.keonig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>

authored by

Alex Deucher and committed by
Christian König
d50ea100 b31f5eba

+1 -1
+1 -1
drivers/gpu/drm/drm_file.c
··· 913 913 DRM_GEM_OBJECT_PURGEABLE; 914 914 } 915 915 916 - if (obj->handle_count > 1) { 916 + if (drm_gem_object_is_shared_for_memory_stats(obj)) { 917 917 status.shared += obj->size; 918 918 } else { 919 919 status.private += obj->size;