diff mbox series

video: add opt out option for VIDEO_BBP selection

Message ID 20200203214810.32243-1-agust@denx.de
State New
Headers show
Series video: add opt out option for VIDEO_BBP selection | expand

Commit Message

Anatolij Gustschin Feb. 3, 2020, 9:48 p.m. UTC
Enable all BPP options by default to avoid empty video console
output (this was the case before commit 2cc393f32fd9 ("video: make
BPP and ANSI configs optional")). But also support optional selection
of only required VIDEO_BBP settings.

Signed-off-by: Anatolij Gustschin <agust at denx.de>
---
 drivers/video/Kconfig | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Tom Rini Feb. 4, 2020, 4:49 p.m. UTC | #1
On Mon, Feb 03, 2020 at 10:48:10PM +0100, Anatolij Gustschin wrote:

> Enable all BPP options by default to avoid empty video console
> output (this was the case before commit 2cc393f32fd9 ("video: make
> BPP and ANSI configs optional")). But also support optional selection
> of only required VIDEO_BBP settings.
> 
> Signed-off-by: Anatolij Gustschin <agust at denx.de>
> ---
>  drivers/video/Kconfig | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 50ab3650ee..62217fda08 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -35,9 +35,21 @@ config BACKLIGHT_GPIO
>  	  it understands the standard device tree
>  	  (leds/backlight/gpio-backlight.txt)
>  
> +config VIDEO_BPP_OPT_OUT
> +	bool "Support manual selection of video console BPP"
> +	depends on DM_VIDEO
> +	help
> +	  Enabling this option allows manual selection of the required
> +	  VIDEO_BPPxx configuration. By default all BPP options are
> +	  enabled to avoid empty console output. Some boards do not use
> +	  all BPP options and want to avoid dead code to reduce binary
> +	  image size. Let them opt out and select the needed BPP in the
> +	  board defconfig file.
> +
>  config VIDEO_BPP8
>  	bool "Support 8-bit-per-pixel displays"
>  	depends on DM_VIDEO
> +	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
>  	help
>  	  Support drawing text and bitmaps onto a 8-bit-per-pixel display.
>  	  Enabling this will include code to support this display. Without
> @@ -47,6 +59,7 @@ config VIDEO_BPP8
>  config VIDEO_BPP16
>  	bool "Support 16-bit-per-pixel displays"
>  	depends on DM_VIDEO
> +	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
>  	help
>  	  Support drawing text and bitmaps onto a 16-bit-per-pixel display.
>  	  Enabling this will include code to support this display. Without
> @@ -56,7 +69,7 @@ config VIDEO_BPP16
>  config VIDEO_BPP32
>  	bool "Support 32-bit-per-pixel displays"
>  	depends on DM_VIDEO
> -	default y if X86
> +	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
>  	help
>  	  Support drawing text and bitmaps onto a 32-bit-per-pixel display.
>  	  Enabling this will include code to support this display. Without

I think this is more complex than it needs to be, honestly.  The old
behavior was that all of these options were essentially "default y" but
it also wasn't possible to remove them (in some cases?).  Now that we
can let boards pick what they want, I think we should just go back to
the old behavior of in essence "default y" (and they already have
depends on DM_VIDEO).  Thanks!
Anatolij Gustschin Feb. 4, 2020, 5:19 p.m. UTC | #2
On Tue, 4 Feb 2020 11:49:59 -0500
Tom Rini trini at konsulko.com wrote:
...
> >  config VIDEO_BPP32
> >  	bool "Support 32-bit-per-pixel displays"
> >  	depends on DM_VIDEO
> > -	default y if X86
> > +	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
> >  	help
> >  	  Support drawing text and bitmaps onto a 32-bit-per-pixel display.
> >  	  Enabling this will include code to support this display. Without  
> 
> I think this is more complex than it needs to be, honestly.  The old
> behavior was that all of these options were essentially "default y" but
> it also wasn't possible to remove them (in some cases?).  Now that we
> can let boards pick what they want, I think we should just go back to
> the old behavior of in essence "default y" (and they already have
> depends on DM_VIDEO).  Thanks!

you mean we can go with
  default y if !VIDEO_BPP_OPT_OUT
?

--
Anatolij




Viele Grüße,

Anatolij Gustschin

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-50 Fax: +49-8142-66989-80  Email: agust at denx.de
Tom Rini Feb. 4, 2020, 6:08 p.m. UTC | #3
On Tue, Feb 04, 2020 at 06:19:39PM +0100, Anatolij Gustschin wrote:
> On Tue, 4 Feb 2020 11:49:59 -0500
> Tom Rini trini at konsulko.com wrote:
> ...
> > >  config VIDEO_BPP32
> > >  	bool "Support 32-bit-per-pixel displays"
> > >  	depends on DM_VIDEO
> > > -	default y if X86
> > > +	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
> > >  	help
> > >  	  Support drawing text and bitmaps onto a 32-bit-per-pixel display.
> > >  	  Enabling this will include code to support this display. Without  
> > 
> > I think this is more complex than it needs to be, honestly.  The old
> > behavior was that all of these options were essentially "default y" but
> > it also wasn't possible to remove them (in some cases?).  Now that we
> > can let boards pick what they want, I think we should just go back to
> > the old behavior of in essence "default y" (and they already have
> > depends on DM_VIDEO).  Thanks!
> 
> you mean we can go with
>   default y if !VIDEO_BPP_OPT_OUT

I mean we don't need VIDEO_BPP_OPT_OUT as a symbol.  All of the
VIDEO_BPPx options should just be default y and boards can disable as
desired.  Thanks!
diff mbox series

Patch

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 50ab3650ee..62217fda08 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -35,9 +35,21 @@  config BACKLIGHT_GPIO
 	  it understands the standard device tree
 	  (leds/backlight/gpio-backlight.txt)
 
+config VIDEO_BPP_OPT_OUT
+	bool "Support manual selection of video console BPP"
+	depends on DM_VIDEO
+	help
+	  Enabling this option allows manual selection of the required
+	  VIDEO_BPPxx configuration. By default all BPP options are
+	  enabled to avoid empty console output. Some boards do not use
+	  all BPP options and want to avoid dead code to reduce binary
+	  image size. Let them opt out and select the needed BPP in the
+	  board defconfig file.
+
 config VIDEO_BPP8
 	bool "Support 8-bit-per-pixel displays"
 	depends on DM_VIDEO
+	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
 	help
 	  Support drawing text and bitmaps onto a 8-bit-per-pixel display.
 	  Enabling this will include code to support this display. Without
@@ -47,6 +59,7 @@  config VIDEO_BPP8
 config VIDEO_BPP16
 	bool "Support 16-bit-per-pixel displays"
 	depends on DM_VIDEO
+	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
 	help
 	  Support drawing text and bitmaps onto a 16-bit-per-pixel display.
 	  Enabling this will include code to support this display. Without
@@ -56,7 +69,7 @@  config VIDEO_BPP16
 config VIDEO_BPP32
 	bool "Support 32-bit-per-pixel displays"
 	depends on DM_VIDEO
-	default y if X86
+	default y if DM_VIDEO && !VIDEO_BPP_OPT_OUT
 	help
 	  Support drawing text and bitmaps onto a 32-bit-per-pixel display.
 	  Enabling this will include code to support this display. Without