Skip to content

Commit 562bb1c

Browse files
mairacanalpopcornmix
authored andcommitted
drm/v3d: Add modparam for turning off Big/Super Pages
Commit 0df4a13 upstream Add a modparam for turning off Big/Super Pages to make sure that if an user doesn't want Big/Super Pages enabled, it can disabled it by setting the modparam to false. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240923141348.2422499-11-mcanal@igalia.com
1 parent e416e1d commit 562bb1c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

drivers/gpu/drm/v3d/v3d_drv.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
#define DRIVER_MINOR 0
4141
#define DRIVER_PATCHLEVEL 0
4242

43+
/* Only expose the `super_pages` modparam if THP is enabled. */
44+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
45+
bool super_pages = true;
46+
module_param_named(super_pages, super_pages, bool, 0400);
47+
MODULE_PARM_DESC(super_pages, "Enable/Disable Super Pages support.");
48+
#endif
49+
4350
static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
4451
struct drm_file *file_priv)
4552
{

drivers/gpu/drm/v3d/v3d_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ void v3d_invalidate_caches(struct v3d_dev *v3d);
545545
void v3d_clean_caches(struct v3d_dev *v3d);
546546

547547
/* v3d_gemfs.c */
548+
extern bool super_pages;
548549
void v3d_gemfs_init(struct v3d_dev *v3d);
549550
void v3d_gemfs_fini(struct v3d_dev *v3d);
550551

drivers/gpu/drm/v3d/v3d_gemfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ void v3d_gemfs_init(struct v3d_dev *v3d)
2020
if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
2121
goto err;
2222

23+
/* The user doesn't want to enable Super Pages */
24+
if (!super_pages)
25+
goto err;
26+
2327
type = get_fs_type("tmpfs");
2428
if (!type)
2529
goto err;

0 commit comments

Comments
 (0)