diff mbox series

[v2,6/8] drm/msm: Move module parameter 'fbdev' to fbdev code

Message ID 20230403124538.8497-7-tzimmermann@suse.de (mailing list archive)
State Not Applicable
Headers show
Series drm/msm: Convert fbdev to DRM client | expand

Commit Message

Thomas Zimmermann April 3, 2023, 12:45 p.m. UTC
Define the module's parameter 'fbdev' in fbdev code. No other code
uses it. No functional changes, but simplifies the later conversion
to struct drm_client.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/msm/msm_drv.c   | 10 ++--------
 drivers/gpu/drm/msm/msm_fbdev.c |  7 +++++++
 2 files changed, 9 insertions(+), 8 deletions(-)

Comments

Dmitry Baryshkov April 4, 2023, 9:44 p.m. UTC | #1
On 03/04/2023 15:45, Thomas Zimmermann wrote:
> Define the module's parameter 'fbdev' in fbdev code. No other code
> uses it. No functional changes, but simplifies the later conversion
> to struct drm_client.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/msm/msm_drv.c   | 10 ++--------
>   drivers/gpu/drm/msm/msm_fbdev.c |  7 +++++++
>   2 files changed, 9 insertions(+), 8 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 14f4bc33b50b..4bf486f0ebb9 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -63,12 +63,6 @@  static const struct drm_mode_config_helper_funcs mode_config_helper_funcs = {
 	.atomic_commit_tail = msm_atomic_commit_tail,
 };
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-static bool fbdev = true;
-MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
-module_param(fbdev, bool, 0600);
-#endif
-
 static char *vram = "16m";
 MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)");
 module_param(vram, charp, 0);
@@ -242,7 +236,7 @@  static int msm_drm_uninit(struct device *dev)
 	msm_rd_debugfs_cleanup(priv);
 
 #ifdef CONFIG_DRM_FBDEV_EMULATION
-	if (fbdev && ddev->fb_helper)
+	if (ddev->fb_helper)
 		msm_fbdev_free(ddev);
 #endif
 
@@ -536,7 +530,7 @@  static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
 	drm_mode_config_reset(ddev);
 
 #ifdef CONFIG_DRM_FBDEV_EMULATION
-	if (kms && fbdev)
+	if (kms)
 		msm_fbdev_init(ddev);
 #endif
 
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index 0bd0cb85c538..7d205632b165 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -14,6 +14,10 @@ 
 #include "msm_gem.h"
 #include "msm_kms.h"
 
+static bool fbdev = true;
+MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
+module_param(fbdev, bool, 0600);
+
 /*
  * fbdev funcs, to implement legacy fbdev interface on top of drm driver
  */
@@ -125,6 +129,9 @@  struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
 	struct drm_fb_helper *helper;
 	int ret;
 
+	if (!fbdev)
+		return NULL;
+
 	helper = kzalloc(sizeof(*helper), GFP_KERNEL);
 	if (!helper)
 		return NULL;