From c4c96d1417fdb5559b45f5fefa90520c0d29a095 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 15 Feb 2024 14:24:15 +0100 Subject: drm: Spelling s/hardward/hardware/g Fix misspellings of "hardware". Signed-off-by: Geert Uytterhoeven Reviewed-by: Neil Armstrong Reviewed-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/94c9b76ee906d1b790dfcc435f4221b1197df586.1708003402.git.geert+renesas@glider.be --- include/drm/drm_bridge.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/drm') diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 7293c02e17c5..3606e1a7f965 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -107,7 +107,7 @@ struct drm_bridge_funcs { * Since this function is both called from the check phase of an atomic * commit, and the mode validation in the probe paths it is not allowed * to look at anything else but the passed-in mode, and validate it - * against configuration-invariant hardward constraints. Any further + * against configuration-invariant hardware constraints. Any further * limits which depend upon the configuration can only be checked in * @mode_fixup. * -- cgit From b31f5eba32ae8cc28e7cfa5a55ec8670d8c718e2 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 Feb 2024 16:04:24 -0500 Subject: drm: add drm_gem_object_is_shared_for_memory_stats() helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (v1) Signed-off-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Christian König --- include/drm/drm_gem.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/drm') diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 369505447acd..2ebec3984cd4 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -553,6 +553,19 @@ unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, int drm_gem_evict(struct drm_gem_object *obj); +/** + * drm_gem_object_is_shared_for_memory_stats - helper for shared memory stats + * + * This helper should only be used for fdinfo shared memory stats to determine + * if a GEM object is shared. + * + * @obj: obj in question + */ +static inline bool drm_gem_object_is_shared_for_memory_stats(struct drm_gem_object *obj) +{ + return (obj->handle_count > 1) || obj->dma_buf; +} + #ifdef CONFIG_LOCKDEP /** * drm_gem_gpuva_set_lock() - Set the lock protecting accesses to the gpuva list. -- cgit