video: Support showing the U-Boot logo
Show the U-Boot logo by default. This is only 7KB in size so seems like
a useful default for boards that enable a display.
If SPLASH_SCREEN is enabled, it is not enabled by default, so as not to
conflict with that feature.
Also disable it for tests, since we don't want to complicate the output.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index a52b5d9..7d499bc 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -319,6 +319,24 @@
#endif
+#define SPLASH_DECL(_name) \
+ extern u8 __splash_ ## _name ## _begin[]; \
+ extern u8 __splash_ ## _name ## _end[]
+
+#define SPLASH_START(_name) __splash_ ## _name ## _begin
+
+SPLASH_DECL(u_boot_logo);
+
+static int show_splash(struct udevice *dev)
+{
+ u8 *data = SPLASH_START(u_boot_logo);
+ int ret;
+
+ ret = video_bmp_display(dev, map_to_sysmem(data), -4, 4, true);
+
+ return 0;
+}
+
/* Set up the display ready for use */
static int video_post_probe(struct udevice *dev)
{
@@ -384,6 +402,14 @@
return ret;
}
+ if (IS_ENABLED(CONFIG_VIDEO_LOGO) && !plat->hide_logo) {
+ ret = show_splash(dev);
+ if (ret) {
+ log_debug("Cannot show splash screen\n");
+ return ret;
+ }
+ }
+
return 0;
};