Fix splash screen display

EDM Rubino edmrubino at gmail.com
Tue May 28 21:20:33 CEST 2024


The attached patch file consists of 2 small patches.

[PATCH 0/1] Invert the order for calling the weak function
"splash_screen_prepare" and checking for the "splashimage" environment
variable. This allows us to display the bitmap in bmp_logo_bitmap without
having to neither copy it nor specify the "splashimage" environment
variable. The user can implement its own "splash_screen_prepare" in which
he/she sets the "splashimage" environment variable to &bmp_logo_bitmap.
This is a kind of "hack" and there should be a way for the user to specify
that he/she wants to display the embedded bmp in the bmp_logo_bitmap array
and, in this case, there is no need for the "splashimage" environment
variable - eIther a config option or some other way to express that this is
the intent of the user.

[PATCH 1/1] Fix the test for CONFIG_CMD_BMP to CONFIG_BMP in order to
display the logo image. In fact, CONFIG_BMP is set to y when CONFIG_CMD_BMP
is set so there should be no compatibility issues. The user should not have
to make the "bmp" cmd available in the u-boot CLI in order to use the
splash screen.

.Best regards
-------------- next part --------------
diff --git a/common/splash.c b/common/splash.c
index 6820db683b..2e4c3fa070 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -164,15 +164,15 @@ int splash_display(void)
 	int x = 0, y = 0, ret;
 	if (!CONFIG_IS_ENABLED(SPLASH_SCREEN))
 		return -ENOSYS;
+	ret = splash_screen_prepare();
+	if (ret)
+		return ret;
+
 	s = env_get("splashimage");
 	if (!s)
 		return -EINVAL;
 
 	addr = hextoul(s, NULL);
-	ret = splash_screen_prepare();
-	if (ret)
-		return ret;
-
 	splash_get_pos(&x, &y);
 
 	if (CONFIG_IS_ENABLED(BMP))
diff --git a/common/stdio.c b/common/stdio.c
index e3354f092d..19b99b2e6f 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -352,7 +352,7 @@ int stdio_add_devices(void)
 			}
 		}
 		if (IS_ENABLED(CONFIG_SPLASH_SCREEN) &&
-		    IS_ENABLED(CONFIG_CMD_BMP))
+		    IS_ENABLED(CONFIG_BMP))
 			splash_display();
 	}
 


More information about the U-Boot mailing list