[U-Boot] [PATCH] video: add config option to skip framebuffer clear

The use-case is that the thing that loaded u-boot already put a splash image on screen. And we want to preserve that until grub boot menu takes over.
Signed-off-by: Rob Clark robdclark@gmail.com --- drivers/video/Kconfig | 8 ++++++++ drivers/video/cfb_console.c | 2 ++ drivers/video/video-uclass.c | 2 ++ 3 files changed, 12 insertions(+)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 8eb0359..ec29dba 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -98,6 +98,14 @@ config SYS_WHITE_ON_BLACK better in low-light situations or to reduce eye strain in some cases.
+config SYS_NO_FB_CLEAR + bool "Skip framebuffer clear" + help + If firmware (whatever loads u-boot) has already put a splash image + on screen, you might want to preserve it until whatever u-boots + loads takes over the screen. This, for example, can be used to + keep splash image on screen until grub graphical boot menu starts. + source "drivers/video/fonts/Kconfig"
config VIDCONSOLE_AS_LCD diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index d75abb6..d8f71b3 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -2091,7 +2091,9 @@ static int cfg_video_init(void) } eorx = fgx ^ bgx;
+#ifndef CONFIG_SYS_NO_FB_CLEAR video_clear(); +#endif
#ifdef CONFIG_VIDEO_LOGO /* Plot the logo and get start point of console */ diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 3036e3a..035c180 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -199,7 +199,9 @@ static int video_post_probe(struct udevice *dev) #else priv->colour_bg = 0xffffff; #endif +#ifndef CONFIG_SYS_NO_FB_CLEAR video_clear(dev); +#endif
/* * Create a text console device. For now we always do this, although

Dear Rob,
In message 20170704131739.4399-1-robdclark@gmail.com you wrote:
+#ifndef CONFIG_SYS_NO_FB_CLEAR video_clear(); +#endif
This should be CONFIG_NO_FB_CLEAR. CONFIG_SYS_ should only be used for settings that are not optional, i. e. that are mandatory due to hardware properties or such. In this case it is a decision of the user whether he wants to clear the FB or not, thus no _SYS.
Thanks.
Best regards,
Wolfgang Denk

On Tue, Jul 04, 2017 at 05:26:05PM +0200, Wolfgang Denk wrote:
Dear Rob,
In message 20170704131739.4399-1-robdclark@gmail.com you wrote:
+#ifndef CONFIG_SYS_NO_FB_CLEAR video_clear(); +#endif
This should be CONFIG_NO_FB_CLEAR. CONFIG_SYS_ should only be used for settings that are not optional, i. e. that are mandatory due to hardware properties or such. In this case it is a decision of the user whether he wants to clear the FB or not, thus no _SYS.
Also, we want to avoid #ifndef CONFIG_NO..., so please re-work the logic (and make the new option default y). Thanks!
participants (3)
-
Rob Clark
-
Tom Rini
-
Wolfgang Denk