]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/gem: Add huge tmpfs mountpoint helpers
authorLoïc Molinari <loic.molinari@collabora.com>
Fri, 5 Dec 2025 18:22:25 +0000 (19:22 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Mon, 8 Dec 2025 09:52:47 +0000 (10:52 +0100)
commit6e0b1b82017b9ba16b87685e1e4902cd9dc762d2
treee04b38a930f53a11f991ae484e2a1f2d7aa01a01
parent99bda20d6d4cac30ed6d357658d8bc328c3b27d9
drm/gem: Add huge tmpfs mountpoint helpers

Add the drm_gem_huge_mnt_create() and drm_gem_get_huge_mnt() helpers
to avoid code duplication in the i915, V3D, Panfrost and Panthor
drivers. The former creates and mounts a dedicated huge tmpfs
mountpoint, for the lifetime of a DRM device, used at GEM object
initialization. The latter retrieves the dedicated huge tmpfs
mountpoint used by a DRM device.

The next commits will port drivers to these helpers.

v3:
- store huge tmpfs mountpoint in drm_device

v4:
- return 0 in builds with CONFIG_TRANSPARENT_HUGEPAGE=n
- return 0 when huge_mnt already exists
- use new vfs_parse_fs_string() helper

v5:
- remove warning on !dev->huge_mnt and reset to NULL on free
- inline drm_gem_huge_mnt_create() to remove func from text and avoid
  calls in builds with CONFIG_TRANSPARENT_HUGEPAGE=n
- compile out drm_device's huge_mnt field in builds with
  CONFIG_TRANSPARENT_HUGEPAGE=n
- add drm_gem_has_huge_mnt() helper

v6:
- move huge_mnt doc into ifdef'd section
- either inline or export drm_gem_huge_mnt_create()

v7:
- include <drm/drm_device.h> in drm_gem.h

v9:
- replace drm_gem_has_huge_mnt() by drm_gem_get_huge_mnt()

v11:
- doc fixes
- add Boris and Maíra R-bs

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Link: https://patch.msgid.link/20251205182231.194072-5-loic.molinari@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
drivers/gpu/drm/drm_gem.c
include/drm/drm_device.h
include/drm/drm_gem.h