[U-Boot] [PATCH] bmp: Respect "splashpos" if it is defined
Otavio Salvador
otavio at ossystems.com.br
Thu Jun 6 19:57:23 CEST 2013
Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
common/cmd_bmp.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index 5a52edd..48e045e 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -33,6 +33,10 @@
#include <malloc.h>
#include <video.h>
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+#define BMP_ALIGN_CENTER 0x7FFF
+#endif
+
static int bmp_info (ulong addr);
/*
@@ -112,6 +116,25 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
{
ulong addr;
int x = 0, y = 0;
+ __maybe_unused char *s;
+
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+ s = getenv("splashpos");
+ if (s != NULL) {
+ if (s[0] == 'm')
+ x = BMP_ALIGN_CENTER;
+ else
+ x = simple_strtol(s, NULL, 0);
+
+ s = strchr(s + 1, ',');
+ if (s != NULL) {
+ if (s[1] == 'm')
+ y = BMP_ALIGN_CENTER;
+ else
+ y = simple_strtol(s + 1, NULL, 0);
+ }
+ }
+#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
switch (argc) {
case 1: /* use load_addr as default address */
--
1.8.1
More information about the U-Boot
mailing list