diff options
author | Simon Glass <sjg@chromium.org> | 2021-11-19 13:24:03 -0700 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2021-12-26 23:32:46 +0100 |
commit | 84e63abfff67b82253add1c05cfdd9700fada021 (patch) | |
tree | d01c1d08af4a6ccc48626c88f55d04e8d36d2393 /drivers | |
parent | 2c8ee30b9708f8d43b7d971568614d7a192ccf31 (diff) | |
download | u-boot-84e63abfff67b82253add1c05cfdd9700fada021.zip u-boot-84e63abfff67b82253add1c05cfdd9700fada021.tar.gz u-boot-84e63abfff67b82253add1c05cfdd9700fada021.tar.bz2 |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/Kconfig | 1 | ||||
-rw-r--r-- | drivers/video/Makefile | 3 | ||||
-rw-r--r-- | drivers/video/sandbox_sdl.c | 2 | ||||
-rw-r--r-- | drivers/video/u_boot_logo.bmp | bin | 0 -> 6932 bytes | |||
-rw-r--r-- | drivers/video/video-uclass.c | 26 |
5 files changed, 32 insertions, 0 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 7a73ecc..e601b47 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -17,6 +17,7 @@ config DM_VIDEO config VIDEO_LOGO bool "Show the U-Boot logo on the display" depends on DM_VIDEO + select VIDEO_BMP_RLE8 help This enables showing the U-Boot logo on the display when a video device is probed. It appears at the top right. The logo itself is at diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 8956b5f..4038395 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -17,6 +17,9 @@ obj-$(CONFIG_DM_VIDEO) += video_bmp.o obj-$(CONFIG_PANEL) += panel-uclass.o obj-$(CONFIG_DM_PANEL_HX8238D) += hx8238d.o obj-$(CONFIG_SIMPLE_PANEL) += simple_panel.o + +obj-$(CONFIG_VIDEO_LOGO) += u_boot_logo.o + endif obj-${CONFIG_EXYNOS_FB} += exynos/ diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index 2afe66f..9081c7d 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -82,12 +82,14 @@ static void set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp) int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp) { + struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev); int ret; if (device_active(dev)) return -EINVAL; sandbox_sdl_remove_display(); + uc_plat->hide_logo = true; set_bpp(dev, l2bpp); ret = device_probe(dev); diff --git a/drivers/video/u_boot_logo.bmp b/drivers/video/u_boot_logo.bmp Binary files differnew file mode 100644 index 0000000..47f1e9b --- /dev/null +++ b/drivers/video/u_boot_logo.bmp 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 @@ int video_sync_copy_all(struct udevice *dev) #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 @@ static int video_post_probe(struct udevice *dev) 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; }; |