drm: add drm_gem_object_is_shared_for_memory_stats() helper
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 12 Feb 2024 21:04:24 +0000 (16:04 -0500)
committerChristian König <christian.koenig@amd.com>
Fri, 16 Feb 2024 11:52:50 +0000 (12:52 +0100)
commitb31f5eba32ae8cc28e7cfa5a55ec8670d8c718e2
treef642b793e42727b0bb54fae444c6cb03ebd3fba0
parent77d17c4cd0bf52eacfad88e63e8932eb45d643c5
drm: add drm_gem_object_is_shared_for_memory_stats() helper

Add a helper so that drm drivers can consistently report
shared status via the fdinfo shared memory stats interface.

In addition to handle count, 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 inline function

Link: https://lore.kernel.org/all/20231207180225.439482-1-alexander.deucher@amd.com/
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1)
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>
include/drm/drm_gem.h