Skip to contentSkip to conversation

video: Support a U-Boot logo more easily

PATCH In review Simon Glass 8 participants 41 messages Nov 19, 2021 – Mar 28, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover video: Support a U-Boot logo more easily

At present it is possible to show a logo on the display but it requires some board configuration and an image.

This series aims to make this easier, by showing a logo automatically if there is a display but no splash screen.

The logo is embedded in U-Boot and takes approximately 7KB of space.

Some fixes to the sandbox display support are provided, to make it more robust and to allow running tests with different display depths. Support for 8bpp depths is added, to enable more tests.

This series also includes a lot of improvements to BMP (Windows Bitmap) support:

- support for drawing to depths other than 16bpp
- tests for the different types of supported BMP images

For theadorable there is a potentially breaking change to consider.

This series also enables a logo to be shown when running coreboot via qemu, providing a script to help with that.

Simon Glass (23):
sandbox: video: Support 8bpp depth
video: sandbox: Avoid duplicate display windows
console: Avoid serial output before the console is running
video: sandbox: Set a maximum frame-buffer size
sandbox: video: Correct the address of the copy base
sandbox: video: Add BMP tests for 32bpp and 8bpp modes
video: Expand video debugging buffer size
sandbox: Enable support for the gzip command
video: Drop fb_put_byte() el at
video: Move BMP pixel-writing into a function
video: bmp: Update RLE8 support to use the write function
video: Drop the uclass colour map
video: Tidy up 24/32 BMP blitting
video: Add a test for 16bpp BMP files
video: theadorable: Use RGB565 for BMP blitting
video: Drop #ifdefs from video_bmp
video: Convert CONFIG_VIDEO_LOGO to Kconfig
video: Drop VIDEO_LOGO from cfb_console
video: Support showing the U-Boot logo
video: Show the U-Boot logo by default
video: Support virtio devices with the splash screen
x86: coreboot: Support getting a logo from virtio
x86: coreboot: Add a sample script to build a qemu image

 .gitattributes                         |   1 +
 README                                 |   1 -
 arch/sandbox/cpu/sdl.c                 |  98 +++++++-
 arch/sandbox/include/asm/sdl.h         |   7 +
 arch/sandbox/include/asm/test.h        |  18 ++
 board/coreboot/coreboot/coreboot.c     |  20 +-
 cmd/unzip.c                            |   4 +-
 common/console.c                       |   6 +-
 common/splash.c                        |   2 +-
 common/splash_source.c                 |  14 ++
 configs/apalis_imx6_defconfig          |   1 +
 configs/aristainetos2c_defconfig       |   1 +
 configs/aristainetos2ccslb_defconfig   |   1 +
 configs/cm_fx6_defconfig               |   1 +
 configs/colibri-imx6ull-emmc_defconfig |   1 +
 configs/colibri-imx6ull_defconfig      |   1 +
 configs/colibri_imx6_defconfig         |   1 +
 configs/colibri_imx7_defconfig         |   1 +
 configs/colibri_imx7_emmc_defconfig    |   1 +
 configs/colibri_vf_defconfig           |   1 +
 configs/gurnard_defconfig              |   1 +
 configs/gwventana_emmc_defconfig       |   1 +
 configs/gwventana_gw5904_defconfig     |   1 +
 configs/gwventana_nand_defconfig       |   1 +
 configs/imx6dl_icore_nand_defconfig    |   1 +
 configs/imx6q_icore_nand_defconfig     |   1 +
 configs/imx6qdl_icore_mmc_defconfig    |   1 +
 configs/imx6qdl_icore_nand_defconfig   |   1 +
 configs/imxrt1050-evk_defconfig        |   1 +
 configs/m53menlo_defconfig             |   1 +
 configs/marsboard_defconfig            |   1 +
 configs/mx6cuboxi_defconfig            |   1 +
 configs/mx6sabreauto_defconfig         |   1 +
 configs/mx6sabresd_defconfig           |   1 +
 configs/mx6ul_14x14_evk_defconfig      |   1 +
 configs/mx6ul_9x9_evk_defconfig        |   1 +
 configs/novena_defconfig               |   1 +
 configs/opos6uldev_defconfig           |   1 +
 configs/pico-dwarf-imx7d_defconfig     |   1 +
 configs/pico-hobbit-imx7d_defconfig    |   1 +
 configs/pico-imx6_defconfig            |   1 +
 configs/pico-imx6ul_defconfig          |   1 +
 configs/pico-imx7d_bl33_defconfig      |   1 +
 configs/pico-imx7d_defconfig           |   1 +
 configs/pico-nymph-imx7d_defconfig     |   1 +
 configs/pico-pi-imx7d_defconfig        |   1 +
 configs/riotboard_defconfig            |   1 +
 configs/s5p4418_nanopi2_defconfig      |   1 +
 configs/sandbox_defconfig              |   2 +
 configs/sandbox_flattree_defconfig     |   2 +
 configs/tbs2910_defconfig              |   1 +
 configs/wandboard_defconfig            |   1 +
 drivers/video/Kconfig                  |  11 +
 drivers/video/Makefile                 |   3 +
 drivers/video/cfb_console.c            | 325 +------------------------
 drivers/video/console_truetype.c       |  21 ++
 drivers/video/sandbox_sdl.c            |  77 +++++-
 drivers/video/u_boot_logo.bmp          | Bin 0 -> 6932 bytes
 drivers/video/video-uclass.c           |  35 +--
 drivers/video/video_bmp.c              | 249 +++++++++----------
 include/configs/T102xRDB.h             |   1 -
 include/configs/T104xRDB.h             |   1 -
 include/configs/apalis_imx6.h          |   1 -
 include/configs/aristainetos2.h        |   1 -
 include/configs/cm_fx6.h               |   1 -
 include/configs/colibri-imx6ull.h      |   1 -
 include/configs/colibri_imx6.h         |   1 -
 include/configs/colibri_imx7.h         |   1 -
 include/configs/colibri_vf.h           |   1 -
 include/configs/coreboot.h             |   3 +
 include/configs/embestmx6boards.h      |   1 -
 include/configs/gw_ventana.h           |   1 -
 include/configs/imx6-engicam.h         |   1 -
 include/configs/imxrt1050-evk.h        |   1 -
 include/configs/ls1021aqds.h           |   1 -
 include/configs/ls1021atwr.h           |   1 -
 include/configs/m53menlo.h             |   1 -
 include/configs/mx23evk.h              |   1 -
 include/configs/mx28evk.h              |   1 -
 include/configs/mx51evk.h              |   1 -
 include/configs/mx53loco.h             |   1 -
 include/configs/mx6cuboxi.h            |   1 -
 include/configs/mx6sabre_common.h      |   1 -
 include/configs/mx6sxsabresd.h         |   1 -
 include/configs/mx6ul_14x14_evk.h      |   1 -
 include/configs/mx7dsabresd.h          |   1 -
 include/configs/nokia_rx51.h           |   1 -
 include/configs/novena.h               |   1 -
 include/configs/opos6uldev.h           |   1 -
 include/configs/pico-imx6.h            |   1 -
 include/configs/pico-imx6ul.h          |   1 -
 include/configs/pico-imx7d.h           |   1 -
 include/configs/pxm2.h                 |   1 -
 include/configs/rut.h                  |   1 -
 include/configs/s5p4418_nanopi2.h      |   2 -
 include/configs/wandboard.h            |   1 -
 include/configs/x86-common.h           |   6 +-
 include/splash.h                       |   1 +
 include/video.h                        |   4 +-
 include/virtio.h                       |   1 +
 scripts/Makefile.lib                   |  21 ++
 scripts/build-cb.sh                    |  19 ++
 scripts/config_whitelist.txt           |   1 -
 test/dm/video.c                        | 189 +++++++++++++-
 tools/logos/denx-16bpp.bmp.gz          | Bin 0 -> 4516 bytes
 tools/logos/denx-24bpp.bmp.gz          | Bin 0 -> 7137 bytes
 106 files changed, 678 insertions(+), 539 deletions(-)
 create mode 100644 drivers/video/u_boot_logo.bmp
 create mode 100755 scripts/build-cb.sh
 create mode 100644 tools/logos/denx-16bpp.bmp.gz
 create mode 100644 tools/logos/denx-24bpp.bmp.gz
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#1 lore raw

PATCH 1/23 sandbox: video: Support 8bpp depth

At present sandbox only supports 16 and 32bpp depths, since those are the easy ones with SDL.

We can support other depths by manually converting the pixel formats. Add support for this, to enable an 8ppp (monochrome) format.

---

 arch/sandbox/cpu/sdl.c      | 65 ++++++++++++++++++++++++++++++++++---
 drivers/video/sandbox_sdl.c | 23 +++++++++----
 2 files changed, 77 insertions(+), 11 deletions(-)
arch/sandbox/cpu/sdl.c +60 -5
index bef5abd039d..7ff0df2ee54 100644
@@ -44,6 +44,8 @@ struct buf_info {
  * @stopping: true if audio will stop once it runs out of data
  * @texture: SDL texture to use for U-Boot display contents
  * @renderer: SDL renderer to use
+ * @src_depth: Number of bits per pixel in the source frame buffer (that we read
+ * from and render to SDL)
  */
 static struct sdl_info {
 	int width;
@@ -61,6 +63,7 @@ static struct sdl_info {
 	bool stopping;
 	SDL_Texture *texture;
 	SDL_Renderer *renderer;
+	int src_depth;
 } sdl;
 
 static void sandbox_sdl_poll_events(void)
@@ -126,6 +129,9 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 	if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"))
 		printf("Unable to init hinting: %s", SDL_GetError());
 
+	sdl.src_depth = 1 << log2_bpp;
+	if (log2_bpp != 4 && log2_bpp != 5)
+		log2_bpp = 5;
 	sdl.depth = 1 << log2_bpp;
 	sdl.pitch = sdl.width * sdl.depth / 8;
 	SDL_Window *screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
@@ -137,10 +143,6 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 		       SDL_GetError());
 		return -EIO;
 	}
-	if (log2_bpp != 4 && log2_bpp != 5) {
-		printf("U-Boot SDL does not support depth %d\n", log2_bpp);
-		return -EINVAL;
-	}
 	sdl.renderer = SDL_CreateRenderer(screen, -1,
 					  SDL_RENDERER_ACCELERATED |
 					  SDL_RENDERER_PRESENTVSYNC);
@@ -165,6 +167,55 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 	return 0;
 }
 
+static int copy_to_texture(void *lcd_base)
+{
+	char *dest;
+	int pitch, x, y;
+	int src_pitch;
+	void *pixels;
+	char *src;
+	int ret;
+
+	if (sdl.src_depth == sdl.depth) {
+		SDL_UpdateTexture(sdl.texture, NULL, lcd_base, sdl.pitch);
+		return 0;
+	}
+
+	/*
+	 * We only support copying from an 8bpp to a 32bpp texture since the
+	 * other cases are supported directly by the texture.
+	 */
+	if (sdl.depth != 32 && sdl.src_depth != 8) {
+		printf("Need depth 32bpp for copy\n");
+		return -EINVAL;
+	}
+
+	ret = SDL_LockTexture(sdl.texture, NULL, &pixels, &pitch);
+	if (ret) {
+		printf("SDL lock %d: %s\n", ret, SDL_GetError());
+		return ret;
+	}
+
+	/* Copy the pixels one by one */
+	src_pitch = sdl.width * sdl.src_depth / 8;
+	for (y = 0; y < sdl.height; y++) {
+		char val;
+
+		dest = pixels + y * pitch;
+		src = lcd_base + src_pitch * y;
+		for (x = 0; x < sdl.width; x++, dest += 4) {
+			val = *src++;
+			dest[0] = val;
+			dest[1] = val;
+			dest[2] = val;
+			dest[3] = 0;
+		}
+	}
+	SDL_UnlockTexture(sdl.texture);
+
+	return 0;
+}
+
 int sandbox_sdl_sync(void *lcd_base)
 {
 	struct SDL_Rect rect;
@@ -173,7 +224,11 @@ int sandbox_sdl_sync(void *lcd_base)
 	if (!sdl.texture)
 		return 0;
 	SDL_RenderClear(sdl.renderer);
-	SDL_UpdateTexture(sdl.texture, NULL, lcd_base, sdl.pitch);
+	ret = copy_to_texture(lcd_base);
+	if (ret) {
+		printf("copy_to_texture: %d: %s\n", ret, SDL_GetError());
+		return -EIO;
+	}
 	ret = SDL_RenderCopy(sdl.renderer, sdl.texture, NULL, NULL);
 	if (ret) {
 		printf("SDL copy %d: %s\n", ret, SDL_GetError());
drivers/video/sandbox_sdl.c +17 -6
index 5956b59ce49..32739de4feb 100644
@@ -48,22 +48,33 @@ static int sandbox_sdl_probe(struct udevice *dev)
 	return 0;
 }
 
-static int sandbox_sdl_bind(struct udevice *dev)
+static void set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp)
 {
 	struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
 	struct sandbox_sdl_plat *plat = dev_get_plat(dev);
-	int ret = 0;
 
-	plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH);
-	plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT);
-	plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16);
-	plat->rot = dev_read_u32_default(dev, "rotate", 0);
+	plat->bpix = l2bpp;
+
 	uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8;
 
 	/* Allow space for two buffers, the lower one being the copy buffer */
 	log_debug("Frame buffer size %x\n", uc_plat->size);
 	if (IS_ENABLED(CONFIG_VIDEO_COPY))
 		uc_plat->size *= 2;
+}
+
+static int sandbox_sdl_bind(struct udevice *dev)
+{
+	struct sandbox_sdl_plat *plat = dev_get_plat(dev);
+	enum video_log2_bpp l2bpp;
+	int ret = 0;
+
+	plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH);
+	plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT);
+	l2bpp = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16);
+	plat->rot = dev_read_u32_default(dev, "rotate", 0);
+
+	set_bpp(dev, l2bpp);
 
 	return ret;
 }
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#2 lore raw

PATCH 2/23 video: sandbox: Avoid duplicate display windows

In reply to Simon Glass

When unit tests are run they currently create a new window. Update the code so that the old one is removed first. This avoids the confusion as to which one is active.

---

 arch/sandbox/cpu/sdl.c         | 33 +++++++++++++++++++++++++++------
 arch/sandbox/include/asm/sdl.h |  7 +++++++
 drivers/video/sandbox_sdl.c    | 15 +++++++++++++++
 3 files changed, 49 insertions(+), 6 deletions(-)
arch/sandbox/cpu/sdl.c +27 -6
index 7ff0df2ee54..f4ca36b35c8 100644
@@ -44,6 +44,7 @@ struct buf_info {
  * @stopping: true if audio will stop once it runs out of data
  * @texture: SDL texture to use for U-Boot display contents
  * @renderer: SDL renderer to use
+ * @screen: SDL window to use
  * @src_depth: Number of bits per pixel in the source frame buffer (that we read
  * from and render to SDL)
  */
@@ -63,6 +64,7 @@ static struct sdl_info {
 	bool stopping;
 	SDL_Texture *texture;
 	SDL_Renderer *renderer;
+	SDL_Window *screen;
 	int src_depth;
 } sdl;
 
@@ -101,6 +103,23 @@ static int sandbox_sdl_ensure_init(void)
 	return 0;
 }
 
+int sandbox_sdl_remove_display(void)
+{
+	if (!sdl.renderer) {
+		printf("SDL renderer does not exist\n");
+		return -ENOENT;
+	}
+
+	SDL_DestroyTexture(sdl.texture);
+	SDL_DestroyRenderer(sdl.renderer);
+	SDL_DestroyWindow(sdl.screen);
+	sdl.texture = NULL;
+	sdl.renderer = NULL;
+	sdl.screen = NULL;
+
+	return 0;
+}
+
 int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 			     bool double_size)
 {
@@ -112,6 +131,9 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 	err = sandbox_sdl_ensure_init();
 	if (err)
 		return err;
+	if (sdl.renderer)
+		sandbox_sdl_remove_display();
+
 	if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) {
 		printf("Unable to initialise SDL LCD: %s\n", SDL_GetError());
 		return -EPERM;
@@ -134,16 +156,15 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 		log2_bpp = 5;
 	sdl.depth = 1 << log2_bpp;
 	sdl.pitch = sdl.width * sdl.depth / 8;
-	SDL_Window *screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
-					      SDL_WINDOWPOS_UNDEFINED,
-					      sdl.vis_width, sdl.vis_height,
-					      SDL_WINDOW_RESIZABLE);
-	if (!screen) {
+	sdl.screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
+				      SDL_WINDOWPOS_UNDEFINED, sdl.vis_width,
+				      sdl.vis_height, SDL_WINDOW_RESIZABLE);
+	if (!sdl.screen) {
 		printf("Unable to initialise SDL screen: %s\n",
 		       SDL_GetError());
 		return -EIO;
 	}
-	sdl.renderer = SDL_CreateRenderer(screen, -1,
+	sdl.renderer = SDL_CreateRenderer(sdl.screen, -1,
 					  SDL_RENDERER_ACCELERATED |
 					  SDL_RENDERER_PRESENTVSYNC);
 	if (!sdl.renderer) {
arch/sandbox/include/asm/sdl.h +7 -0
index 47fc4889d20..25dbdb59442 100644
@@ -25,6 +25,13 @@
 int sandbox_sdl_init_display(int width, int height, int log2_bpp,
 			     bool double_size);
 
+/**
+ * sandbox_sdl_remove_display() - Remove the SDL screen
+ *
+ * @return 0 if OK, -ENOENT if the SDL had not been inited.
+ */
+int sandbox_sdl_remove_display(void);
+
 /**
  * sandbox_sdl_sync() - Sync current U-Boot LCD frame buffer to SDL
  *
drivers/video/sandbox_sdl.c +15 -0
index 32739de4feb..6e430b28244 100644
@@ -63,6 +63,20 @@ static void set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp)
 		uc_plat->size *= 2;
 }
 
+static int sandbox_sdl_remove(struct udevice *dev)
+{
+	/*
+	 * Removing the display it a bit annoying when running unit tests, since
+	 * they remove all devices. It is nice to be able to see what the test
+	 * wrote onto the display. So this comment is just here to show how to
+	 * do it, if we want to make it optional one day.
+	 *
+	 * sandbox_sdl_remove_display();
+	 */
+
+	return 0;
+}
+
 static int sandbox_sdl_bind(struct udevice *dev)
 {
 	struct sandbox_sdl_plat *plat = dev_get_plat(dev);
@@ -90,5 +104,6 @@ U_BOOT_DRIVER(sandbox_lcd_sdl) = {
 	.of_match = sandbox_sdl_ids,
 	.bind	= sandbox_sdl_bind,
 	.probe	= sandbox_sdl_probe,
+	.remove	= sandbox_sdl_remove,
 	.plat_auto	= sizeof(struct sandbox_sdl_plat),
 };
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#3 lore raw

PATCH 3/23 console: Avoid serial output before the console is running

In reply to Simon Glass

The video driver uses this for debugging, but if used before relocation it crashes at present. Avoid trying to output debugging before the console is ready.

---

 common/console.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
common/console.c +4 -2
index 0013d183aeb..a9d3319977f 100644
@@ -348,7 +348,8 @@ static void console_puts_select(int file, bool serial_only, const char *s)
 
 void console_puts_select_stderr(bool serial_only, const char *s)
 {
-	console_puts_select(stderr, serial_only, s);
+	if (gd->flags & GD_FLG_DEVINIT)
+		console_puts_select(stderr, serial_only, s);
 }
 
 static void console_puts(int file, const char *s)
@@ -401,7 +402,8 @@ static inline void console_putc(int file, const char c)
 
 void console_puts_select(int file, bool serial_only, const char *s)
 {
-	if (serial_only == console_dev_is_serial(stdio_devices[file]))
+	if ((gd->flags & GD_FLG_DEVINIT) &&
+	    serial_only == console_dev_is_serial(stdio_devices[file]))
 		stdio_devices[file]->puts(stdio_devices[file], s);
 }
 
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#4 lore raw

PATCH 4/23 video: sandbox: Set a maximum frame-buffer size

In reply to Simon Glass

If U-Boot starts with the frame buffer set to 16bpp but then runs a test that uses 32bpp, there is not enough space. Update the driver to use the maximum possible frame-buffer size, to avoid this.

---

 drivers/video/sandbox_sdl.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/video/sandbox_sdl.c +17 -1
index 6e430b28244..de8c6609c46 100644
@@ -55,10 +55,26 @@ static void set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp)
 
 	plat->bpix = l2bpp;
 
-	uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8;
+	uc_plat->size = plat->xres * plat->yres * VNBYTES(plat->bpix);
+
+	/*
+	 * Set up to the maximum size we'll ever need. This is a strange case.
+	 * The video memory is allocated by video_post_bind() called from
+	 * board_init_r(). If a test changes the reoslution so it needs more
+	 * memory later (with sandbox_sdl_set_bpp()), it is too late to make
+	 * the frame buffer larger.
+	 *
+	 * So use a maximum size here.
+	 */
+	uc_plat->size = max(uc_plat->size, 1920U * 1080 * VNBYTES(VIDEO_BPP32));
 
 	/* Allow space for two buffers, the lower one being the copy buffer */
 	log_debug("Frame buffer size %x\n", uc_plat->size);
+
+	/*
+	 * If a copy framebuffer is used, double the size and use the last half
+	 * as the copy, with the first half as the normal frame buffer.
+	 */
 	if (IS_ENABLED(CONFIG_VIDEO_COPY))
 		uc_plat->size *= 2;
 }
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#5 lore raw

PATCH 5/23 sandbox: video: Correct the address of the copy base

In reply to Simon Glass

The intention is for the copy base to start halfway through the frame-buffer area. At present is it actually below the frame buffer, which could have anything in it (probably it is malloc space). Fix this.

---

 drivers/video/sandbox_sdl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/sandbox_sdl.c +1 -1
index de8c6609c46..eb321ad17f5 100644
@@ -43,7 +43,7 @@ static int sandbox_sdl_probe(struct udevice *dev)
 	uc_priv->vidconsole_drv_name = plat->vidconsole_drv_name;
 	uc_priv->font_size = plat->font_size;
 	if (IS_ENABLED(CONFIG_VIDEO_COPY))
-		uc_plat->copy_base = uc_plat->base - uc_plat->size / 2;
+		uc_plat->copy_base = uc_plat->base + uc_plat->size / 2;
 
 	return 0;
 }
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#6 lore raw

PATCH 6/23 sandbox: video: Add BMP tests for 32bpp and 8bpp modes

In reply to Simon Glass

Add a few more tests for BMP rendering. Use a back door into the sandbox SDL driver to adjust the resolution at runtime.

The truetype code does not support 8bpp. Add this so that the display is not blank when running in this mode.

---

 arch/sandbox/include/asm/test.h  | 18 +++++++++++++++
 drivers/video/console_truetype.c | 21 ++++++++++++++++++
 drivers/video/sandbox_sdl.c      | 19 +++++++++++++++-
 test/dm/video.c                  | 38 ++++++++++++++++++++++++++++++++
 4 files changed, 95 insertions(+), 1 deletion(-)
arch/sandbox/include/asm/test.h +18 -0
index dab1a4ea01b..0aad827e9c6 100644
@@ -8,6 +8,8 @@
 #ifndef __ASM_TEST_H
 #define __ASM_TEST_H
 
+#include <video.h>
+
 /* The sandbox driver always permits an I2C device with this address */
 #define SANDBOX_I2C_TEST_ADDR		0x59
 
@@ -285,4 +287,20 @@ void sandbox_cros_ec_set_test_flags(struct udevice *dev, uint flags);
  */
 int sandbox_cros_ec_get_pwm_duty(struct udevice *dev, uint index, uint *duty);
 
+/**
+ * sandbox_sdl_set_bpp() - Set the depth of the sandbox display
+ *
+ * The device must not be active when this function is called. It activiates it
+ * before returning.
+ *
+ * This updates the depth value and adjusts a few other settings accordingly.
+ * It must be called before the display is probed.
+ *
+ * @dev: Device to adjust
+ * @l2bpp: depth to set
+ * @return 0 if the device was already active, other error if it fails to probe
+ * after the change
+ */
+int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp);
+
 #endif
drivers/video/console_truetype.c +21 -0
index 98427f4c618..de8b86bbacc 100644
@@ -274,6 +274,27 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,
 	 */
 	for (row = 0; row < height; row++) {
 		switch (vid_priv->bpix) {
+		case VIDEO_BPP8:
+			if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
+				u8 *dst = line + xoff;
+				int i;
+
+				for (i = 0; i < width; i++) {
+					int val = *bits;
+					int out;
+
+					if (vid_priv->colour_bg)
+						val = 255 - val;
+					out = val;
+					if (vid_priv->colour_fg)
+						*dst++ |= out;
+					else
+						*dst++ &= out;
+					bits++;
+				}
+				end = dst;
+			}
+			break;
 #ifdef CONFIG_VIDEO_BPP16
 		case VIDEO_BPP16: {
 			uint16_t *dst = (uint16_t *)line + xoff;
drivers/video/sandbox_sdl.c +18 -1
index eb321ad17f5..2afe66fab1a 100644
@@ -12,6 +12,7 @@
 #include <asm/sdl.h>
 #include <asm/state.h>
 #include <asm/u-boot-sandbox.h>
+#include <dm/device-internal.h>
 #include <dm/test.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -79,6 +80,23 @@ static void set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp)
 		uc_plat->size *= 2;
 }
 
+int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp)
+{
+	int ret;
+
+	if (device_active(dev))
+		return -EINVAL;
+	sandbox_sdl_remove_display();
+
+	set_bpp(dev, l2bpp);
+
+	ret = device_probe(dev);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
 static int sandbox_sdl_remove(struct udevice *dev)
 {
 	/*
@@ -89,7 +107,6 @@ static int sandbox_sdl_remove(struct udevice *dev)
 	 *
 	 * sandbox_sdl_remove_display();
 	 */
-
 	return 0;
 }
 
test/dm/video.c +38 -0
index da0ae3622f7..c8c6668c8b3 100644
@@ -13,6 +13,7 @@
 #include <os.h>
 #include <video.h>
 #include <video_console.h>
+#include <asm/test.h>
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
 #include <test/test.h>
@@ -319,6 +320,43 @@ static int dm_test_video_bmp(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_video_bmp, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
 
+/* Test drawing a bitmap file on a 8bpp display */
+static int dm_test_video_bmp8(struct unit_test_state *uts)
+{
+	struct udevice *dev;
+	ulong addr;
+
+	ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+	ut_assertnonnull(dev);
+	ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP8));
+
+	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
+
+	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
+	ut_asserteq(1247, compress_frame_buffer(uts, dev));
+
+	return 0;
+}
+DM_TEST(dm_test_video_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
+/* Test drawing a bitmap file on a 32bpp display */
+static int dm_test_video_bmp32(struct unit_test_state *uts)
+{
+	struct udevice *dev;
+	ulong addr;
+
+	ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+	ut_assertnonnull(dev);
+	ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP32));
+	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
+
+	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
+	ut_asserteq(2024, compress_frame_buffer(uts, dev));
+
+	return 0;
+}
+DM_TEST(dm_test_video_bmp32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
 /* Test drawing a compressed bitmap file */
 static int dm_test_video_bmp_comp(struct unit_test_state *uts)
 {
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#7 lore raw

PATCH 7/23 video: Expand video debugging buffer size

In reply to Simon Glass

On sandbox these addresses are 16 hex digits log so we need more space for the debug string. Update it.

---

 drivers/video/video-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/video-uclass.c +2 -2
index 9f8cf6ef2a9..2435a29b556 100644
@@ -265,10 +265,10 @@ int video_sync_copy(struct udevice *dev, void *from, void *to)
 		 */
 		if (offset < -priv->fb_size || offset > 2 * priv->fb_size) {
 #ifdef DEBUG
-			char str[80];
+			char str[120];
 
 			snprintf(str, sizeof(str),
-				 "[sync_copy fb=%p, from=%p, to=%p, offset=%lx]",
+				 "[** FAULT sync_copy fb=%p, from=%p, to=%p, offset=%lx]",
 				 priv->fb, from, to, offset);
 			console_puts_select_stderr(true, str);
 #endif
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#8 lore raw

PATCH 8/23 sandbox: Enable support for the gzip command

In reply to Simon Glass

This does not work with sandbox at present. Fix it up to use map_sysmem() to convert an address to a pointer.

---

 cmd/unzip.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
cmd/unzip.c +3 -1
index 3d1f5f3ac10..bc6cee06043 100644
@@ -8,6 +8,7 @@
 #include <command.h>
 #include <env.h>
 #include <gzip.h>
+#include <mapmem.h>
 #include <part.h>
 
 static int do_unzip(struct cmd_tbl *cmdtp, int flag, int argc,
@@ -28,7 +29,8 @@ static int do_unzip(struct cmd_tbl *cmdtp, int flag, int argc,
 			return CMD_RET_USAGE;
 	}
 
-	if (gunzip((void *) dst, dst_len, (void *) src, &src_len) != 0)
+	if (gunzip(map_sysmem(dst, dst_len), dst_len, map_sysmem(src, 0),
+		   &src_len) != 0)
 		return 1;
 
 	printf("Uncompressed size: %lu = 0x%lX\n", src_len, src_len);
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#9 lore raw

PATCH 9/23 video: Drop fb_put_byte() el at

In reply to Simon Glass

These functions are not used with driver model, nor in any U-Boot boards. Drop them and inline the code.

---

 drivers/video/video_bmp.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)
drivers/video/video_bmp.c +5 -17
index 1e6f07ff4b0..7b3e15b7094 100644
@@ -127,19 +127,6 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 }
 #endif
 
-__weak void fb_put_byte(uchar **fb, uchar **from)
-{
-	*(*fb)++ = *(*from)++;
-}
-
-#if defined(CONFIG_BMP_16BPP)
-__weak void fb_put_word(uchar **fb, uchar **from)
-{
-	*(*fb)++ = *(*from)++;
-	*(*fb)++ = *(*from)++;
-}
-#endif /* CONFIG_BMP_16BPP */
-
 /**
  * video_splash_align_axis() - Align a single coordinate
  *
@@ -295,7 +282,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 			WATCHDOG_RESET();
 			for (j = 0; j < width; j++) {
 				if (bpix == 8) {
-					fb_put_byte(&fb, &bmap);
+					*fb++ = *bmap++;
 				} else if (bpix == 16) {
 					*(uint16_t *)fb = cmap_base[*bmap];
 					bmap++;
@@ -325,9 +312,10 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 	case 16:
 		for (i = 0; i < height; ++i) {
 			WATCHDOG_RESET();
-			for (j = 0; j < width; j++)
-				fb_put_word(&fb, &bmap);
-
+			for (j = 0; j < width; j++) {
+				*fb++ = *bmap++;
+				*fb++ = *bmap++;
+			}
 			bmap += (padded_width - width);
 			fb -= width * 2 + priv->line_length;
 		}
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#10 lore raw

PATCH 10/23 video: Move BMP pixel-writing into a function

In reply to Simon Glass

At present the code that writes to a pixel is quite convoluted. It uses a colour map which is in the uclass and the same code is repeated in different places within video_bmp_display().

As a first step, create a function which can write a pixel from the bitmap, no matter what the display depth. Use any provided palette directly, rather than using the uclass version.

---

 drivers/video/video_bmp.c | 75 +++++++++++++++++++++++++++------------
 1 file changed, 52 insertions(+), 23 deletions(-)
drivers/video/video_bmp.c +52 -23
index 7b3e15b7094..8d152c894cb 100644
@@ -13,12 +13,60 @@
 #include <watchdog.h>
 #include <asm/unaligned.h>
 
-#ifdef CONFIG_VIDEO_BMP_RLE8
 #define BMP_RLE8_ESCAPE		0
 #define BMP_RLE8_EOL		0
 #define BMP_RLE8_EOBMP		1
 #define BMP_RLE8_DELTA		2
 
+/**
+ * get_bmp_col_16bpp() - Convert a colour-table entry into a 16bpp pixel value
+ *
+ * @return value to write to the 16bpp frame buffer for this palette entry
+ */
+static uint get_bmp_col_16bpp(struct bmp_color_table_entry cte)
+{
+	return ((cte.red   << 8) & 0xf800) |
+		((cte.green << 3) & 0x07e0) |
+		((cte.blue  >> 3) & 0x001f);
+}
+
+/**
+ * write_pix8() - Write a pixel from a BMP image into the framebuffer
+ *
+ * This handles frame buffers with 8, 16, 24 or 32 bits per pixel
+ *
+ * @fb: Place in frame buffer to update
+ * @bpix: Frame buffer bits-per-pixel, which controls how many bytes are written
+ * @palette: BMP palette table
+ * @bmap: Pointer to BMP bitmap position to write. This contains a single byte
+ *	which is either written directly (bpix == 8) or used to look up the
+ *	palette to get a colour to write
+ */
+static void write_pix8(u8 *fb, uint bpix, struct bmp_color_table_entry *palette,
+		       u8 *bmap)
+{
+	if (bpix == 8) {
+		*fb++ = *bmap;
+	} else if (bpix == 16) {
+		*(u16 *)fb = get_bmp_col_16bpp(palette[*bmap]);
+	} else {
+		/* Only support big endian */
+		struct bmp_color_table_entry *cte = &palette[*bmap];
+
+		if (bpix == 24) {
+			*fb++ = cte->red;
+			*fb++ = cte->green;
+			*fb++ = cte->blue;
+		} else {
+			*fb++ = cte->blue;
+			*fb++ = cte->green;
+			*fb++ = cte->red;
+			*fb++ = 0;
+		}
+	}
+}
+
+#ifdef CONFIG_VIDEO_BMP_RLE8
 static void draw_unencoded_bitmap(ushort **fbp, uchar *bmap, ushort *cmap,
 				  int cnt)
 {
@@ -258,7 +306,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 	switch (bmp_bpix) {
 	case 1:
 	case 8: {
-		struct bmp_color_table_entry *cte;
 		cmap_base = priv->cmap;
 #ifdef CONFIG_VIDEO_BMP_RLE8
 		u32 compression = get_unaligned_le32(&bmp->header.compression);
@@ -281,27 +328,9 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		for (i = 0; i < height; ++i) {
 			WATCHDOG_RESET();
 			for (j = 0; j < width; j++) {
-				if (bpix == 8) {
-					*fb++ = *bmap++;
-				} else if (bpix == 16) {
-					*(uint16_t *)fb = cmap_base[*bmap];
-					bmap++;
-					fb += sizeof(uint16_t) / sizeof(*fb);
-				} else {
-					/* Only support big endian */
-					cte = &palette[*bmap];
-					bmap++;
-					if (bpix == 24) {
-						*(fb++) = cte->red;
-						*(fb++) = cte->green;
-						*(fb++) = cte->blue;
-					} else {
-						*(fb++) = cte->blue;
-						*(fb++) = cte->green;
-						*(fb++) = cte->red;
-						*(fb++) = 0;
-					}
-				}
+				write_pix8(fb, bpix, palette, bmap);
+				bmap++;
+				fb += bpix / 8;
 			}
 			bmap += (padded_width - width);
 			fb -= byte_width + priv->line_length;
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#11 lore raw

PATCH 11/23 video: bmp: Update RLE8 support to use the write function

In reply to Simon Glass

Update this code to use write_pix8() rather than writing the pixels only for a single supported display depth. This allows us to support any depth.

Add some more tests too.

---

 drivers/video/video_bmp.c | 49 +++++++++++++++++++++------------------
 test/dm/video.c           | 38 ++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 22 deletions(-)
drivers/video/video_bmp.c +27 -22
index 8d152c894cb..2a3536c7907 100644
@@ -67,28 +67,37 @@ static void write_pix8(u8 *fb, uint bpix, struct bmp_color_table_entry *palette,
 }
 
 #ifdef CONFIG_VIDEO_BMP_RLE8
-static void draw_unencoded_bitmap(ushort **fbp, uchar *bmap, ushort *cmap,
+static void draw_unencoded_bitmap(u8 **fbp, uint bpix, uchar *bmap,
+				  struct bmp_color_table_entry *palette,
 				  int cnt)
 {
+	u8 *fb = *fbp;
+
 	while (cnt > 0) {
-		*(*fbp)++ = cmap[*bmap++];
+		write_pix8(fb, bpix, palette, bmap++);
+		fb += bpix / 8;
 		cnt--;
 	}
+	*fbp = fb;
 }
 
-static void draw_encoded_bitmap(ushort **fbp, ushort col, int cnt)
+static void draw_encoded_bitmap(u8 **fbp, uint bpix,
+				struct bmp_color_table_entry *palette, u8 *bmap,
+				int cnt)
 {
-	ushort *fb = *fbp;
+	u8 *fb = *fbp;
 
 	while (cnt > 0) {
-		*fb++ = col;
+		write_pix8(fb, bpix, palette, bmap);
+		fb += bpix / 8;
 		cnt--;
 	}
 	*fbp = fb;
 }
 
 static void video_display_rle8_bitmap(struct udevice *dev,
-				      struct bmp_image *bmp, ushort *cmap,
+				      struct bmp_image *bmp, uint bpix,
+				      struct bmp_color_table_entry *palette,
 				      uchar *fb, int x_off, int y_off,
 				      ulong width, ulong height)
 {
@@ -97,6 +106,7 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 	ulong cnt, runlen;
 	int x, y;
 	int decode = 1;
+	uint bytes_per_pixel = bpix / 8;
 
 	debug("%s\n", __func__);
 	bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset);
@@ -112,8 +122,8 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 				bmap += 2;
 				x = 0;
 				y--;
-				/* 16bpix, 2-byte per pixel, width should *2 */
-				fb -= (width * 2 + priv->line_length);
+				fb -= width * bytes_per_pixel +
+					priv->line_length;
 				break;
 			case BMP_RLE8_EOBMP:
 				/* end of bitmap */
@@ -123,9 +133,9 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 				/* delta run */
 				x += bmap[2];
 				y -= bmap[3];
-				/* 16bpix, 2-byte per pixel, x should *2 */
-				fb = (uchar *)(priv->fb + (y + y_off - 1)
-					* priv->line_length + (x + x_off) * 2);
+				fb = (uchar *)(priv->fb +
+					(y + y_off - 1) * priv->line_length +
+					(x + x_off) * bytes_per_pixel);
 				bmap += 4;
 				break;
 			default:
@@ -139,8 +149,8 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 						else
 							cnt = runlen;
 						draw_unencoded_bitmap(
-							(ushort **)&fb,
-							bmap, cmap, cnt);
+							&fb, bpix,
+							bmap, palette, cnt);
 					}
 					x += runlen;
 				}
@@ -164,8 +174,8 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 						cnt = width - x;
 					else
 						cnt = runlen;
-					draw_encoded_bitmap((ushort **)&fb,
-						cmap[bmap[1]], cnt);
+					draw_encoded_bitmap(&fb, bpix, palette,
+							    &bmap[1], cnt);
 				}
 				x += runlen;
 			}
@@ -311,13 +321,8 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		u32 compression = get_unaligned_le32(&bmp->header.compression);
 		debug("compressed %d %d\n", compression, BMP_BI_RLE8);
 		if (compression == BMP_BI_RLE8) {
-			if (bpix != 16) {
-				/* TODO implement render code for bpix != 16 */
-				printf("Error: only support 16 bpix");
-				return -EPROTONOSUPPORT;
-			}
-			video_display_rle8_bitmap(dev, bmp, cmap_base, fb, x,
-						  y, width, height);
+			video_display_rle8_bitmap(dev, bmp, bpix, palette, fb,
+						  x, y, width, height);
 			break;
 		}
 #endif
test/dm/video.c +38 -0
index c8c6668c8b3..d5648f0c59b 100644
@@ -373,6 +373,44 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_video_bmp_comp, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
 
+/* Test drawing a bitmap file on a 32bpp display */
+static int dm_test_video_comp_bmp32(struct unit_test_state *uts)
+{
+	struct udevice *dev;
+	ulong addr;
+
+	ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+	ut_assertnonnull(dev);
+	ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP32));
+
+	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
+
+	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
+	ut_asserteq(2024, compress_frame_buffer(uts, dev));
+
+	return 0;
+}
+DM_TEST(dm_test_video_comp_bmp32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
+/* Test drawing a bitmap file on a 8bpp display */
+static int dm_test_video_comp_bmp8(struct unit_test_state *uts)
+{
+	struct udevice *dev;
+	ulong addr;
+
+	ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+	ut_assertnonnull(dev);
+	ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP8));
+
+	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
+
+	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
+	ut_asserteq(1247, compress_frame_buffer(uts, dev));
+
+	return 0;
+}
+DM_TEST(dm_test_video_comp_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
 /* Test TrueType console */
 static int dm_test_video_truetype(struct unit_test_state *uts)
 {
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#12 lore raw

PATCH 12/23 video: Drop the uclass colour map

In reply to Simon Glass

We don't need this anymore since we use the BMP palette directly. Drop it.

---

 drivers/video/video-uclass.c | 23 -----------------------
 drivers/video/video_bmp.c    | 22 ----------------------
 include/video.h              |  2 --
 3 files changed, 47 deletions(-)
drivers/video/video-uclass.c +0 -23
index 2435a29b556..fafd05e373f 100644
@@ -305,27 +305,6 @@ int video_sync_copy_all(struct udevice *dev)
 
 #endif
 
-/* Set up the colour map */
-static int video_pre_probe(struct udevice *dev)
-{
-	struct video_priv *priv = dev_get_uclass_priv(dev);
-
-	priv->cmap = calloc(256, sizeof(ushort));
-	if (!priv->cmap)
-		return -ENOMEM;
-
-	return 0;
-}
-
-static int video_pre_remove(struct udevice *dev)
-{
-	struct video_priv *priv = dev_get_uclass_priv(dev);
-
-	free(priv->cmap);
-
-	return 0;
-}
-
 /* Set up the display ready for use */
 static int video_post_probe(struct udevice *dev)
 {
@@ -433,9 +412,7 @@ UCLASS_DRIVER(video) = {
 	.name		= "video",
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
 	.post_bind	= video_post_bind,
-	.pre_probe	= video_pre_probe,
 	.post_probe	= video_post_probe,
-	.pre_remove	= video_pre_remove,
 	.priv_auto	= sizeof(struct video_uc_priv),
 	.per_device_auto	= sizeof(struct video_priv),
 	.per_device_plat_auto	= sizeof(struct video_uc_plat),
drivers/video/video_bmp.c +0 -22
index 2a3536c7907..466c0f54363 100644
@@ -214,28 +214,10 @@ static void video_splash_align_axis(int *axis, unsigned long panel_size,
 	*axis = max(0, (int)axis_alignment);
 }
 
-static void video_set_cmap(struct udevice *dev,
-			   struct bmp_color_table_entry *cte, unsigned colours)
-{
-	struct video_priv *priv = dev_get_uclass_priv(dev);
-	int i;
-	ushort *cmap = priv->cmap;
-
-	debug("%s: colours=%d\n", __func__, colours);
-	for (i = 0; i < colours; ++i) {
-		*cmap = ((cte->red   << 8) & 0xf800) |
-			((cte->green << 3) & 0x07e0) |
-			((cte->blue  >> 3) & 0x001f);
-		cmap++;
-		cte++;
-	}
-}
-
 int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		      bool align)
 {
 	struct video_priv *priv = dev_get_uclass_priv(dev);
-	ushort *cmap_base = NULL;
 	int i, j;
 	uchar *start, *fb;
 	struct bmp_image *bmp = map_sysmem(bmp_image, 0);
@@ -291,9 +273,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 	debug("Display-bmp: %d x %d  with %d colours, display %d\n",
 	      (int)width, (int)height, (int)colours, 1 << bpix);
 
-	if (bmp_bpix == 8)
-		video_set_cmap(dev, palette, colours);
-
 	padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width);
 
 	if (align) {
@@ -316,7 +295,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 	switch (bmp_bpix) {
 	case 1:
 	case 8: {
-		cmap_base = priv->cmap;
 #ifdef CONFIG_VIDEO_BMP_RLE8
 		u32 compression = get_unaligned_le32(&bmp->header.compression);
 		debug("compressed %d %d\n", compression, BMP_BI_RLE8);
include/video.h +0 -2
index f14fb15f84f..6948cdf5796 100644
@@ -93,7 +93,6 @@ enum video_format {
  * @colour_bg:	Background colour (pixel value)
  * @flush_dcache:	true to enable flushing of the data cache after
  *		the LCD is updated
- * @cmap:	Colour map for 8-bit-per-pixel displays
  * @fg_col_idx:	Foreground color code (bit 3 = bold, bit 0-2 = color)
  * @bg_col_idx:	Background color code (bit 3 = bold, bit 0-2 = color)
  */
@@ -118,7 +117,6 @@ struct video_priv {
 	u32 colour_fg;
 	u32 colour_bg;
 	bool flush_dcache;
-	ushort *cmap;
 	u8 fg_col_idx;
 	u8 bg_col_idx;
 };
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#13 lore raw

PATCH 13/23 video: Tidy up 24/32 BMP blitting

In reply to Simon Glass

Drop the unnecessary brackets.

---

 drivers/video/video_bmp.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/video/video_bmp.c +8 -8
index 466c0f54363..ba36589effb 100644
@@ -345,10 +345,10 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 					bmap += 3;
 					fb += 2;
 				} else {
-					*(fb++) = *(bmap++);
-					*(fb++) = *(bmap++);
-					*(fb++) = *(bmap++);
-					*(fb++) = 0;
+					*fb++ = *bmap++;
+					*fb++ = *bmap++;
+					*fb++ = *bmap++;
+					*fb++ = 0;
 				}
 			}
 			fb -= priv->line_length + width * (bpix / 8);
@@ -360,10 +360,10 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 	case 32:
 		for (i = 0; i < height; ++i) {
 			for (j = 0; j < width; j++) {
-				*(fb++) = *(bmap++);
-				*(fb++) = *(bmap++);
-				*(fb++) = *(bmap++);
-				*(fb++) = *(bmap++);
+				*fb++ = *bmap++;
+				*fb++ = *bmap++;
+				*fb++ = *bmap++;
+				*fb++ = *bmap++;
 			}
 			fb -= priv->line_length + width * (bpix / 8);
 		}
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#14 lore raw

PATCH 14/23 video: Add a test for 16bpp BMP files

In reply to Simon Glass

Add a compressed 16bpp BMP file and a test to cover this.

---

 .gitattributes                     |   1 +
 configs/sandbox_defconfig          |   1 +
 configs/sandbox_flattree_defconfig |   1 +
 test/dm/video.c                    |  24 ++++++++++++++++++++++++
 tools/logos/denx-16bpp.bmp.gz      | Bin 0 -> 4516 bytes
 5 files changed, 27 insertions(+)
 create mode 100644 tools/logos/denx-16bpp.bmp.gz
.gitattributes +1 -0
index 899473ab0fb..1879a2dfb3c 100644
@@ -3,3 +3,4 @@
 # Denote all files that are truly binary and should not be modified
 *.bmp binary
 *.ttf binary
+*.gz binary
configs/sandbox_defconfig +1 -0
index c390afe9de5..5dffc704bd6 100644
@@ -285,6 +285,7 @@ CONFIG_OSD=y
 CONFIG_SANDBOX_OSD=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_VIDEO_BMP_RLE8=y
+CONFIG_BMP_16BPP=y
 CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
configs/sandbox_flattree_defconfig +1 -0
index 7cc76bf2713..e879ca40041 100644
@@ -198,6 +198,7 @@ CONFIG_VIDEO_SANDBOX_SDL=y
 CONFIG_OSD=y
 CONFIG_SANDBOX_OSD=y
 CONFIG_VIDEO_BMP_RLE8=y
+CONFIG_BMP_16BPP=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_RSA_VERIFY_WITH_PKEY=y
 CONFIG_TPM=y
test/dm/video.c +24 -0
index d5648f0c59b..c496b05df76 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <bzlib.h>
 #include <dm.h>
+#include <gzip.h>
 #include <log.h>
 #include <malloc.h>
 #include <mapmem.h>
@@ -339,6 +340,29 @@ static int dm_test_video_bmp8(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_video_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
 
+/* Test drawing a bitmap file on a 16bpp display */
+static int dm_test_video_bmp16(struct unit_test_state *uts)
+{
+	ulong src, src_len = ~0UL;
+	uint dst_len = ~0U;
+	struct udevice *dev;
+	ulong dst = 0x10000;
+
+	ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+	ut_assertnonnull(dev);
+	ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP16));
+
+	ut_assertok(read_file(uts, "tools/logos/denx-16bpp.bmp.gz", &src));
+	ut_assertok(gunzip(map_sysmem(dst, 0), dst_len, map_sysmem(src, 0),
+			   &src_len));
+
+	ut_assertok(video_bmp_display(dev, dst, 0, 0, false));
+	ut_asserteq(3700, compress_frame_buffer(uts, dev));
+
+	return 0;
+}
+DM_TEST(dm_test_video_bmp16, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
 /* Test drawing a bitmap file on a 32bpp display */
 static int dm_test_video_bmp32(struct unit_test_state *uts)
 {
tools/logos/denx-16bpp.bmp.gz new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..ed99c58192e9e1ecbd3b118823f197a484cdad34
GIT binary patch
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#15 lore raw

PATCH 15/23 video: theadorable: Use RGB565 for BMP blitting

In reply to Simon Glass

At present this uses RGB555 format for blitting to a display. Sandbox uses 565 and that seems to be more normal for BMP as well. Update the code accordingly and add a test.

Note that this likely breaks the theadorable board so we may need to discuss supporting both formats.

---

 configs/sandbox_defconfig          |   1 +
 configs/sandbox_flattree_defconfig |   1 +
 drivers/video/video_bmp.c          |   6 ++--
 test/dm/video.c                    |  46 +++++++++++++++++++++++++++++
 tools/logos/denx-24bpp.bmp.gz      | Bin 0 -> 7137 bytes
 5 files changed, 51 insertions(+), 3 deletions(-)
 create mode 100644 tools/logos/denx-24bpp.bmp.gz
configs/sandbox_defconfig +1 -0
index 5dffc704bd6..4f413582fb2 100644
@@ -286,6 +286,7 @@ CONFIG_SANDBOX_OSD=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_VIDEO_BMP_RLE8=y
 CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
 CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
configs/sandbox_flattree_defconfig +1 -0
index e879ca40041..ca81df89b32 100644
@@ -199,6 +199,7 @@ CONFIG_OSD=y
 CONFIG_SANDBOX_OSD=y
 CONFIG_VIDEO_BMP_RLE8=y
 CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_RSA_VERIFY_WITH_PKEY=y
 CONFIG_TPM=y
drivers/video/video_bmp.c +3 -3
index ba36589effb..1c613567657 100644
@@ -338,9 +338,9 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 		for (i = 0; i < height; ++i) {
 			for (j = 0; j < width; j++) {
 				if (bpix == 16) {
-					/* 16bit 555RGB format */
-					*(u16 *)fb = ((bmap[2] >> 3) << 10) |
-						((bmap[1] >> 3) << 5) |
+					/* 16bit 565RGB format */
+					*(u16 *)fb = ((bmap[2] >> 3) << 11) |
+						((bmap[1] >> 2) << 5) |
 						(bmap[0] >> 3);
 					bmap += 3;
 					fb += 2;
test/dm/video.c +46 -0

52 lines not on this page · raw message

tools/logos/denx-24bpp.bmp.gz new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..95b44d31950994a4dc6a5148a4a754d9979e2dc6
GIT binary patch
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#16 lore raw

PATCH 16/23 video: Drop #ifdefs from video_bmp

In reply to Simon Glass

Convert the current preprocessor macros to C code.

---

 drivers/video/video_bmp.c | 97 ++++++++++++++++++++-------------------
 1 file changed, 49 insertions(+), 48 deletions(-)
drivers/video/video_bmp.c +49 -48
index 1c613567657..e8600b2def3 100644
@@ -66,7 +66,6 @@ static void write_pix8(u8 *fb, uint bpix, struct bmp_color_table_entry *palette,
 	}
 }
 
-#ifdef CONFIG_VIDEO_BMP_RLE8
 static void draw_unencoded_bitmap(u8 **fbp, uint bpix, uchar *bmap,
 				  struct bmp_color_table_entry *palette,
 				  int cnt)
@@ -183,7 +182,6 @@ static void video_display_rle8_bitmap(struct udevice *dev,
 		}
 	}
 }
-#endif
 
 /**
  * video_splash_align_axis() - Align a single coordinate
@@ -294,16 +292,19 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 
 	switch (bmp_bpix) {
 	case 1:
-	case 8: {
-#ifdef CONFIG_VIDEO_BMP_RLE8
-		u32 compression = get_unaligned_le32(&bmp->header.compression);
-		debug("compressed %d %d\n", compression, BMP_BI_RLE8);
-		if (compression == BMP_BI_RLE8) {
-			video_display_rle8_bitmap(dev, bmp, bpix, palette, fb,
-						  x, y, width, height);
-			break;
+	case 8:
+		if (IS_ENABLED(CONFIG_VIDEO_BMP_RLE8)) {
+			u32 compression = get_unaligned_le32(
+				&bmp->header.compression);
+			debug("compressed %d %d\n", compression, BMP_BI_RLE8);
+			if (compression == BMP_BI_RLE8) {
+				video_display_rle8_bitmap(dev, bmp, bpix, palette, fb,
+							  x, y, width, height);
+				break;
+			}
 		}
-#endif
+
+		/* Not compressed */
 		byte_width = width * (bpix / 8);
 		if (!byte_width)
 			byte_width = width;
@@ -319,56 +320,56 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 			fb -= byte_width + priv->line_length;
 		}
 		break;
-	}
-#if defined(CONFIG_BMP_16BPP)
 	case 16:
-		for (i = 0; i < height; ++i) {
-			WATCHDOG_RESET();
-			for (j = 0; j < width; j++) {
-				*fb++ = *bmap++;
-				*fb++ = *bmap++;
+		if (IS_ENABLED(CONFIG_BMP_16BPP)) {
+			for (i = 0; i < height; ++i) {
+				WATCHDOG_RESET();
+				for (j = 0; j < width; j++) {
+					*fb++ = *bmap++;
+					*fb++ = *bmap++;
+				}
+				bmap += (padded_width - width);
+				fb -= width * 2 + priv->line_length;
 			}
-			bmap += (padded_width - width);
-			fb -= width * 2 + priv->line_length;
 		}
 		break;
-#endif /* CONFIG_BMP_16BPP */
-#if defined(CONFIG_BMP_24BPP)
 	case 24:
-		for (i = 0; i < height; ++i) {
-			for (j = 0; j < width; j++) {
-				if (bpix == 16) {
-					/* 16bit 565RGB format */
-					*(u16 *)fb = ((bmap[2] >> 3) << 11) |
-						((bmap[1] >> 2) << 5) |
-						(bmap[0] >> 3);
-					bmap += 3;
-					fb += 2;
-				} else {
-					*fb++ = *bmap++;
-					*fb++ = *bmap++;
-					*fb++ = *bmap++;
-					*fb++ = 0;
+		if (IS_ENABLED(CONFIG_BMP_24BPP)) {
+			for (i = 0; i < height; ++i) {
+				for (j = 0; j < width; j++) {
+					if (bpix == 16) {
+						/* 16bit 565RGB format */
+						*(u16 *)fb = ((bmap[2] >> 3)
+							<< 11) |
+							((bmap[1] >> 2) << 5) |
+							(bmap[0] >> 3);
+						bmap += 3;
+						fb += 2;
+					} else {
+						*fb++ = *bmap++;
+						*fb++ = *bmap++;
+						*fb++ = *bmap++;
+						*fb++ = 0;
+					}
 				}
+				fb -= priv->line_length + width * (bpix / 8);
+				bmap += (padded_width - width);
 			}
-			fb -= priv->line_length + width * (bpix / 8);
-			bmap += (padded_width - width);
 		}
 		break;
-#endif /* CONFIG_BMP_24BPP */
-#if defined(CONFIG_BMP_32BPP)
 	case 32:
-		for (i = 0; i < height; ++i) {
-			for (j = 0; j < width; j++) {
-				*fb++ = *bmap++;
-				*fb++ = *bmap++;
-				*fb++ = *bmap++;
-				*fb++ = *bmap++;
+		if (IS_ENABLED(CONFIG_BMP_32BPP)) {
+			for (i = 0; i < height; ++i) {
+				for (j = 0; j < width; j++) {
+					*fb++ = *bmap++;
+					*fb++ = *bmap++;
+					*fb++ = *bmap++;
+					*fb++ = *bmap++;
+				}
+				fb -= priv->line_length + width * (bpix / 8);
 			}
-			fb -= priv->line_length + width * (bpix / 8);
 		}
 		break;
-#endif /* CONFIG_BMP_32BPP */
 	default:
 		break;
 	};
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#17 lore raw

PATCH 17/23 video: Convert CONFIG_VIDEO_LOGO to Kconfig

In reply to Simon Glass

This converts the following to Kconfig:
CONFIG_VIDEO_LOGO

Note that this option depends on CONFIG_DM_VIDEO now, since cfb_console is deprecated. The only relevant code is now in splash.c

Drop the check for DM_VIDEO in that file.

---

 README                                 | 1 -
 common/splash.c                        | 2 +-
 configs/apalis_imx6_defconfig          | 1 +
 configs/aristainetos2c_defconfig       | 1 +
 configs/aristainetos2ccslb_defconfig   | 1 +
 configs/cm_fx6_defconfig               | 1 +
 configs/colibri-imx6ull-emmc_defconfig | 1 +
 configs/colibri-imx6ull_defconfig      | 1 +
 configs/colibri_imx6_defconfig         | 1 +
 configs/colibri_imx7_defconfig         | 1 +
 configs/colibri_imx7_emmc_defconfig    | 1 +
 configs/colibri_vf_defconfig           | 1 +
 configs/gwventana_emmc_defconfig       | 1 +
 configs/gwventana_gw5904_defconfig     | 1 +
 configs/gwventana_nand_defconfig       | 1 +
 configs/imx6dl_icore_nand_defconfig    | 1 +
 configs/imx6q_icore_nand_defconfig     | 1 +
 configs/imx6qdl_icore_mmc_defconfig    | 1 +
 configs/imx6qdl_icore_nand_defconfig   | 1 +
 configs/imxrt1050-evk_defconfig        | 1 +
 configs/m53menlo_defconfig             | 1 +
 configs/marsboard_defconfig            | 1 +
 configs/mx6cuboxi_defconfig            | 1 +
 configs/mx6sabreauto_defconfig         | 1 +
 configs/mx6sabresd_defconfig           | 1 +
 configs/mx6ul_14x14_evk_defconfig      | 1 +
 configs/mx6ul_9x9_evk_defconfig        | 1 +
 configs/novena_defconfig               | 1 +
 configs/opos6uldev_defconfig           | 1 +
 configs/pico-dwarf-imx7d_defconfig     | 1 +
 configs/pico-hobbit-imx7d_defconfig    | 1 +
 configs/pico-imx6_defconfig            | 1 +
 configs/pico-imx6ul_defconfig          | 1 +
 configs/pico-imx7d_bl33_defconfig      | 1 +
 configs/pico-imx7d_defconfig           | 1 +
 configs/pico-nymph-imx7d_defconfig     | 1 +
 configs/pico-pi-imx7d_defconfig        | 1 +
 configs/riotboard_defconfig            | 1 +
 configs/s5p4418_nanopi2_defconfig      | 1 +
 configs/wandboard_defconfig            | 1 +
 drivers/video/Kconfig                  | 9 +++++++++
 include/configs/T102xRDB.h             | 1 -
 include/configs/T104xRDB.h             | 1 -
 include/configs/apalis_imx6.h          | 1 -
 include/configs/aristainetos2.h        | 1 -
 include/configs/cm_fx6.h               | 1 -
 include/configs/colibri-imx6ull.h      | 1 -
 include/configs/colibri_imx6.h         | 1 -
 include/configs/colibri_imx7.h         | 1 -
 include/configs/colibri_vf.h           | 1 -
 include/configs/embestmx6boards.h      | 1 -
 include/configs/gw_ventana.h           | 1 -
 include/configs/imx6-engicam.h         | 1 -
 include/configs/imxrt1050-evk.h        | 1 -
 include/configs/ls1021aqds.h           | 1 -
 include/configs/ls1021atwr.h           | 1 -
 include/configs/m53menlo.h             | 1 -
 include/configs/mx23evk.h              | 1 -
 include/configs/mx28evk.h              | 1 -
 include/configs/mx51evk.h              | 1 -
 include/configs/mx53loco.h             | 1 -
 include/configs/mx6cuboxi.h            | 1 -
 include/configs/mx6sabre_common.h      | 1 -
 include/configs/mx6sxsabresd.h         | 1 -
 include/configs/mx6ul_14x14_evk.h      | 1 -
 include/configs/mx7dsabresd.h          | 1 -
 include/configs/nokia_rx51.h           | 1 -
 include/configs/novena.h               | 1 -
 include/configs/opos6uldev.h           | 1 -
 include/configs/pico-imx6.h            | 1 -
 include/configs/pico-imx6ul.h          | 1 -
 include/configs/pico-imx7d.h           | 1 -
 include/configs/pxm2.h                 | 1 -
 include/configs/rut.h                  | 1 -
 include/configs/s5p4418_nanopi2.h      | 2 --
 include/configs/wandboard.h            | 1 -
 scripts/config_whitelist.txt           | 1 -
 77 files changed, 48 insertions(+), 39 deletions(-)
README +0 -1
index 9606a8b3acf..2b8fa030859 100644
@@ -1095,7 +1095,6 @@ The following options need to be configured:
 			CONFIG_CFB_CONSOLE
 			CONFIG_VIDEO_SW_CURSOR
 			CONFIG_VGA_AS_SINGLE_DEVICE
-			CONFIG_VIDEO_LOGO
 			CONFIG_VIDEO_BMP_LOGO
 
 		The DIU driver will look for the 'video-mode' environment
common/splash.c +1 -1
index de720df9f58..98f0089266d 100644
@@ -52,7 +52,7 @@ static struct splash_location default_splash_locations[] = {
 	},
 };
 
-#if defined(CONFIG_DM_VIDEO) && defined(CONFIG_VIDEO_LOGO)
+#ifdef CONFIG_VIDEO_LOGO
 
 #include <bmp_logo_data.h>
 
configs/apalis_imx6_defconfig +1 -0
index b5c846aa6a4..81d964302c5 100644
@@ -105,6 +105,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/aristainetos2c_defconfig +1 -0
index ad4e8350c3a..27607d2ace4 100644
@@ -109,6 +109,7 @@ CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_IPUV3=y
configs/aristainetos2ccslb_defconfig +1 -0
index e4ecd81c1e2..bfc967b38e6 100644
@@ -109,6 +109,7 @@ CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_IPUV3=y
configs/cm_fx6_defconfig +1 -0
index b823a150dc0..4e7f152185b 100644
@@ -106,6 +106,7 @@ CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_VIDEO_IPUV3=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SOURCE=y
configs/colibri-imx6ull-emmc_defconfig +1 -0
index 4b346a98793..81881ef1e9b 100644
@@ -80,6 +80,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/colibri-imx6ull_defconfig +1 -0
index 7d15b7b58bf..3e4d1b82090 100644
@@ -95,6 +95,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
configs/colibri_imx6_defconfig +1 -0
index 1f3c0f17d0c..3900ad258bd 100644
@@ -103,6 +103,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/colibri_imx7_defconfig +1 -0
index 129f625acab..0e8cabc3468 100644
@@ -91,6 +91,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
configs/colibri_imx7_emmc_defconfig +1 -0
index c06ef33eb0b..e2de213018c 100644
@@ -85,6 +85,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
 CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/colibri_vf_defconfig +1 -0
index 4306ff485e9..c404139ef18 100644
@@ -97,6 +97,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP16 is not set
 CONFIG_VIDEO_FSL_DCU_FB=y
configs/gwventana_emmc_defconfig +1 -0
index 3c94c0a5927..6b58474e5e8 100644
@@ -138,6 +138,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/gwventana_gw5904_defconfig +1 -0
index 3309c657f19..f3e54a32af3 100644
@@ -142,6 +142,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/gwventana_nand_defconfig +1 -0
index b64d4ae1592..0833f7ce630 100644
@@ -146,6 +146,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/imx6dl_icore_nand_defconfig +1 -0
index 3076dced10b..146cb1c58f5 100644
@@ -64,6 +64,7 @@ CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/imx6q_icore_nand_defconfig +1 -0
index 439917bf243..16711327be5 100644
@@ -65,6 +65,7 @@ CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/imx6qdl_icore_mmc_defconfig +1 -0
index 61d8a7b2e63..47607eb8bd6 100644
@@ -82,6 +82,7 @@ CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/imx6qdl_icore_nand_defconfig +1 -0
index 439917bf243..16711327be5 100644
@@ -65,6 +65,7 @@ CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/imxrt1050-evk_defconfig +1 -0
index ca3f810e025..bc438b9fa6c 100644
@@ -72,6 +72,7 @@ CONFIG_USB=y
 # CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_BACKLIGHT_GPIO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
configs/m53menlo_defconfig +1 -0
index 48d75669cb5..08f7a92b35f 100644
@@ -109,6 +109,7 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/marsboard_defconfig +1 -0
index 281563401f5..0ce228d320d 100644
@@ -57,6 +57,7 @@ CONFIG_USB=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/mx6cuboxi_defconfig +1 -0
index 70374515abe..4fbd83f0a5d 100644
@@ -70,6 +70,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/mx6sabreauto_defconfig +1 -0
index c5cdc3ac17f..f8e622106c9 100644
@@ -109,6 +109,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/mx6sabresd_defconfig +1 -0
index 6733038060a..86af807ad4a 100644
@@ -116,6 +116,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/mx6ul_14x14_evk_defconfig +1 -0
index 5fa9d341f98..52e588e31e2 100644
@@ -92,6 +92,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
configs/mx6ul_9x9_evk_defconfig +1 -0
index 1b80f043bd7..8d18e43956e 100644
@@ -82,6 +82,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
configs/novena_defconfig +1 -0
index 06864db00d5..132d2dff0d7 100644
@@ -84,6 +84,7 @@ CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/opos6uldev_defconfig +1 -0
index c52d2a5d396..f101d3abfdd 100644
@@ -103,6 +103,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
configs/pico-dwarf-imx7d_defconfig +1 -0
index 6df4d44e1ed..13e4d9b0c20 100644
@@ -85,6 +85,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/pico-hobbit-imx7d_defconfig +1 -0
index a5b6a30556e..7dc7e5d6ec3 100644
@@ -85,6 +85,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/pico-imx6_defconfig +1 -0
index 20c7d45a463..2353dd762be 100644
@@ -82,6 +82,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/pico-imx6ul_defconfig +1 -0
index 215537e8cd4..35021ac39b7 100644
@@ -79,6 +79,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/pico-imx7d_bl33_defconfig +1 -0
index 3c669e7fe9d..005f8d8d8ca 100644
@@ -81,6 +81,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
configs/pico-imx7d_defconfig +1 -0
index 8e7e10e1149..ed20aeae685 100644
@@ -85,6 +85,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
configs/pico-nymph-imx7d_defconfig +1 -0
index 6df4d44e1ed..13e4d9b0c20 100644
@@ -85,6 +85,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/pico-pi-imx7d_defconfig +1 -0
index 40a7232b65e..f74e83e96d3 100644
@@ -85,6 +85,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
configs/riotboard_defconfig +1 -0
index 0dd538e5c1a..3c277ed65a0 100644
@@ -69,6 +69,7 @@ CONFIG_USB=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
configs/s5p4418_nanopi2_defconfig +1 -0
index fa59cfd0692..0e17e759b58 100644
@@ -50,6 +50,7 @@ CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_CONS_INDEX=0
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_NX=y
 CONFIG_VIDEO_NX_RGB=y
configs/wandboard_defconfig +1 -0
index 4015c39143f..2160dd852ed 100644
@@ -74,6 +74,7 @@ CONFIG_MXC_UART=y
 CONFIG_DM_THERMAL=y
 CONFIG_USB=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 # CONFIG_VIDEO_BPP8 is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
drivers/video/Kconfig +9 -0
index a58f87f479b..7a73ecc1f40 100644
@@ -14,6 +14,15 @@ config DM_VIDEO
 	  option compiles in the video uclass and routes all LCD/video access
 	  through this.
 
+config VIDEO_LOGO
+	bool "Show the U-Boot logo on the display"
+	depends on DM_VIDEO
+	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
+	  tools/logos/u-boot_logo.bmp and looks best when the display has a
+	  black background.
+
 config BACKLIGHT
 	bool "Enable panel backlight uclass support"
 	depends on DM_VIDEO
include/configs/T102xRDB.h +0 -1
index 89bbeb77844..fdda8c92437 100644
@@ -380,7 +380,6 @@ unsigned long get_board_sys_clk(void);
 #undef CONFIG_FSL_DIU_FB	/* RDB doesn't support DIU */
 #ifdef CONFIG_FSL_DIU_FB
 #define CONFIG_SYS_DIU_ADDR	(CONFIG_SYS_CCSRBAR + 0x180000)
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
 /*
include/configs/T104xRDB.h +0 -1
index 48fc8a271c2..d02d580edaf 100644
@@ -367,7 +367,6 @@
 #ifdef CONFIG_FSL_DIU_FB
 #define CONFIG_FSL_DIU_CH7301
 #define CONFIG_SYS_DIU_ADDR	(CONFIG_SYS_CCSRBAR + 0x180000)
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #endif
 #endif
include/configs/apalis_imx6.h +0 -1
index dfed1615b9b..3c062d42f8d 100644
@@ -46,7 +46,6 @@
 
 /* Framebuffer and LCD */
 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
include/configs/aristainetos2.h +0 -1
index b73b0d5b92b..e6397378e45 100644
@@ -443,7 +443,6 @@
 /* Framebuffer */
 /* check this console not needed, after test remove it */
 #define CONFIG_IMX_VIDEO_SKIP
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 
 #define CONFIG_IMX6_PWM_PER_CLK	66000000
include/configs/cm_fx6.h +0 -1
index d61d759092c..267496b7d10 100644
@@ -177,7 +177,6 @@
 /* Display */
 #define CONFIG_IMX_HDMI
 
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 
 /* EEPROM */
include/configs/colibri-imx6ull.h +0 -1
index 6b3e1c665a0..e4daa4bec46 100644
@@ -165,7 +165,6 @@
 
 #if defined(CONFIG_DM_VIDEO)
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #endif
 
include/configs/colibri_imx6.h +0 -1
index b103186bf46..e0174c58343 100644
@@ -36,7 +36,6 @@
 
 /* Framebuffer and LCD */
 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
include/configs/colibri_imx7.h +0 -1
index ac188ee3ac6..f9b505c45b5 100644
@@ -199,7 +199,6 @@
 #define CONFIG_USBD_HS
 
 #if defined(CONFIG_DM_VIDEO)
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #endif
 
include/configs/colibri_vf.h +0 -1
index 71fe768d679..60bd9332b75 100644
@@ -17,7 +17,6 @@
 #define CONFIG_SYS_FSL_CLK
 
 #ifdef CONFIG_VIDEO_FSL_DCU_FB
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_SYS_FSL_DCU_LE
 
include/configs/embestmx6boards.h +0 -1
index 9769155bca7..d001580d7dd 100644
@@ -52,7 +52,6 @@
 #endif
 
 /* Framebuffer */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
include/configs/gw_ventana.h +0 -1
index abceffb4220..5301d81dd41 100644
@@ -72,7 +72,6 @@
 #define CONFIG_USBD_HS
 
 /* Framebuffer and LCD */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
 #define CONFIG_VIDEO_BMP_LOGO
include/configs/imx6-engicam.h +0 -1
index fed6545fdf9..47ecbf3b381 100644
@@ -156,7 +156,6 @@
 #ifdef CONFIG_VIDEO_IPUV3
 # define CONFIG_IMX_VIDEO_SKIP
 
-# define CONFIG_VIDEO_LOGO
 # define CONFIG_VIDEO_BMP_LOGO
 #endif
 
include/configs/imxrt1050-evk.h +0 -1
index 99d25c1e6ef..e26febb0a78 100644
@@ -22,7 +22,6 @@
 					 DMAMEM_SZ_ALL)
 
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
include/configs/ls1021aqds.h +0 -1
index 27b97ffd2fb..c37593edb3f 100644
@@ -323,7 +323,6 @@ unsigned long get_board_sys_clk(void);
  * Video
  */
 #ifdef CONFIG_VIDEO_FSL_DCU_FB
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 
 #define CONFIG_FSL_DIU_CH7301
include/configs/ls1021atwr.h +0 -1
index c099629607f..0976bf2e575 100644
@@ -209,7 +209,6 @@
  * Video
  */
 #ifdef CONFIG_VIDEO_FSL_DCU_FB
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 
 #define CONFIG_FSL_DCU_SII9022A
include/configs/m53menlo.h +0 -1
index f94cf28b135..db8c4a12db2 100644
@@ -112,7 +112,6 @@
 /*
  * LCD
  */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(2 << 20)
 
 /* LVDS display */
include/configs/mx23evk.h +0 -1
index bccba5cbb17..4d2c4e43579 100644
@@ -27,7 +27,6 @@
 
 /* Framebuffer support */
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(512 << 10)
 #endif
 
include/configs/mx28evk.h +0 -1
index fe4ea8997d4..3eddc1bce07 100644
@@ -41,7 +41,6 @@
 
 /* Framebuffer support */
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(512 << 10)
 #endif
 
include/configs/mx51evk.h +0 -1
index 9cc297da30e..3512be8774e 100644
@@ -45,7 +45,6 @@
 #define CONFIG_MXC_USB_FLAGS	MXC_EHCI_POWER_PINS_ENABLED
 
 /* Framebuffer and LCD */
-#define CONFIG_VIDEO_LOGO
 
 #define CONFIG_ETHPRIME		"FEC0"
 
include/configs/mx53loco.h +0 -1
index b026c6ff89f..8fd5dc8d05a 100644
@@ -146,6 +146,5 @@
 #endif
 
 /* Framebuffer and LCD */
-#define CONFIG_VIDEO_LOGO
 
 #endif				/* __CONFIG_H */
include/configs/mx6cuboxi.h +0 -1
index da2533637b0..7d3e651f44d 100644
@@ -25,7 +25,6 @@
 #endif
 
 /* Framebuffer */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
include/configs/mx6sabre_common.h +0 -1
index 51f6b3ac462..97109032bbb 100644
@@ -167,7 +167,6 @@
 /* Environment organization */
 
 /* Framebuffer */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
include/configs/mx6sxsabresd.h +0 -1
index a554011d75d..1eca81ad073 100644
@@ -161,7 +161,6 @@
 
 #ifndef CONFIG_SPL_BUILD
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define MXS_LCDIF_BASE MX6SX_LCDIF1_BASE_ADDR
 #endif
include/configs/mx6ul_14x14_evk.h +0 -1
index 0b777fbbdc0..987f6cb1b63 100644
@@ -165,7 +165,6 @@
 
 #ifndef CONFIG_SPL_BUILD
 #if defined(CONFIG_DM_VIDEO)
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 #endif
include/configs/mx7dsabresd.h +0 -1
index f11e2e3f807..f0ed44cc496 100644
@@ -125,7 +125,6 @@
 #define CONFIG_USBD_HS
 
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #endif
 
include/configs/nokia_rx51.h +0 -1
index b37e05406e9..afb91d96a54 100644
@@ -75,7 +75,6 @@
  * Framebuffer
  */
 /* Video console */
-#define CONFIG_VIDEO_LOGO
 #define VIDEO_FB_16BPP_PIXEL_SWAP
 #define VIDEO_FB_16BPP_WORD_SWAP
 
include/configs/novena.h +0 -1
index 28fb1b8d753..ec192c5eecb 100644
@@ -87,7 +87,6 @@
 #endif
 
 /* Video output */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
 
include/configs/opos6uldev.h +0 -1
index d9311a49350..ad2d3ce29e3 100644
@@ -41,7 +41,6 @@
 /* LCD */
 #ifndef CONFIG_SPL_BUILD
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 #endif
include/configs/pico-imx6.h +0 -1
index 2528d319d1f..19955623b7f 100644
@@ -136,7 +136,6 @@
 #define CONFIG_FEC_MXC_PHYADDR		1
 
 /* Framebuffer */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
include/configs/pico-imx6ul.h +0 -1
index 3fe178316f7..442dd2a0fb5 100644
@@ -133,7 +133,6 @@
 #define CONFIG_BOARD_SIZE_LIMIT		715776
 
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 #endif
include/configs/pico-imx7d.h +0 -1
index cbac9505492..253283aab26 100644
@@ -124,7 +124,6 @@
 #define CONFIG_POWER_PFUZE3000_I2C_ADDR	0x08
 
 #ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #endif
 
include/configs/pxm2.h +0 -1
index a333326dff6..498932dcfd7 100644
@@ -108,7 +108,6 @@
 
 #if defined(CONFIG_VIDEO)
 #define CONFIG_VIDEO_DA8XX
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define DA8XX_LCD_CNTL_BASE	LCD_CNTL_BASE
 #define PWM_TICKS	0x1388
include/configs/rut.h +0 -1
index 68d68d084d2..b1bf0c23a3c 100644
@@ -97,7 +97,6 @@
 
 #if defined(CONFIG_VIDEO)
 #define CONFIG_VIDEO_DA8XX
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define DA8XX_LCD_CNTL_BASE	LCD_CNTL_BASE
 
include/configs/s5p4418_nanopi2.h +0 -2
index 2e94613c37a..1b1b2bfb67a 100644
@@ -131,8 +131,6 @@
  * VIDEO
  */
 
-#define CONFIG_VIDEO_LOGO
-
 #ifdef CONFIG_VIDEO_LOGO
 #ifdef CONFIG_SPLASH_SCREEN
 #define SPLASH_FILE			logo.bmp
include/configs/wandboard.h +0 -1
index ece762e512d..051c18ca232 100644
@@ -32,7 +32,6 @@
 #define CONFIG_MXC_USB_FLAGS		0
 
 /* Framebuffer */
-#define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
scripts/config_whitelist.txt +0 -1
index b9c1c61e13d..5c4df1ebccb 100644
@@ -3052,7 +3052,6 @@ CONFIG_VIDEO_BCM2835
 CONFIG_VIDEO_BMP_LOGO
 CONFIG_VIDEO_DA8XX
 CONFIG_VIDEO_FONT_4X6
-CONFIG_VIDEO_LOGO
 CONFIG_VIDEO_MXS_MODE_SYSTEM
 CONFIG_VIDEO_STD_TIMINGS
 CONFIG_VID_FLS_ENV
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#18 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 10 lines · On Friday 19 November 2021 13:24:01 Simon Glass wrote:

This converts the following to Kconfig:
CONFIG_VIDEO_LOGO

Note that this option depends on CONFIG_DM_VIDEO now, since cfb_console is deprecated. The only relevant code is now in splash.c

Drop the check for DM_VIDEO in that file.

---

...

Quoted 1 line
 include/configs/nokia_rx51.h           | 1 -

...

include/configs/nokia_rx51.h line 79

Quoted 11 lines
include/configs/nokia_rx51.h +0 -1
index b37e05406e9..afb91d96a54 100644
@@ -75,7 +75,6 @@
  * Framebuffer
  */
 /* Video console */
-#define CONFIG_VIDEO_LOGO
 #define VIDEO_FB_16BPP_PIXEL_SWAP
 #define VIDEO_FB_16BPP_WORD_SWAP

Hello!

This change is now in master branch and it broke support for video logo on Nokia N900 :-( It does not work anymore and reason is because CONFIG_VIDEO_LOGO was removed from Nokia N900 config files completely, despite commit subject says CONFIG_VIDEO_LOGO was converted to Kconfig.

Seems that conversion for Nokia N900 is missing. Could you please look at this issue? It is visible also in qemu, so no real hardware is needed for reproducing it.

#19 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 28 lines · Pali Rohár
Quoted 10 lines · On Friday 19 November 2021 13:24:01 Simon Glass wrote:

This converts the following to Kconfig:
CONFIG_VIDEO_LOGO

Note that this option depends on CONFIG_DM_VIDEO now, since cfb_console is deprecated. The only relevant code is now in splash.c

Drop the check for DM_VIDEO in that file.

---

...

Quoted 1 line
 include/configs/nokia_rx51.h           | 1 -

...

include/configs/nokia_rx51.h line 79

Quoted 11 lines
include/configs/nokia_rx51.h +0 -1
index b37e05406e9..afb91d96a54 100644
@@ -75,7 +75,6 @@
  * Framebuffer
  */
 /* Video console */
-#define CONFIG_VIDEO_LOGO
 #define VIDEO_FB_16BPP_PIXEL_SWAP
 #define VIDEO_FB_16BPP_WORD_SWAP

Hello!

Quoted 8 lines

This change is now in master branch and it broke support for video logo on Nokia N900 :-( It does not work anymore and reason is because CONFIG_VIDEO_LOGO was removed from Nokia N900 config files completely, despite commit subject says CONFIG_VIDEO_LOGO was converted to Kconfig.

Seems that conversion for Nokia N900 is missing. Could you please look at this issue? It is visible also in qemu, so no real hardware is needed for reproducing it.

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Signature · 1 line
Tom
#20 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Adding other Maemo developers...

Quoted 2 lines · On Saturday 22 January 2022 10:29:34 Tom Rini wrote:

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Perhaps it is also a good/bad time for reminding that some N900 U-Boot patches are waiting for review on the list? :-)

#21 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 8 lines · Pali Rohár

Adding other Maemo developers...

Quoted 2 lines · On Saturday 22 January 2022 10:29:34 Tom Rini wrote:

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Perhaps it is also a good/bad time for reminding that some N900 U-Boot patches are waiting for review on the list? :-)

The last ones I saw weren't clear what it depended on and should get re-posted. But I didn't see anything about the USB DM conversion.

Signature · 1 line
Tom
#22 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 4 lines · On Saturday 22 January 2022 13:41:01 Tom Rini wrote:
Quoted 3 lines · Pali Rohár

Adding other Maemo developers...

On Saturday 22 January 2022 10:29:34 Tom Rini wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Perhaps it is also a good/bad time for reminding that some N900 U-Boot patches are waiting for review on the list? :-)

The last ones I saw weren't clear what it depended on and should get re-posted.

And how should I or anybody else know this if nobody is responding to emails asking for review of pending patches?

Quoted 1 line

But I didn't see anything about the USB DM conversion.

Of course, as there are waiting other patches and other emails without replies, it is not a wise idea to start working on something other or starting discussion about something totally new if existing things are waiting for maintainers...

I wanted to look at other stuff after pending patches are in accepted state. But I'm not superman to work on 10 parallel things at the same time and specially if I see that reviewing N900 patches is slow and takes about half of year.

If I see that maintainer is busy then I send just one patch and next after it is accepted. And not sending thousands of patches at the same time. If I would be in the "busy maintainer" position I also would not like to see thousands of patches waiting from other developers and rather would see one patch and after it is accepted then another patch.

So, could you please make a time and look at pending N900 patching? So we can move forward? I have feeling that this is repeating every year and the ball is not on my side.

For example I'm still waiting for reply for this email from July 2021:
https://lists.denx.de/pipermail/u-boot/2021-July/455710.html

And sending reminder for another patch in December 2021 has no reply too:
https://lists.denx.de/pipermail/u-boot/2021-December/468744.html

#23 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 8 lines · Pali Rohár
Quoted 7 lines · On Saturday 22 January 2022 13:41:01 Tom Rini wrote:
Quoted 6 lines · Pali Rohár

Adding other Maemo developers...

Quoted 2 lines · On Saturday 22 January 2022 10:29:34 Tom Rini wrote:

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Perhaps it is also a good/bad time for reminding that some N900 U-Boot patches are waiting for review on the list? :-)

The last ones I saw weren't clear what it depended on and should get re-posted.

And how should I or anybody else know this if nobody is responding to emails asking for review of pending patches?

I thought the last time you ping'd on it Lokesh was confused about what this was on top of / required.

Quoted 6 lines
Quoted 1 line

But I didn't see anything about the USB DM conversion.

Of course, as there are waiting other patches and other emails without replies, it is not a wise idea to start working on something other or starting discussion about something totally new if existing things are waiting for maintainers...

I believe it was someone else that is interested in N900 that said they would look at it.

Quoted 15 lines

I wanted to look at other stuff after pending patches are in accepted state. But I'm not superman to work on 10 parallel things at the same time and specially if I see that reviewing N900 patches is slow and takes about half of year.

If I see that maintainer is busy then I send just one patch and next after it is accepted. And not sending thousands of patches at the same time. If I would be in the "busy maintainer" position I also would not like to see thousands of patches waiting from other developers and rather would see one patch and after it is accepted then another patch.

So, could you please make a time and look at pending N900 patching? So we can move forward? I have feeling that this is repeating every year and the ball is not on my side.

Quoted 5 lines

For example I'm still waiting for reply for this email from July 2021:
https://lists.denx.de/pipermail/u-boot/2021-July/455710.html

And sending reminder for another patch in December 2021 has no reply too:
https://lists.denx.de/pipermail/u-boot/2021-December/468744.html

My problem is that re-reading those threads again just now leaves me at "please re-base and re-post everything because it wasn't clear at all what goes where". My only other feedback is that it would I think be better to move and then update the documentation, not improve, migrate, improve more.

Signature · 1 line
Tom
#24 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 12 lines · On Sunday 23 January 2022 09:54:02 Tom Rini wrote:
Quoted 11 lines · Pali Rohár
Quoted 10 lines · On Saturday 22 January 2022 13:41:01 Tom Rini wrote:
Quoted 8 lines · Pali Rohár

Adding other Maemo developers...

Quoted 2 lines · On Saturday 22 January 2022 10:29:34 Tom Rini wrote:

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Perhaps it is also a good/bad time for reminding that some N900 U-Boot patches are waiting for review on the list? :-)

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The last ones I saw weren't clear what it depended on and should get re-posted.

And how should I or anybody else know this if nobody is responding to emails asking for review of pending patches?

I thought the last time you ping'd on it Lokesh was confused about what this was on top of / required.

I think I sent info how to apply it. But as I have not received any reply even after reminding, how should I have know it?

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

But I didn't see anything about the USB DM conversion.

Of course, as there are waiting other patches and other emails without replies, it is not a wise idea to start working on something other or starting discussion about something totally new if existing things are waiting for maintainers...

I believe it was someone else that is interested in N900 that said they would look at it.

Yea, for USB it was Merlijn. He wrote me that would reply later to this thread. This thread started about video and not USB, so there is just big mix of things and I forgot about what we are talking here...

Quoted 18 lines
Quoted 18 lines

I wanted to look at other stuff after pending patches are in accepted state. But I'm not superman to work on 10 parallel things at the same time and specially if I see that reviewing N900 patches is slow and takes about half of year.

If I see that maintainer is busy then I send just one patch and next after it is accepted. And not sending thousands of patches at the same time. If I would be in the "busy maintainer" position I also would not like to see thousands of patches waiting from other developers and rather would see one patch and after it is accepted then another patch.

So, could you please make a time and look at pending N900 patching? So we can move forward? I have feeling that this is repeating every year and the ball is not on my side.

For example I'm still waiting for reply for this email from July 2021:
https://lists.denx.de/pipermail/u-boot/2021-July/455710.html

Quoted 8 lines
Quoted 2 lines

And sending reminder for another patch in December 2021 has no reply too:
https://lists.denx.de/pipermail/u-boot/2021-December/468744.html

My problem is that re-reading those threads again just now leaves me at "please re-base and re-post everything because it wasn't clear at all what goes where". My only other feedback is that it would I think be better to move and then update the documentation, not improve, migrate, improve more.

Ok, so I will resend patches. When would you have a time to review these patches? I do not want again to repeat situation that I will send a patch and after half of year I get reply that it does not apply on master and rebasing is needed. So please let me know when you would have a time for review of N900 so I would send patches at correct timing without need from my side to rebase and rebase patches again and again... because this is really annoying for me and also wasting of time ... and it happened with more N900 patch in last 2 years.

#25 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 16 lines · Pali Rohár
Quoted 15 lines · On Sunday 23 January 2022 09:54:02 Tom Rini wrote:
Quoted 14 lines · Pali Rohár
Quoted 12 lines · On Saturday 22 January 2022 13:41:01 Tom Rini wrote:
Quoted 8 lines · Pali Rohár

Adding other Maemo developers...

Quoted 2 lines · On Saturday 22 January 2022 10:29:34 Tom Rini wrote:

This is perhaps as good/bad time as any to ask about the conversion efforts for N900 USB things that were discussed before?

Perhaps it is also a good/bad time for reminding that some N900 U-Boot patches are waiting for review on the list? :-)

The last ones I saw weren't clear what it depended on and should get re-posted.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

And how should I or anybody else know this if nobody is responding to emails asking for review of pending patches?

I thought the last time you ping'd on it Lokesh was confused about what this was on top of / required.

I think I sent info how to apply it. But as I have not received any reply even after reminding, how should I have know it?

Other people re-base and re-post, or ping more often.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

But I didn't see anything about the USB DM conversion.

Of course, as there are waiting other patches and other emails without replies, it is not a wise idea to start working on something other or starting discussion about something totally new if existing things are waiting for maintainers...

Quoted 6 lines
Quoted 2 lines

I believe it was someone else that is interested in N900 that said they would look at it.

Yea, for USB it was Merlijn. He wrote me that would reply later to this thread. This thread started about video and not USB, so there is just big mix of things and I forgot about what we are talking here...

Thanks.

Quoted 27 lines
Quoted 18 lines
Quoted 18 lines

I wanted to look at other stuff after pending patches are in accepted state. But I'm not superman to work on 10 parallel things at the same time and specially if I see that reviewing N900 patches is slow and takes about half of year.

If I see that maintainer is busy then I send just one patch and next after it is accepted. And not sending thousands of patches at the same time. If I would be in the "busy maintainer" position I also would not like to see thousands of patches waiting from other developers and rather would see one patch and after it is accepted then another patch.

So, could you please make a time and look at pending N900 patching? So we can move forward? I have feeling that this is repeating every year and the ball is not on my side.

For example I'm still waiting for reply for this email from July 2021:
https://lists.denx.de/pipermail/u-boot/2021-July/455710.html

Quoted 8 lines
Quoted 2 lines

And sending reminder for another patch in December 2021 has no reply too:
https://lists.denx.de/pipermail/u-boot/2021-December/468744.html

My problem is that re-reading those threads again just now leaves me at "please re-base and re-post everything because it wasn't clear at all what goes where". My only other feedback is that it would I think be better to move and then update the documentation, not improve, migrate, improve more.

Quoted 8 lines

Ok, so I will resend patches. When would you have a time to review these patches? I do not want again to repeat situation that I will send a patch and after half of year I get reply that it does not apply on master and rebasing is needed. So please let me know when you would have a time for review of N900 so I would send patches at correct timing without need from my side to rebase and rebase patches again and again... because this is really annoying for me and also wasting of time ... and it happened with more N900 patch in last 2 years.

Documentation patches will go to Heinrich and so long as "make htmldocs" passes, likely be picked up in short order. In general, yes, things will get picked up in the usual cadence of U-Boot release cycles. These particular patches got stuck because of unclear / non-obvious apply order and also Lokesh having been a bit overloaded (I suspect).

Signature · 1 line
Tom
#26 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

In reply to Pali Rohár

Hi Pali, Tom, Simon,

Quoted 7 lines · Pali Rohár
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

But I didn't see anything about the USB DM conversion.

Of course, as there are waiting other patches and other emails without replies, it is not a wise idea to start working on something other or starting discussion about something totally new if existing things are waiting for maintainers...

Quoted 6 lines
Quoted 2 lines

I believe it was someone else that is interested in N900 that said they would look at it.

Yea, for USB it was Merlijn. He wrote me that would reply later to this thread. This thread started about video and not USB, so there is just big mix of things and I forgot about what we are talking here...

I have a tight deadline in the next two weeks, but after that I can pick up this work (USB DM conversion for the N900). I assume it won't take much more than a week or two to then get this ready, so let's say I can try to send a RFC patch by mid February? Does that block/conflict u-boot release/merge planning? If sooner is required, please let me know and I'll try my best to accommodate that somehow.

Regards,
Merlijn

#27 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

Quoted 18 lines · Merlijn Wajer

Hi Pali, Tom, Simon,

Quoted 7 lines · Pali Rohár
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

But I didn't see anything about the USB DM conversion.

Of course, as there are waiting other patches and other emails without replies, it is not a wise idea to start working on something other or starting discussion about something totally new if existing things are waiting for maintainers...

Quoted 6 lines
Quoted 2 lines

I believe it was someone else that is interested in N900 that said they would look at it.

Yea, for USB it was Merlijn. He wrote me that would reply later to this thread. This thread started about video and not USB, so there is just big mix of things and I forgot about what we are talking here...

Quoted 6 lines

I have a tight deadline in the next two weeks, but after that I can pick up this work (USB DM conversion for the N900). I assume it won't take much more than a week or two to then get this ready, so let's say I can try to send a RFC patch by mid February? Does that block/conflict u-boot release/merge planning? If sooner is required, please let me know and I'll try my best to accommodate that somehow.

That timing is probably fine, but please speak up if you're not able to pick up the work again when you expect to as that sounds about like what you said for having things around November? But stuff comes up and I understand that. Thanks.

Signature · 1 line
Tom
#28 lore raw

Re: [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig

In reply to Pali Rohár

Hi Pali,

Quoted 29 lines · Pali Rohár
Quoted 10 lines · On Friday 19 November 2021 13:24:01 Simon Glass wrote:

This converts the following to Kconfig:
CONFIG_VIDEO_LOGO

Note that this option depends on CONFIG_DM_VIDEO now, since cfb_console is deprecated. The only relevant code is now in splash.c

Drop the check for DM_VIDEO in that file.

---

...

Quoted 1 line
 include/configs/nokia_rx51.h           | 1 -

...

include/configs/nokia_rx51.h line 79

Quoted 11 lines
include/configs/nokia_rx51.h +0 -1
index b37e05406e9..afb91d96a54 100644
@@ -75,7 +75,6 @@
  * Framebuffer
  */
 /* Video console */
-#define CONFIG_VIDEO_LOGO
 #define VIDEO_FB_16BPP_PIXEL_SWAP
 #define VIDEO_FB_16BPP_WORD_SWAP

Hello!

Quoted 8 lines

This change is now in master branch and it broke support for video logo on Nokia N900 :-( It does not work anymore and reason is because CONFIG_VIDEO_LOGO was removed from Nokia N900 config files completely, despite commit subject says CONFIG_VIDEO_LOGO was converted to Kconfig.

Seems that conversion for Nokia N900 is missing. Could you please look at this issue? It is visible also in qemu, so no real hardware is needed for reproducing it.

I believe this is because you need to move to DM_VIDEO. Everything else has, I believe, which is why the migration messages have been dropped.

+Anatolij Gustschin is looking at removing lcd.c and cfb_console.c I think?

Regards,
Simon

#29 lore raw

PATCH 18/23 video: Drop VIDEO_LOGO from cfb_console

In reply to Simon Glass

This driver is obsolete and only used by nokia_rx51. It should be deleted. For now, drop the VIDEO_LOGO code to avoid confusion with the new implementation.

---

 drivers/video/cfb_console.c | 325 +-----------------------------------
 1 file changed, 1 insertion(+), 324 deletions(-)
drivers/video/cfb_console.c +1 -324
index 7df7d57e6ec..52b109f1551 100644
@@ -42,11 +42,6 @@
  * VIDEO_TSTC_FCT	      - keyboard_tstc function
  * VIDEO_GETC_FCT	      - keyboard_getc function
  *
- * CONFIG_VIDEO_LOGO	      - display Linux Logo in upper left corner.
- *				Use CONFIG_SPLASH_SCREEN_ALIGN with
- *				environment variable "splashpos" to place
- *				the logo on other position. In this case
- *				no CONSOLE_EXTRA_INFO is possible.
  * CONFIG_VIDEO_BMP_LOGO      - use bmp_logo instead of linux_logo
  * CONFIG_CONSOLE_EXTRA_INFO  - display additional board information
  *				strings that normaly goes to serial
@@ -127,34 +122,6 @@ void console_cursor(int state);
 #define CURSOR_SET video_set_cursor()
 #endif /* CONFIG_VIDEO_SW_CURSOR */
 
-#ifdef	CONFIG_VIDEO_LOGO
-#ifdef	CONFIG_VIDEO_BMP_LOGO
-#include <bmp_logo.h>
-#include <bmp_logo_data.h>
-#define VIDEO_LOGO_WIDTH	BMP_LOGO_WIDTH
-#define VIDEO_LOGO_HEIGHT	BMP_LOGO_HEIGHT
-#define VIDEO_LOGO_LUT_OFFSET	BMP_LOGO_OFFSET
-#define VIDEO_LOGO_COLORS	BMP_LOGO_COLORS
-
-#else  /* CONFIG_VIDEO_BMP_LOGO */
-#define LINUX_LOGO_WIDTH	80
-#define LINUX_LOGO_HEIGHT	80
-#define LINUX_LOGO_COLORS	214
-#define LINUX_LOGO_LUT_OFFSET	0x20
-#define __initdata
-#include <linux_logo.h>
-#define VIDEO_LOGO_WIDTH	LINUX_LOGO_WIDTH
-#define VIDEO_LOGO_HEIGHT	LINUX_LOGO_HEIGHT
-#define VIDEO_LOGO_LUT_OFFSET	LINUX_LOGO_LUT_OFFSET
-#define VIDEO_LOGO_COLORS	LINUX_LOGO_COLORS
-#endif /* CONFIG_VIDEO_BMP_LOGO */
-#define VIDEO_INFO_X		(VIDEO_LOGO_WIDTH)
-#define VIDEO_INFO_Y		(VIDEO_FONT_HEIGHT/2)
-#else  /* CONFIG_VIDEO_LOGO */
-#define VIDEO_LOGO_WIDTH	0
-#define VIDEO_LOGO_HEIGHT	0
-#endif /* CONFIG_VIDEO_LOGO */
-
 #define VIDEO_COLS		VIDEO_VISIBLE_COLS
 #define VIDEO_ROWS		VIDEO_VISIBLE_ROWS
 #ifndef VIDEO_LINE_LEN
@@ -163,11 +130,7 @@ void console_cursor(int state);
 #define VIDEO_SIZE		(VIDEO_ROWS * VIDEO_LINE_LEN)
 #define VIDEO_BURST_LEN		(VIDEO_COLS/8)
 
-#ifdef	CONFIG_VIDEO_LOGO
-#define CONSOLE_ROWS		((VIDEO_ROWS - video_logo_height) / VIDEO_FONT_HEIGHT)
-#else
 #define CONSOLE_ROWS		(VIDEO_ROWS / VIDEO_FONT_HEIGHT)
-#endif
 
 #define CONSOLE_COLS		(VIDEO_COLS / VIDEO_FONT_WIDTH)
 #define CONSOLE_ROW_SIZE	(VIDEO_FONT_HEIGHT * VIDEO_LINE_LEN)
@@ -214,7 +177,7 @@ static GraphicDevice *pGD;	/* Pointer to Graphic array */
 static void *video_fb_address;	/* frame buffer address */
 static void *video_console_address;	/* console buffer start address */
 
-static int video_logo_height = VIDEO_LOGO_HEIGHT;
+static int video_logo_height;		/* not supported anymore */
 
 static int __maybe_unused cursor_state;
 static int __maybe_unused old_col;
@@ -1670,292 +1633,6 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
-
-#ifdef CONFIG_VIDEO_LOGO
-static int video_logo_xpos;
-static int video_logo_ypos;
-
-static void plot_logo_or_black(void *screen, int x, int y, int black);
-
-static void logo_plot(void *screen, int x, int y)
-{
-	plot_logo_or_black(screen, x, y, 0);
-}
-
-static void logo_black(void)
-{
-	plot_logo_or_black(video_fb_address, video_logo_xpos, video_logo_ypos,
-			1);
-}
-
-static int do_clrlogo(struct cmd_tbl *cmdtp, int flag, int argc,
-		      char *const argv[])
-{
-	if (argc != 1)
-		return cmd_usage(cmdtp);
-
-	logo_black();
-	return 0;
-}
-
-U_BOOT_CMD(
-	   clrlogo, 1, 0, do_clrlogo,
-	   "fill the boot logo area with black",
-	   " "
-	   );
-
-static void plot_logo_or_black(void *screen, int x, int y, int black)
-{
-
-	int xcount, i;
-	int skip = VIDEO_LINE_LEN - VIDEO_LOGO_WIDTH * VIDEO_PIXEL_SIZE;
-	int ycount = video_logo_height;
-	unsigned char r, g, b, *logo_red, *logo_blue, *logo_green;
-	unsigned char *source;
-	unsigned char *dest;
-
-#ifdef CONFIG_SPLASH_SCREEN_ALIGN
-	if (x == BMP_ALIGN_CENTER)
-		x = max(0, (int)(VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH) / 2);
-	else if (x < 0)
-		x = max(0, (int)(VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH + x + 1));
-
-	if (y == BMP_ALIGN_CENTER)
-		y = max(0, (int)(VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT) / 2);
-	else if (y < 0)
-		y = max(0, (int)(VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT + y + 1));
-#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
-
-	dest = (unsigned char *)screen + y * VIDEO_LINE_LEN + x * VIDEO_PIXEL_SIZE;
-
-#ifdef CONFIG_VIDEO_BMP_LOGO
-	source = bmp_logo_bitmap;
-
-	/* Allocate temporary space for computing colormap */
-	logo_red = malloc(BMP_LOGO_COLORS);
-	logo_green = malloc(BMP_LOGO_COLORS);
-	logo_blue = malloc(BMP_LOGO_COLORS);
-	/* Compute color map */
-	for (i = 0; i < VIDEO_LOGO_COLORS; i++) {
-		logo_red[i] = (bmp_logo_palette[i] & 0x0f00) >> 4;
-		logo_green[i] = (bmp_logo_palette[i] & 0x00f0);
-		logo_blue[i] = (bmp_logo_palette[i] & 0x000f) << 4;
-	}
-#else
-	source = linux_logo;
-	logo_red = linux_logo_red;
-	logo_green = linux_logo_green;
-	logo_blue = linux_logo_blue;
-#endif
-
-	if (VIDEO_DATA_FORMAT == GDF__8BIT_INDEX) {
-		for (i = 0; i < VIDEO_LOGO_COLORS; i++) {
-			video_set_lut(i + VIDEO_LOGO_LUT_OFFSET,
-				      logo_red[i], logo_green[i],
-				      logo_blue[i]);
-		}
-	}
-
-	while (ycount--) {
-#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
-		int xpos = x;
-#endif
-		xcount = VIDEO_LOGO_WIDTH;
-		while (xcount--) {
-			if (black) {
-				r = 0x00;
-				g = 0x00;
-				b = 0x00;
-			} else {
-				r = logo_red[*source - VIDEO_LOGO_LUT_OFFSET];
-				g = logo_green[*source - VIDEO_LOGO_LUT_OFFSET];
-				b = logo_blue[*source - VIDEO_LOGO_LUT_OFFSET];
-			}
-
-			switch (VIDEO_DATA_FORMAT) {
-			case GDF__8BIT_INDEX:
-				*dest = *source;
-				break;
-			case GDF__8BIT_332RGB:
-				*dest = ((r >> 5) << 5) |
-					((g >> 5) << 2) |
-					 (b >> 6);
-				break;
-			case GDF_15BIT_555RGB:
-#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
-				fill_555rgb_pswap(dest, xpos++, r, g, b);
-#else
-				*(unsigned short *) dest =
-					SWAP16((unsigned short) (
-							((r >> 3) << 10) |
-							((g >> 3) <<  5) |
-							 (b >> 3)));
-#endif
-				break;
-			case GDF_16BIT_565RGB:
-				*(unsigned short *) dest =
-					SWAP16((unsigned short) (
-							((r >> 3) << 11) |
-							((g >> 2) <<  5) |
-							 (b >> 3)));
-				break;
-			case GDF_32BIT_X888RGB:
-				*(u32 *) dest =
-					SWAP32((u32) (
-							(r << 16) |
-							(g <<  8) |
-							 b));
-				break;
-			case GDF_24BIT_888RGB:
-#ifdef VIDEO_FB_LITTLE_ENDIAN
-				dest[0] = b;
-				dest[1] = g;
-				dest[2] = r;
-#else
-				dest[0] = r;
-				dest[1] = g;
-				dest[2] = b;
-#endif
-				break;
-			}
-			source++;
-			dest += VIDEO_PIXEL_SIZE;
-		}
-		dest += skip;
-	}
-#ifdef CONFIG_VIDEO_BMP_LOGO
-	free(logo_red);
-	free(logo_green);
-	free(logo_blue);
-#endif
-}
-
-static void *video_logo(void)
-{
-	char info[128];
-	__maybe_unused int y_off = 0;
-	__maybe_unused ulong addr;
-	__maybe_unused char *s;
-	__maybe_unused int len, ret, space;
-
-	splash_get_pos(&video_logo_xpos, &video_logo_ypos);
-
-#ifdef CONFIG_SPLASH_SCREEN
-	s = env_get("splashimage");
-	if (s != NULL) {
-		ret = splash_screen_prepare();
-		if (ret < 0)
-			return video_fb_address;
-		addr = hextoul(s, NULL);
-
-		if (video_display_bitmap(addr,
-					video_logo_xpos,
-					video_logo_ypos) == 0) {
-			video_logo_height = 0;
-			return ((void *) (video_fb_address));
-		}
-	}
-#endif /* CONFIG_SPLASH_SCREEN */
-
-	logo_plot(video_fb_address, video_logo_xpos, video_logo_ypos);
-
-#ifdef CONFIG_SPLASH_SCREEN_ALIGN
-	/*
-	 * when using splashpos for video_logo, skip any info
-	 * output on video console if the logo is not at 0,0
-	 */
-	if (video_logo_xpos || video_logo_ypos) {
-		/*
-		 * video_logo_height is used in text and cursor offset
-		 * calculations. Since the console is below the logo,
-		 * we need to adjust the logo height
-		 */
-		if (video_logo_ypos == BMP_ALIGN_CENTER)
-			video_logo_height += max(0, (int)(VIDEO_VISIBLE_ROWS -
-						     VIDEO_LOGO_HEIGHT) / 2);
-		else if (video_logo_ypos > 0)
-			video_logo_height += video_logo_ypos;
-
-		return video_fb_address + video_logo_height * VIDEO_LINE_LEN;
-	}
-#endif
-	if (board_cfb_skip())
-		return 0;
-
-	sprintf(info, " %s", version_string);
-
-#ifndef CONFIG_HIDE_LOGO_VERSION
-	space = (VIDEO_COLS - VIDEO_INFO_X) / VIDEO_FONT_WIDTH;
-	len = strlen(info);
-
-	if (len > space) {
-		int xx = VIDEO_INFO_X, yy = VIDEO_INFO_Y;
-		uchar *p = (uchar *) info;
-
-		while (len) {
-			if (len > space) {
-				video_drawchars(xx, yy, p, space);
-				len -= space;
-
-				p = (uchar *)p + space;
-
-				if (!y_off) {
-					xx += VIDEO_FONT_WIDTH;
-					space--;
-				}
-				yy += VIDEO_FONT_HEIGHT;
-
-				y_off++;
-			} else {
-				video_drawchars(xx, yy, p, len);
-				len = 0;
-			}
-		}
-	} else
-		video_drawstring(VIDEO_INFO_X, VIDEO_INFO_Y, (uchar *) info);
-
-#ifdef CONFIG_CONSOLE_EXTRA_INFO
-	{
-		int i, n =
-			((video_logo_height -
-			  VIDEO_FONT_HEIGHT) / VIDEO_FONT_HEIGHT);
-
-		for (i = 1; i < n; i++) {
-			video_get_info_str(i, info);
-			if (!*info)
-				continue;
-
-			len = strlen(info);
-			if (len > space) {
-				video_drawchars(VIDEO_INFO_X,
-						VIDEO_INFO_Y +
-						(i + y_off) *
-							VIDEO_FONT_HEIGHT,
-						(uchar *) info, space);
-				y_off++;
-				video_drawchars(VIDEO_INFO_X +
-						VIDEO_FONT_WIDTH,
-						VIDEO_INFO_Y +
-							(i + y_off) *
-							VIDEO_FONT_HEIGHT,
-						(uchar *) info + space,
-						len - space);
-			} else {
-				video_drawstring(VIDEO_INFO_X,
-						 VIDEO_INFO_Y +
-						 (i + y_off) *
-							VIDEO_FONT_HEIGHT,
-						 (uchar *) info);
-			}
-		}
-	}
-#endif
-#endif
-
-	return (video_fb_address + video_logo_height * VIDEO_LINE_LEN);
-}
-#endif
-
 static int cfb_fb_is_in_dram(void)
 {
 	struct bd_info *bd = gd->bd;
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#30 lore raw

PATCH 19/23 video: Support showing the U-Boot logo

In reply to Simon Glass

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.

---

 drivers/video/Kconfig         |   1 +
 drivers/video/Makefile        |   3 +++
 drivers/video/sandbox_sdl.c   |   2 ++
 drivers/video/u_boot_logo.bmp | Bin 0 -> 6932 bytes
 drivers/video/video-uclass.c  |  26 ++++++++++++++++++++
 include/video.h               |   2 ++
 scripts/Makefile.lib          |  21 +++++++++++++++++
 test/dm/video.c               |  43 +++++++++++++++++++++++++++-------
 8 files changed, 89 insertions(+), 9 deletions(-)
 create mode 100644 drivers/video/u_boot_logo.bmp
drivers/video/Kconfig +1 -0
index 7a73ecc1f40..e601b47806b 100644
@@ -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
drivers/video/Makefile +3 -0
index 8956b5f9b00..4038395b128 100644
@@ -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/
drivers/video/sandbox_sdl.c +2 -0
index 2afe66fab1a..9081c7da62e 100644
@@ -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);
drivers/video/u_boot_logo.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..47f1e9b99789584d2f6dd71e954b51927b35d783
GIT binary patch
drivers/video/video-uclass.c +26 -0
index fafd05e373f..feed9c9a949 100644
@@ -305,6 +305,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)
 {
@@ -370,6 +388,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;
 };
 
include/video.h +2 -0
index 6948cdf5796..59c9d9c18ca 100644
@@ -30,12 +30,14 @@ struct udevice;
  * @base: Base address of frame buffer, 0 if not yet known
  * @copy_base: Base address of a hardware copy of the frame buffer. See
  *	CONFIG_VIDEO_COPY.
+ * @hide_logo: Hide the logo (used for testing)
  */
 struct video_uc_plat {
 	uint align;
 	uint size;
 	ulong base;
 	ulong copy_base;
+	bool hide_logo;
 };
 
 enum video_polarity {
scripts/Makefile.lib +21 -0
index 39f03398ed8..06cc2d938db 100644
@@ -372,6 +372,27 @@ cmd_S_ttf=						\
 $(obj)/%.S: $(src)/%.ttf
 	$(call cmd,S_ttf)
 
+# Splash logos
+# ---------------------------------------------------------------------------
+
+# Generate an assembly file to wrap the splash data
+quiet_cmd_S_splash= TTF     $@
+# Modified for U-Boot
+cmd_S_splash=						\
+(							\
+	echo '.section .rodata.splash.init,"a"';		\
+	echo '.balign 16';				\
+	echo '.global __splash_$(*F)_begin';		\
+	echo '__splash_$(*F)_begin:';			\
+	echo '.incbin "$<" ';				\
+	echo '__splash_$(*F)_end:';			\
+	echo '.global __splash_$(*F)_end';			\
+	echo '.balign 16';				\
+) > $@
+
+$(obj)/%.S: $(src)/%.bmp
+	$(call cmd,S_splash)
+
 # EFI applications
 # A Makefile target *.efi is built as EFI application.
 # A Makefile target *_efi.S wraps *.efi as built-in EFI application.
test/dm/video.c +34 -9

103 lines not on this page · raw message

Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#31 lore raw

Re: [PATCH 19/23] video: Support showing the U-Boot logo

Quoted 383 lines · Simon Glass

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.

---

 drivers/video/Kconfig         |   1 +
 drivers/video/Makefile        |   3 +++
 drivers/video/sandbox_sdl.c   |   2 ++
 drivers/video/u_boot_logo.bmp | Bin 0 -> 6932 bytes
 drivers/video/video-uclass.c  |  26 ++++++++++++++++++++
 include/video.h               |   2 ++
 scripts/Makefile.lib          |  21 +++++++++++++++++
 test/dm/video.c               |  43 +++++++++++++++++++++++++++-------
 8 files changed, 89 insertions(+), 9 deletions(-)
 create mode 100644 drivers/video/u_boot_logo.bmp
drivers/video/Kconfig +1 -0
index 7a73ecc1f40..e601b47806b 100644
@@ -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
drivers/video/Makefile +3 -0
index 8956b5f9b00..4038395b128 100644
@@ -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/
drivers/video/sandbox_sdl.c +2 -0
index 2afe66fab1a..9081c7da62e 100644
@@ -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);
drivers/video/u_boot_logo.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..47f1e9b99789584d2f6dd71e954b51927b35d783
GIT binary patch
drivers/video/video-uclass.c +26 -0
index fafd05e373f..feed9c9a949 100644
@@ -305,6 +305,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)
 {
@@ -370,6 +388,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;
 };
 
include/video.h +2 -0
index 6948cdf5796..59c9d9c18ca 100644
@@ -30,12 +30,14 @@ struct udevice;
  * @base: Base address of frame buffer, 0 if not yet known
  * @copy_base: Base address of a hardware copy of the frame buffer. See
  *     CONFIG_VIDEO_COPY.
+ * @hide_logo: Hide the logo (used for testing)
  */
 struct video_uc_plat {
        uint align;
        uint size;
        ulong base;
        ulong copy_base;
+       bool hide_logo;
 };
 
 enum video_polarity {
scripts/Makefile.lib +21 -0
index 39f03398ed8..06cc2d938db 100644
@@ -372,6 +372,27 @@ cmd_S_ttf=                                         \
 $(obj)/%.S: $(src)/%.ttf
        $(call cmd,S_ttf)
 
+# Splash logos
+# ---------------------------------------------------------------------------
+
+# Generate an assembly file to wrap the splash data
+quiet_cmd_S_splash= TTF     $@
+# Modified for U-Boot
+cmd_S_splash=                                          \
+(                                                      \
+       echo '.section .rodata.splash.init,"a"';                \
+       echo '.balign 16';                              \
+       echo '.global __splash_$(*F)_begin';            \
+       echo '__splash_$(*F)_begin:';                   \
+       echo '.incbin "$<" ';                           \
+       echo '__splash_$(*F)_end:';                     \
+       echo '.global __splash_$(*F)_end';                      \
+       echo '.balign 16';                              \
+) > $@
+
+$(obj)/%.S: $(src)/%.bmp
+       $(call cmd,S_splash)
+
 # EFI applications
 # A Makefile target *.efi is built as EFI application.
 # A Makefile target *_efi.S wraps *.efi as built-in EFI application.
test/dm/video.c +34 -10
index 4e76574a913..d4a3c9c6c17 100644
@@ -115,6 +115,31 @@ static int select_vidconsole(struct unit_test_state *uts, const char *drv_name)
        return 0;
 }
 
+/**
+ * video_get_nologo() - Disable the logo on the video device and return it
+ *
+ * @uts: Test state
+ * @devp: Returns video device
+ * @return 0 if OK, -ve on error
+ */
+static int video_get_nologo(struct unit_test_state *uts, struct udevice **devp)
+{
+       struct video_uc_plat *uc_plat;
+       struct udevice *dev;
+
+       ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+       ut_assertnonnull(dev);
+       uc_plat = dev_get_uclass_plat(dev);
+       uc_plat->hide_logo = true;
+
+       /* now probe it */
+       ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev));
+       ut_assertnonnull(dev);
+       *devp = dev;
+
+       return 0;
+}
+
 /* Test text output works on the video console */
 static int dm_test_video_text(struct unit_test_state *uts)
 {
@@ -125,7 +150,7 @@ static int dm_test_video_text(struct unit_test_state *uts)
 #define SCROLL_LINES   100
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_asserteq(46, compress_frame_buffer(uts, dev));
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
@@ -157,7 +182,7 @@ static int dm_test_video_chars(struct unit_test_state *uts)
        const char *test_string = "Well\b\b\b\bxhe is\r \n\ta very \amodest  \bman\n\t\tand Has much to\b\bto be modest about.";
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(466, compress_frame_buffer(uts, dev));
@@ -174,7 +199,7 @@ static int dm_test_video_ansi(struct unit_test_state *uts)
        struct udevice *dev, *con;
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
 
        /* reference clear: */
@@ -222,7 +247,7 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,
        plat = dev_get_plat(dev);
        plat->rot = rot;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        ut_asserteq(46, compress_frame_buffer(uts, dev));
 
@@ -311,7 +336,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts)
        struct udevice *dev;
        ulong addr;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
 
        ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
@@ -433,7 +458,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts)
        struct udevice *dev;
        ulong addr;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(read_file(uts, "tools/logos/denx-comp.bmp", &addr));
 
        ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
@@ -487,7 +512,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(12237, compress_frame_buffer(uts, dev));
@@ -508,7 +533,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
        plat = dev_get_plat(dev);
        plat->font_size = 100;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(35030, compress_frame_buffer(uts, dev));
@@ -529,7 +554,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
        plat = dev_get_plat(dev);
        plat->font_size = 100;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(29018, compress_frame_buffer(uts, dev));
--
Quoted 2 lines

2.34.0.rc2.393.gf8c9666880-goog

Simon,

I find that this patch enables the default U-Boot Logo in the top-right corner for gwventana_*_defconfig even though I have a custom splash-screen (so I see both).

I have the following in my defconfig:

$ grep -e "SPLASH\|LOGO" configs/gwventana_nand_defconfig
CONFIG_VIDEO_LOGO=y
CONFIG_SPLASH_SCREEN=y
CONFIG_SPLASH_SCREEN_ALIGN=y

If I disable VIDEO_LOGO I don't see either the U-Boot logo or my SPLASH_SCREEN. The commit log says "If SPLASH_SCREEN is enabled, it is not enabled by default, so as not to conflict with that feature." but I don't see where you do anything in this patch with SPLASH_SCREEN.

Ideas?

Best Regards,

Tim

#32 lore raw

Re: [PATCH 19/23] video: Support showing the U-Boot logo

Hi Tim,

Quoted 400 lines · Tim Harvey
Quoted 383 lines · Simon Glass

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.

---

 drivers/video/Kconfig         |   1 +
 drivers/video/Makefile        |   3 +++
 drivers/video/sandbox_sdl.c   |   2 ++
 drivers/video/u_boot_logo.bmp | Bin 0 -> 6932 bytes
 drivers/video/video-uclass.c  |  26 ++++++++++++++++++++
 include/video.h               |   2 ++
 scripts/Makefile.lib          |  21 +++++++++++++++++
 test/dm/video.c               |  43 +++++++++++++++++++++++++++-------
 8 files changed, 89 insertions(+), 9 deletions(-)
 create mode 100644 drivers/video/u_boot_logo.bmp
drivers/video/Kconfig +1 -0
index 7a73ecc1f40..e601b47806b 100644
@@ -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
drivers/video/Makefile +3 -0
index 8956b5f9b00..4038395b128 100644
@@ -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/
drivers/video/sandbox_sdl.c +2 -0
index 2afe66fab1a..9081c7da62e 100644
@@ -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);
drivers/video/u_boot_logo.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..47f1e9b99789584d2f6dd71e954b51927b35d783
GIT binary patch
drivers/video/video-uclass.c +26 -0
index fafd05e373f..feed9c9a949 100644
@@ -305,6 +305,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)
 {
@@ -370,6 +388,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;
 };
 
include/video.h +2 -0
index 6948cdf5796..59c9d9c18ca 100644
@@ -30,12 +30,14 @@ struct udevice;
  * @base: Base address of frame buffer, 0 if not yet known
  * @copy_base: Base address of a hardware copy of the frame buffer. See
  *     CONFIG_VIDEO_COPY.
+ * @hide_logo: Hide the logo (used for testing)
  */
 struct video_uc_plat {
        uint align;
        uint size;
        ulong base;
        ulong copy_base;
+       bool hide_logo;
 };
 
 enum video_polarity {
scripts/Makefile.lib +21 -0
index 39f03398ed8..06cc2d938db 100644
@@ -372,6 +372,27 @@ cmd_S_ttf=                                         \
 $(obj)/%.S: $(src)/%.ttf
        $(call cmd,S_ttf)
 
+# Splash logos
+# ---------------------------------------------------------------------------
+
+# Generate an assembly file to wrap the splash data
+quiet_cmd_S_splash= TTF     $@
+# Modified for U-Boot
+cmd_S_splash=                                          \
+(                                                      \
+       echo '.section .rodata.splash.init,"a"';                \
+       echo '.balign 16';                              \
+       echo '.global __splash_$(*F)_begin';            \
+       echo '__splash_$(*F)_begin:';                   \
+       echo '.incbin "$<" ';                           \
+       echo '__splash_$(*F)_end:';                     \
+       echo '.global __splash_$(*F)_end';                      \
+       echo '.balign 16';                              \
+) > $@
+
+$(obj)/%.S: $(src)/%.bmp
+       $(call cmd,S_splash)
+
 # EFI applications
 # A Makefile target *.efi is built as EFI application.
 # A Makefile target *_efi.S wraps *.efi as built-in EFI application.
test/dm/video.c +34 -10
index 4e76574a913..d4a3c9c6c17 100644
@@ -115,6 +115,31 @@ static int select_vidconsole(struct unit_test_state *uts, const char *drv_name)
        return 0;
 }
 
+/**
+ * video_get_nologo() - Disable the logo on the video device and return it
+ *
+ * @uts: Test state
+ * @devp: Returns video device
+ * @return 0 if OK, -ve on error
+ */
+static int video_get_nologo(struct unit_test_state *uts, struct udevice **devp)
+{
+       struct video_uc_plat *uc_plat;
+       struct udevice *dev;
+
+       ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+       ut_assertnonnull(dev);
+       uc_plat = dev_get_uclass_plat(dev);
+       uc_plat->hide_logo = true;
+
+       /* now probe it */
+       ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev));
+       ut_assertnonnull(dev);
+       *devp = dev;
+
+       return 0;
+}
+
 /* Test text output works on the video console */
 static int dm_test_video_text(struct unit_test_state *uts)
 {
@@ -125,7 +150,7 @@ static int dm_test_video_text(struct unit_test_state *uts)
 #define SCROLL_LINES   100
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_asserteq(46, compress_frame_buffer(uts, dev));
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
@@ -157,7 +182,7 @@ static int dm_test_video_chars(struct unit_test_state *uts)
        const char *test_string = "Well\b\b\b\bxhe is\r \n\ta very \amodest  \bman\n\t\tand Has much to\b\bto be modest about.";
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(466, compress_frame_buffer(uts, dev));
@@ -174,7 +199,7 @@ static int dm_test_video_ansi(struct unit_test_state *uts)
        struct udevice *dev, *con;
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
 
        /* reference clear: */
@@ -222,7 +247,7 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,
        plat = dev_get_plat(dev);
        plat->rot = rot;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        ut_asserteq(46, compress_frame_buffer(uts, dev));
 
@@ -311,7 +336,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts)
        struct udevice *dev;
        ulong addr;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
 
        ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
@@ -433,7 +458,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts)
        struct udevice *dev;
        ulong addr;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(read_file(uts, "tools/logos/denx-comp.bmp", &addr));
 
        ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
@@ -487,7 +512,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(12237, compress_frame_buffer(uts, dev));
@@ -508,7 +533,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
        plat = dev_get_plat(dev);
        plat->font_size = 100;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(35030, compress_frame_buffer(uts, dev));
@@ -529,7 +554,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
        plat = dev_get_plat(dev);
        plat->font_size = 100;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(29018, compress_frame_buffer(uts, dev));
--
Quoted 2 lines

2.34.0.rc2.393.gf8c9666880-goog

Simon,

I find that this patch enables the default U-Boot Logo in the top-right corner for gwventana_*_defconfig even though I have a custom splash-screen (so I see both).

I have the following in my defconfig:

$ grep -e "SPLASH\|LOGO" configs/gwventana_nand_defconfig
CONFIG_VIDEO_LOGO=y
CONFIG_SPLASH_SCREEN=y
CONFIG_SPLASH_SCREEN_ALIGN=y
Quoted 4 lines

If I disable VIDEO_LOGO I don't see either the U-Boot logo or my SPLASH_SCREEN. The commit log says "If SPLASH_SCREEN is enabled, it is not enabled by default, so as not to conflict with that feature." but I don't see where you do anything in this patch with SPLASH_SCREEN.

I just mean in the Kconfig:

config VIDEO_LOGO
bool "Show the U-Boot logo on the display"
depends on DM_VIDEO
default y if !SPLASH_SCREEN

             ^^^^^

So if you enable both of them, you will get both, but by default VIDEO_LOGO should be enabled only if SPLASH_SCREEN is not enabled.

The splash code needs a rework too, I think. I just didn't get that far.

Regards,
Simon

#33 lore raw

Re: [PATCH 19/23] video: Support showing the U-Boot logo

Quoted 417 lines · Simon Glass

Hi Tim,

Quoted 400 lines · Tim Harvey
Quoted 383 lines · Simon Glass

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.

---

 drivers/video/Kconfig         |   1 +
 drivers/video/Makefile        |   3 +++
 drivers/video/sandbox_sdl.c   |   2 ++
 drivers/video/u_boot_logo.bmp | Bin 0 -> 6932 bytes
 drivers/video/video-uclass.c  |  26 ++++++++++++++++++++
 include/video.h               |   2 ++
 scripts/Makefile.lib          |  21 +++++++++++++++++
 test/dm/video.c               |  43 +++++++++++++++++++++++++++-------
 8 files changed, 89 insertions(+), 9 deletions(-)
 create mode 100644 drivers/video/u_boot_logo.bmp
drivers/video/Kconfig +1 -0
index 7a73ecc1f40..e601b47806b 100644
@@ -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
drivers/video/Makefile +3 -0
index 8956b5f9b00..4038395b128 100644
@@ -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/
drivers/video/sandbox_sdl.c +2 -0
index 2afe66fab1a..9081c7da62e 100644
@@ -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);
drivers/video/u_boot_logo.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..47f1e9b99789584d2f6dd71e954b51927b35d783
GIT binary patch
drivers/video/video-uclass.c +26 -0
index fafd05e373f..feed9c9a949 100644
@@ -305,6 +305,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)
 {
@@ -370,6 +388,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;
 };
 
include/video.h +2 -0
index 6948cdf5796..59c9d9c18ca 100644
@@ -30,12 +30,14 @@ struct udevice;
  * @base: Base address of frame buffer, 0 if not yet known
  * @copy_base: Base address of a hardware copy of the frame buffer. See
  *     CONFIG_VIDEO_COPY.
+ * @hide_logo: Hide the logo (used for testing)
  */
 struct video_uc_plat {
        uint align;
        uint size;
        ulong base;
        ulong copy_base;
+       bool hide_logo;
 };
 
 enum video_polarity {
scripts/Makefile.lib +21 -0
index 39f03398ed8..06cc2d938db 100644
@@ -372,6 +372,27 @@ cmd_S_ttf=                                         \
 $(obj)/%.S: $(src)/%.ttf
        $(call cmd,S_ttf)
 
+# Splash logos
+# ---------------------------------------------------------------------------
+
+# Generate an assembly file to wrap the splash data
+quiet_cmd_S_splash= TTF     $@
+# Modified for U-Boot
+cmd_S_splash=                                          \
+(                                                      \
+       echo '.section .rodata.splash.init,"a"';                \
+       echo '.balign 16';                              \
+       echo '.global __splash_$(*F)_begin';            \
+       echo '__splash_$(*F)_begin:';                   \
+       echo '.incbin "$<" ';                           \
+       echo '__splash_$(*F)_end:';                     \
+       echo '.global __splash_$(*F)_end';                      \
+       echo '.balign 16';                              \
+) > $@
+
+$(obj)/%.S: $(src)/%.bmp
+       $(call cmd,S_splash)
+
 # EFI applications
 # A Makefile target *.efi is built as EFI application.
 # A Makefile target *_efi.S wraps *.efi as built-in EFI application.
test/dm/video.c +34 -10
index 4e76574a913..d4a3c9c6c17 100644
@@ -115,6 +115,31 @@ static int select_vidconsole(struct unit_test_state *uts, const char *drv_name)
        return 0;
 }
 
+/**
+ * video_get_nologo() - Disable the logo on the video device and return it
+ *
+ * @uts: Test state
+ * @devp: Returns video device
+ * @return 0 if OK, -ve on error
+ */
+static int video_get_nologo(struct unit_test_state *uts, struct udevice **devp)
+{
+       struct video_uc_plat *uc_plat;
+       struct udevice *dev;
+
+       ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
+       ut_assertnonnull(dev);
+       uc_plat = dev_get_uclass_plat(dev);
+       uc_plat->hide_logo = true;
+
+       /* now probe it */
+       ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev));
+       ut_assertnonnull(dev);
+       *devp = dev;
+
+       return 0;
+}
+
 /* Test text output works on the video console */
 static int dm_test_video_text(struct unit_test_state *uts)
 {
@@ -125,7 +150,7 @@ static int dm_test_video_text(struct unit_test_state *uts)
 #define SCROLL_LINES   100
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_asserteq(46, compress_frame_buffer(uts, dev));
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
@@ -157,7 +182,7 @@ static int dm_test_video_chars(struct unit_test_state *uts)
        const char *test_string = "Well\b\b\b\bxhe is\r \n\ta very \amodest  \bman\n\t\tand Has much to\b\bto be modest about.";
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(466, compress_frame_buffer(uts, dev));
@@ -174,7 +199,7 @@ static int dm_test_video_ansi(struct unit_test_state *uts)
        struct udevice *dev, *con;
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
 
        /* reference clear: */
@@ -222,7 +247,7 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,
        plat = dev_get_plat(dev);
        plat->rot = rot;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        ut_asserteq(46, compress_frame_buffer(uts, dev));
 
@@ -311,7 +336,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts)
        struct udevice *dev;
        ulong addr;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));
 
        ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
@@ -433,7 +458,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts)
        struct udevice *dev;
        ulong addr;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(read_file(uts, "tools/logos/denx-comp.bmp", &addr));
 
        ut_assertok(video_bmp_display(dev, addr, 0, 0, false));
@@ -487,7 +512,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(12237, compress_frame_buffer(uts, dev));
@@ -508,7 +533,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
        plat = dev_get_plat(dev);
        plat->font_size = 100;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(35030, compress_frame_buffer(uts, dev));
@@ -529,7 +554,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
        plat = dev_get_plat(dev);
        plat->font_size = 100;
 
-       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
        vidconsole_put_string(con, test_string);
        ut_asserteq(29018, compress_frame_buffer(uts, dev));
--
Quoted 2 lines

2.34.0.rc2.393.gf8c9666880-goog

Simon,

I find that this patch enables the default U-Boot Logo in the top-right corner for gwventana_*_defconfig even though I have a custom splash-screen (so I see both).

I have the following in my defconfig:

$ grep -e "SPLASH\|LOGO" configs/gwventana_nand_defconfig
CONFIG_VIDEO_LOGO=y
CONFIG_SPLASH_SCREEN=y
CONFIG_SPLASH_SCREEN_ALIGN=y
Quoted 4 lines

If I disable VIDEO_LOGO I don't see either the U-Boot logo or my SPLASH_SCREEN. The commit log says "If SPLASH_SCREEN is enabled, it is not enabled by default, so as not to conflict with that feature." but I don't see where you do anything in this patch with SPLASH_SCREEN.

I just mean in the Kconfig:

config VIDEO_LOGO
bool "Show the U-Boot logo on the display"
depends on DM_VIDEO
default y if !SPLASH_SCREEN

             ^^^^^
Quoted 7 lines

So if you enable both of them, you will get both, but by default VIDEO_LOGO should be enabled only if SPLASH_SCREEN is not enabled.

The splash code needs a rework too, I think. I just didn't get that far.

Regards,
Simon

Simon,

Ok, sorry, I missed the 'default y if !SPLASH_SCREEN' as that was from a different patch.

Currently if I disable VIDEO_LOGO and leave only SPASH_SCREEN enabled I get no display. Similarly if I enable VIDEO_LOGO and not SPLASH_SCREEN I get no display.

If I go back to prior to this series (3a8b919932fd) splash works just fine so I'm trying to understand why now I loose video completely if I disable VIDEO_LOGO (which I wish wasn't enabled by default anyway when using my existing gwventana defconfigs).

Fabio, do you have any imx6 boards that have defconfigs that enable SPLASH_SCREEN you can see if the same behavior occurs on? The behavior is that VIDEO_LOGO got enabled by default so you see the custom splash along with the U-Boot logo and if you disable VIDEO_LOGO you also loose the custom splash.

Best Regards,

Tim

reviewer
#34 lore raw

Re: [PATCH 19/23] video: Support showing the U-Boot logo

Hi Tim,

Quoted 5 lines · Tim Harvey

Fabio, do you have any imx6 boards that have defconfigs that enable SPLASH_SCREEN you can see if the same behavior occurs on? The behavior is that VIDEO_LOGO got enabled by default so you see the custom splash along with the U-Boot logo and if you disable VIDEO_LOGO you also loose the custom splash.

Yes, I am able to reproduce the same behavior on an imx6sabresd running top of head U-Boot:
I do see both the Freescale logo and the U-Boot logo.

If VIDEO_LOGO is disabled, nothing is seen on the LCD.

#35 lore raw

PATCH 20/23 video: Show the U-Boot logo by default

In reply to Simon Glass

Enable this for boards with a display, unless they are using the SPLASH feature.

This shows a U-Boot logo on boards with a display, which seems like a useful thing.

---

 configs/gurnard_defconfig | 1 +
 configs/tbs2910_defconfig | 1 +
 drivers/video/Kconfig     | 1 +
 3 files changed, 3 insertions(+)
configs/gurnard_defconfig +1 -0
index 7c7974c123c..a034cad3608 100644
@@ -50,5 +50,6 @@ CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_DM_VIDEO=y
+# CONFIG_VIDEO_LOGO is not set
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_CMD_DHRYSTONE=y
configs/tbs2910_defconfig +1 -0
index c623a547733..e1278f2e70a 100644
@@ -94,6 +94,7 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+# CONFIG_VIDEO_LOGO is not set
 # CONFIG_BACKLIGHT is not set
 # CONFIG_CMD_VIDCONSOLE is not set
 # CONFIG_VIDEO_BPP8 is not set
drivers/video/Kconfig +1 -0
index e601b47806b..cfa08b501ba 100644
@@ -17,6 +17,7 @@ config DM_VIDEO
 config VIDEO_LOGO
 	bool "Show the U-Boot logo on the display"
 	depends on DM_VIDEO
+	default y if !SPLASH_SCREEN
 	select VIDEO_BMP_RLE8
 	help
 	  This enables showing the U-Boot logo on the display when a video
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#36 lore raw

PATCH 21/23 video: Support virtio devices with the splash screen

In reply to Simon Glass

This is useful for showing a logo when booting from qemu.

---

 common/splash_source.c | 14 ++++++++++++++
 include/splash.h       |  1 +
 include/virtio.h       |  1 +
 3 files changed, 16 insertions(+)
common/splash_source.c +14 -0
index d05670f5ee8..2c03cbdf928 100644
@@ -20,6 +20,7 @@
 #include <spi_flash.h>
 #include <splash.h>
 #include <usb.h>
+#include <virtio.h>
 #include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -179,6 +180,16 @@ static inline int splash_init_sata(void)
 }
 #endif
 
+static int splash_init_virtio(void)
+{
+	if (!IS_ENABLED(CONFIG_VIRTIO)) {
+		printf("Cannot load splash image: no virtio support\n");
+		return -ENOSYS;
+	} else {
+		return virtio_init();
+	}
+}
+
 #ifdef CONFIG_CMD_UBIFS
 static int splash_mount_ubifs(struct splash_location *location)
 {
@@ -233,6 +244,9 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
 	if (location->storage == SPLASH_STORAGE_SATA)
 		res = splash_init_sata();
 
+	if (location->storage == SPLASH_STORAGE_VIRTIO)
+		res = splash_init_virtio();
+
 	if (location->ubivol != NULL)
 		res = splash_mount_ubifs(location);
 
include/splash.h +1 -0
index 7fd2de8fea1..33e45e69416 100644
@@ -30,6 +30,7 @@ enum splash_storage {
 	SPLASH_STORAGE_MMC,
 	SPLASH_STORAGE_USB,
 	SPLASH_STORAGE_SATA,
+	SPLASH_STORAGE_VIRTIO,
 };
 
 enum splash_flags {
include/virtio.h +1 -0
index a42bdad6b87..34e2bfdcdd3 100644
@@ -20,6 +20,7 @@
 #ifndef __VIRTIO_H__
 #define __VIRTIO_H__
 
+#include <virtio_types.h>
 #include <linux/bitops.h>
 #include <linux/bug.h>
 #define VIRTIO_ID_NET		1 /* virtio net */
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#37 lore raw

Re: [PATCH 21/23] video: Support virtio devices with the splash screen

Quoted 24 lines · Simon Glass

This is useful for showing a logo when booting from qemu.

---

 common/splash_source.c | 14 ++++++++++++++
 include/splash.h       |  1 +
 include/virtio.h       |  1 +
 3 files changed, 16 insertions(+)
common/splash_source.c +1 -0
index d05670f5ee8..2c03cbdf928 100644
@@ -20,6 +20,7 @@
 #include <spi_flash.h>
 #include <splash.h>
 #include <usb.h>
+#include <virtio.h>
 #include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -179,6 +180,16 @@ static inline int splash_init_sata(void)
 }

common/splash_source.c static inline int splash_init_sata(void) · line 190

Quoted 10 lines
common/splash_source.c +8 -0
 #endif
 
+static int splash_init_virtio(void)
+{
+	if (!IS_ENABLED(CONFIG_VIRTIO)) {
+		printf("Cannot load splash image: no virtio support\n");
+		return -ENOSYS;
+	} else {
+		return virtio_init();
+	}

Doesn't need to add "else" ?

Best Regards,
Jaehoon Chung

Quoted 40 lines
common/splash_source.c +5 -0
+}
+
 #ifdef CONFIG_CMD_UBIFS
 static int splash_mount_ubifs(struct splash_location *location)
 {
@@ -233,6 +244,9 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
 	if (location->storage == SPLASH_STORAGE_SATA)
 		res = splash_init_sata();
 
+	if (location->storage == SPLASH_STORAGE_VIRTIO)
+		res = splash_init_virtio();
+
 	if (location->ubivol != NULL)
 		res = splash_mount_ubifs(location);
 
include/splash.h +1 -0
index 7fd2de8fea1..33e45e69416 100644
@@ -30,6 +30,7 @@ enum splash_storage {
 	SPLASH_STORAGE_MMC,
 	SPLASH_STORAGE_USB,
 	SPLASH_STORAGE_SATA,
+	SPLASH_STORAGE_VIRTIO,
 };
 
 enum splash_flags {
include/virtio.h +1 -0
index a42bdad6b87..34e2bfdcdd3 100644
@@ -20,6 +20,7 @@
 #ifndef __VIRTIO_H__
 #define __VIRTIO_H__
 
+#include <virtio_types.h>
 #include <linux/bitops.h>
 #include <linux/bug.h>
 #define VIRTIO_ID_NET		1 /* virtio net */
#38 lore raw

RE: [PATCH 21/23] video: Support virtio devices with the splash screen

Quoted 29 lines

Subject: Re: [PATCH 21/23] video: Support virtio devices with the splash screen

Quoted 25 lines · Simon Glass

This is useful for showing a logo when booting from qemu.

---

 common/splash_source.c | 14 ++++++++++++++
 include/splash.h       |  1 +
 include/virtio.h       |  1 +
 3 files changed, 16 insertions(+)
common/splash_source.c index renamed from common/splash_source.c +0 -0

d05670f5ee8..2c03cbdf928 100644

common/splash_source.c +1 -0
@@ -20,6 +20,7 @@
 #include <spi_flash.h>
 #include <splash.h>
 #include <usb.h>
+#include <virtio.h>
 #include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -179,6 +180,16 @@ static inline int splash_init_sata(void)  }
 #endif
 
Quoted 10 lines

common/splash_source.c static inline int splash_init_sata(void) · line 190

Quoted 8 lines
common/splash_source.c +8 -0
+static int splash_init_virtio(void)
+{
+	if (!IS_ENABLED(CONFIG_VIRTIO)) {
+		printf("Cannot load splash image: no virtio support\n");
+		return -ENOSYS;
+	} else {
+		return virtio_init();
+	}

Doesn't need to add "else" ?

Checkpatch would report warning remove else per my understanding.

-Peng

Quoted 44 lines

Best Regards,
Jaehoon Chung

common/splash_source.c static inline int splash_init_sata(void)

Quoted 5 lines
common/splash_source.c +2 -1
+}
+
 #ifdef CONFIG_CMD_UBIFS
 static int splash_mount_ubifs(struct splash_location *location)  { @@
-233,6 +244,9 @@ static int splash_load_fs(struct splash_location *location,

u32 bmp_load_addr)

Quoted 34 lines
common/splash_source.c +3 -0
 	if (location->storage == SPLASH_STORAGE_SATA)
 		res = splash_init_sata();
 
+	if (location->storage == SPLASH_STORAGE_VIRTIO)
+		res = splash_init_virtio();
+
 	if (location->ubivol != NULL)
 		res = splash_mount_ubifs(location);
include/splash.h index renamed from include/splash.h +0 -0

7fd2de8fea1..33e45e69416 100644

include/splash.h +1 -0
@@ -30,6 +30,7 @@ enum splash_storage {
 	SPLASH_STORAGE_MMC,
 	SPLASH_STORAGE_USB,
 	SPLASH_STORAGE_SATA,
+	SPLASH_STORAGE_VIRTIO,
 };
 
 enum splash_flags {
include/virtio.h index renamed from include/virtio.h +0 -0

a42bdad6b87..34e2bfdcdd3 100644

include/virtio.h +1 -0
@@ -20,6 +20,7 @@
 #ifndef __VIRTIO_H__
 #define __VIRTIO_H__
 
+#include <virtio_types.h>
 #include <linux/bitops.h>
 #include <linux/bug.h>
 #define VIRTIO_ID_NET		1 /* virtio net */
#39 lore raw

PATCH 22/23 x86: coreboot: Support getting a logo from virtio

In reply to Simon Glass

Enable this feature so that a splash screen can be provided.

---

 board/coreboot/coreboot/coreboot.c | 20 ++++++++++++++++++--
 include/configs/coreboot.h         |  3 +++
 include/configs/x86-common.h       |  6 +++++-
 3 files changed, 26 insertions(+), 3 deletions(-)
board/coreboot/coreboot/coreboot.c +18 -2
index 11294d6e870..3b90ae75386 100644
@@ -4,10 +4,11 @@
  */
 
 #include <common.h>
-#include <asm/cb_sysinfo.h>
-#include <asm/global_data.h>
+#include <splash.h>
 #include <init.h>
 #include <smbios.h>
+#include <asm/cb_sysinfo.h>
+#include <asm/global_data.h>
 
 int board_early_init_r(void)
 {
@@ -65,3 +66,18 @@ fallback:
 	return checkboard();
 }
 #endif
+
+static struct splash_location coreboot_splash_locations[] = {
+	{
+		.name = "virtio_fs",
+		.storage = SPLASH_STORAGE_VIRTIO,
+		.flags = SPLASH_STORAGE_RAW,
+		.devpart = "0",
+	},
+};
+
+int splash_screen_prepare(void)
+{
+	return splash_source_load(coreboot_splash_locations,
+				  ARRAY_SIZE(coreboot_splash_locations));
+}
include/configs/coreboot.h +3 -0
index 1cf5c037e85..d6d679fd7dd 100644
@@ -10,6 +10,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define SPLASH_SETTINGS "splashsource=virtio_fs\0" \
+	"splashimage=0x1000000\0"
+
 #include <configs/x86-common.h>
 
 #define CONFIG_SYS_MONITOR_LEN		(1 << 20)
include/configs/x86-common.h +5 -1
index 486b5ca7765..2d280d5df60 100644
@@ -88,9 +88,14 @@
 #define DISTRO_BOOTENV
 #endif
 
+#ifndef SPLASH_SETTINGS
+#define SPLASH_SETTINGS
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS			\
 	DISTRO_BOOTENV					\
 	CONFIG_STD_DEVICES_SETTINGS			\
+	SPLASH_SETTINGS					\
 	"pciconfighost=1\0"				\
 	"netdev=eth0\0"					\
 	"consoledev=ttyS0\0"				\
@@ -100,7 +105,6 @@
 	"ramdisk_addr_r=0x4000000\0"			\
 	"ramdiskfile=initramfs.gz\0"
 
-
 #define RAMBOOTCOMMAND				\
 	"setenv bootargs root=/dev/ram rw "		\
 	"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
#40 lore raw

PATCH 23/23 x86: coreboot: Add a sample script to build a qemu image

In reply to Simon Glass

It is useful to boot coreboot (with U-Boot as a payload) from qemu. Add a sample script to show how to do this.

---

 scripts/build-cb.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 scripts/build-cb.sh
scripts/build-cb.sh new file +19 -0
new file mode 100755
index 00000000000..1da708fb6e1
@@ -0,0 +1,19 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Sample script to build a disk image suitable for use with coreboot. The image
+# includes a kernel and initrd.
+#
+# YOU WILL NEED to modify this for your needs, e.g. select a kernel.
+#
+# Run this with:
+# qemu-system-i386 -bios coreboot.rom -drive file=disk.img,if=virtio
+
+qemu-img create -f raw disk.img 120M
+mkfs.ext2 -F disk.img
+sudo mkdir -p /mnt/rootfs
+sudo mount -o loop disk.img /mnt/rootfs
+sudo mkdir -p /mnt/rootfs/boot
+sudo cp /boot/vmlinuz /mnt/rootfs/boot/.
+sudo cp /boot/initrd.img /mnt/rootfs/boot/.
+sudo umount /mnt/rootfs
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog