dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: sti: add moduleparam to disable fbdev
@ 2015-07-08 12:50 Benjamin Gaignard
  2015-07-08 13:24 ` John Hunter
  2015-07-08 15:01 ` Daniel Vetter
  0 siblings, 2 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2015-07-08 12:50 UTC (permalink / raw)
  To: dri-devel, airlied, vincent.abriou; +Cc: Benjamin Gaignard

Useful to avoid recompiling to enable/disable fbdev.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 drivers/gpu/drm/sti/Kconfig       |  6 ------
 drivers/gpu/drm/sti/sti_drm_drv.c | 13 ++++++++-----
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig
index fbccc10..e3aa5af 100644
--- a/drivers/gpu/drm/sti/Kconfig
+++ b/drivers/gpu/drm/sti/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/sti/sti_drm_drv.c b/drivers/gpu/drm/sti/sti_drm_drv.c
index 59d558b..d0fb54a 100644
--- a/drivers/gpu/drm/sti/sti_drm_drv.c
+++ b/drivers/gpu/drm/sti/sti_drm_drv.c
@@ -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
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: sti: add moduleparam to disable fbdev
  2015-07-08 12:50 [PATCH] drm: sti: add moduleparam to disable fbdev Benjamin Gaignard
@ 2015-07-08 13:24 ` John Hunter
  2015-07-08 15:01 ` Daniel Vetter
  1 sibling, 0 replies; 3+ messages in thread
From: John Hunter @ 2015-07-08 13:24 UTC (permalink / raw)
  To: Benjamin Gaignard; +Cc: dri-devel@lists.freedesktop.org


[-- Attachment #1.1: Type: text/plain, Size: 2494 bytes --]

On Wed, Jul 8, 2015 at 8:50 PM, Benjamin Gaignard <
benjamin.gaignard@linaro.org> wrote:

> Useful to avoid recompiling to enable/disable fbdev.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>

Reviewed-by: Zhao Junwang <zhjwpku@gmail.com>

Bochs has the moduleparam for fbdev, lgtm.


> ---
>  drivers/gpu/drm/sti/Kconfig       |  6 ------
>  drivers/gpu/drm/sti/sti_drm_drv.c | 13 ++++++++-----
>  2 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig
> index fbccc10..e3aa5af 100644
> --- a/drivers/gpu/drm/sti/Kconfig
> +++ b/drivers/gpu/drm/sti/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/sti/sti_drm_drv.c
> b/drivers/gpu/drm/sti/sti_drm_drv.c
> index 59d558b..d0fb54a 100644
> --- a/drivers/gpu/drm/sti/sti_drm_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drm_drv.c
> @@ -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
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>



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

[-- Attachment #1.2: Type: text/html, Size: 3780 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: sti: add moduleparam to disable fbdev
  2015-07-08 12:50 [PATCH] drm: sti: add moduleparam to disable fbdev Benjamin Gaignard
  2015-07-08 13:24 ` John Hunter
@ 2015-07-08 15:01 ` Daniel Vetter
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-07-08 15:01 UTC (permalink / raw)
  To: Benjamin Gaignard; +Cc: dri-devel

On Wed, Jul 08, 2015 at 02:50:25PM +0200, Benjamin Gaignard wrote:
> Useful to avoid recompiling to enable/disable fbdev.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

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

> ---
>  drivers/gpu/drm/sti/Kconfig       |  6 ------
>  drivers/gpu/drm/sti/sti_drm_drv.c | 13 ++++++++-----
>  2 files changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig
> index fbccc10..e3aa5af 100644
> --- a/drivers/gpu/drm/sti/Kconfig
> +++ b/drivers/gpu/drm/sti/Kconfig
> @@ -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
> diff --git a/drivers/gpu/drm/sti/sti_drm_drv.c b/drivers/gpu/drm/sti/sti_drm_drv.c
> index 59d558b..d0fb54a 100644
> --- a/drivers/gpu/drm/sti/sti_drm_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drm_drv.c
> @@ -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
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-08 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 12:50 [PATCH] drm: sti: add moduleparam to disable fbdev Benjamin Gaignard
2015-07-08 13:24 ` John Hunter
2015-07-08 15:01 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox