1 // SPDX-License-Identifier: GPL-2.0+
2 /* Copyright (C) 2024 Raspberry Pi */
5 #include <linux/mount.h>
9 void v3d_gemfs_init(struct v3d_dev *v3d)
11 char huge_opt[] = "huge=within_size";
12 struct file_system_type *type;
13 struct vfsmount *gemfs;
16 * By creating our own shmemfs mountpoint, we can pass in
17 * mount flags that better match our usecase. However, we
18 * only do so on platforms which benefit from it.
20 if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
23 /* The user doesn't want to enable Super Pages */
27 type = get_fs_type("tmpfs");
31 gemfs = vfs_kern_mount(type, SB_KERNMOUNT, type->name, huge_opt);
36 drm_info(&v3d->drm, "Using Transparent Hugepages\n");
43 "Transparent Hugepage support is recommended for optimal performance on this platform!\n");
46 void v3d_gemfs_fini(struct v3d_dev *v3d)
49 kern_unmount(v3d->gemfs);