Skip to content

Commit

Permalink
drm/v3d: Add modparam for turning off Big/Super Pages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Maíra Canal committed Sep 25, 2024
1 parent 20d69e8 commit 0df4a13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/v3d/v3d_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
#define DRIVER_MINOR 0
#define DRIVER_PATCHLEVEL 0

/* Only expose the `super_pages` modparam if THP is enabled. */
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
bool super_pages = true;
module_param_named(super_pages, super_pages, bool, 0400);
MODULE_PARM_DESC(super_pages, "Enable/Disable Super Pages support.");
#endif

static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/v3d/v3d_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ void v3d_invalidate_caches(struct v3d_dev *v3d);
void v3d_clean_caches(struct v3d_dev *v3d);

/* v3d_gemfs.c */
extern bool super_pages;
void v3d_gemfs_init(struct v3d_dev *v3d);
void v3d_gemfs_fini(struct v3d_dev *v3d);

Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/v3d/v3d_gemfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ void v3d_gemfs_init(struct v3d_dev *v3d)
if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
goto err;

/* The user doesn't want to enable Super Pages */
if (!super_pages)
goto err;

type = get_fs_type("tmpfs");
if (!type)
goto err;
Expand Down

0 comments on commit 0df4a13

Please sign in to comment.