Skip to contentSkip to conversation

video: add config option to skip framebuffer clear

PATCH New Rob Clark 3 participants 3 messages Jul 4, 2017 Framebuffer layer

lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/video/Kconfig        | 8 ++++++++
 drivers/video/cfb_console.c  | 2 ++
 drivers/video/video-uclass.c | 2 ++
 3 files changed, 12 insertions(+)
drivers/video/Kconfig +8 -0
index 8eb0359..ec29dba 100644
@@ -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
drivers/video/cfb_console.c +2 -0
index d75abb6..d8f71b3 100644
@@ -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 */
drivers/video/video-uclass.c +2 -0
index 3036e3a..035c180 100644
@@ -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
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/1 video: add config option to skip framebuffer clear

Dear Rob,

drivers/video/cfb_console.c static int cfg_video_init(void) · line 2096

Quoted 4 lines · In message <[email protected]> you wrote:
drivers/video/cfb_console.c +2 -0
+#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

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Unix: Some say the learning curve is steep,  but  you  only  have  to
climb it once.                                      - Karl Lehenbauer
#2 lore raw

PATCH 1/1 video: add config option to skip framebuffer clear

Quoted 4 lines · Wolfgang Denk

Dear Rob,

Quoted 1 line · In message <[email protected]> you wrote:
Quoted 8 lines

drivers/video/cfb_console.c static int cfg_video_init(void) · line 2096

Quoted 3 lines
drivers/video/cfb_console.c +2 -0
+#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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/d1593c48/attachment.sig>