Skip to contentSkip to conversation

drm: sti: add moduleparam to disable fbdev

PATCH In review Benjamin Gaignard 3 participants 3 messages Jul 8, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: sti: add moduleparam to disable fbdev

Useful to avoid recompiling to enable/disable fbdev.

---
 drivers/gpu/drm/sti/Kconfig       |  6 ------
 drivers/gpu/drm/sti/sti_drm_drv.c | 13 ++++++++-----
 2 files changed, 8 insertions(+), 11 deletions(-)
drivers/gpu/drm/sti/Kconfig +0 -6
index fbccc10..e3aa5af 100644
@@ -9,9 +9,3 @@ config DRM_STI
 	select FW_LOADER_USER_HELPER_FALLBACK
 	help
 	  Choose this option to enable DRM on STM stiH41x chipset
-
-config DRM_STI_FBDEV
-	bool "DRM frame buffer device for STMicroelectronics SoC stiH41x Serie"
-	depends on DRM_STI
-	help
-	  Choose this option to enable FBDEV on top of DRM for STM stiH41x chipset
drivers/gpu/drm/sti/sti_drm_drv.c +8 -5
index 59d558b..d0fb54a 100644
@@ -30,6 +30,10 @@
 #define STI_MAX_FB_HEIGHT	4096
 #define STI_MAX_FB_WIDTH	4096
 
+static bool fbdev;
+MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
+module_param(fbdev, bool, S_IRUGO | S_IWUSR);
+
 static void sti_drm_atomic_schedule(struct sti_drm_private *private,
 				  struct drm_atomic_state *state)
 {
@@ -160,11 +164,10 @@ static int sti_drm_load(struct drm_device *dev, unsigned long flags)
 
 	drm_mode_config_reset(dev);
 
-#ifdef CONFIG_DRM_STI_FBDEV
-	drm_fbdev_cma_init(dev, 32,
-		   dev->mode_config.num_crtc,
-		   dev->mode_config.num_connector);
-#endif
+	if (fbdev)
+		drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc,
+				   dev->mode_config.num_connector);
+
 	return 0;
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Benjamin Gaignard

Useful to avoid recompiling to enable/disable fbdev.

Bochs has the moduleparam for fbdev, lgtm.

Quoted 62 lines
---
 drivers/gpu/drm/sti/Kconfig       |  6 ------
 drivers/gpu/drm/sti/sti_drm_drv.c | 13 ++++++++-----
 2 files changed, 8 insertions(+), 11 deletions(-)
drivers/gpu/drm/sti/Kconfig +0 -3
index fbccc10..e3aa5af 100644
@@ -9,9 +9,3 @@ config DRM_STI
        select FW_LOADER_USER_HELPER_FALLBACK
        help
          Choose this option to enable DRM on STM stiH41x chipset
-
-config DRM_STI_FBDEV
-       bool "DRM frame buffer device for STMicroelectronics SoC stiH41x

Serie"

drivers/gpu/drm/sti/Kconfig +0 -3
-       depends on DRM_STI
-       help
-         Choose this option to enable FBDEV on top of DRM for STM stiH41x

chipset

drivers/gpu/drm/sti/sti_drm_drv.c +8 -6
index 59d558b..d0fb54a 100644
@@ -30,6 +30,10 @@
 #define STI_MAX_FB_HEIGHT      4096
 #define STI_MAX_FB_WIDTH       4096
 
+static bool fbdev;
+MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
+module_param(fbdev, bool, S_IRUGO | S_IWUSR);
+
 static void sti_drm_atomic_schedule(struct sti_drm_private *private,
                                  struct drm_atomic_state *state)
 {
@@ -160,11 +164,10 @@ static int sti_drm_load(struct drm_device *dev,
 unsigned long flags)
 
        drm_mode_config_reset(dev);
 
-#ifdef CONFIG_DRM_STI_FBDEV
-       drm_fbdev_cma_init(dev, 32,
-                  dev->mode_config.num_crtc,
-                  dev->mode_config.num_connector);
-#endif
+       if (fbdev)
+               drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc,
+                                  dev->mode_config.num_connector);
+
        return 0;
 }
 
--

1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 6 lines
Best regards
Junwang Zhao
Microprocessor Research and Develop Center
Department of Computer Science &Technology
Peking University
Beijing, 100871, PRC

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Benjamin Gaignard
Quoted 3 lines · Benjamin Gaignard

Useful to avoid recompiling to enable/disable fbdev.

Can we just do this in the fbdev helper instead of reinventing wheels in each driver? Archit Taneja has been looking into that.

Thanks, Daniel

Quoted 57 lines
---
 drivers/gpu/drm/sti/Kconfig       |  6 ------
 drivers/gpu/drm/sti/sti_drm_drv.c | 13 ++++++++-----
 2 files changed, 8 insertions(+), 11 deletions(-)
drivers/gpu/drm/sti/Kconfig +0 -6
index fbccc10..e3aa5af 100644
@@ -9,9 +9,3 @@ config DRM_STI
 	select FW_LOADER_USER_HELPER_FALLBACK
 	help
 	  Choose this option to enable DRM on STM stiH41x chipset
-
-config DRM_STI_FBDEV
-	bool "DRM frame buffer device for STMicroelectronics SoC stiH41x Serie"
-	depends on DRM_STI
-	help
-	  Choose this option to enable FBDEV on top of DRM for STM stiH41x chipset
drivers/gpu/drm/sti/sti_drm_drv.c +8 -5
index 59d558b..d0fb54a 100644
@@ -30,6 +30,10 @@
 #define STI_MAX_FB_HEIGHT	4096
 #define STI_MAX_FB_WIDTH	4096
 
+static bool fbdev;
+MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
+module_param(fbdev, bool, S_IRUGO | S_IWUSR);
+
 static void sti_drm_atomic_schedule(struct sti_drm_private *private,
 				  struct drm_atomic_state *state)
 {
@@ -160,11 +164,10 @@ static int sti_drm_load(struct drm_device *dev, unsigned long flags)
 
 	drm_mode_config_reset(dev);
 
-#ifdef CONFIG_DRM_STI_FBDEV
-	drm_fbdev_cma_init(dev, 32,
-		   dev->mode_config.num_crtc,
-		   dev->mode_config.num_connector);
-#endif
+	if (fbdev)
+		drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc,
+				   dev->mode_config.num_connector);
+
 	return 0;
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel