]> code.ossystems Code Review - bsp/u-boot.git/commitdiff
bmp: Respect "splashpos" if it is defined patches-2013.04
authorOtavio Salvador <otavio@ossystems.com.br>
Tue, 4 Jun 2013 18:25:42 +0000 (15:25 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 4 Jun 2013 18:25:42 +0000 (15:25 -0300)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
common/cmd_bmp.c

index 5a52edde31dff8c4083baa449302ffab1b906cb4..48e045e08adb13af407bdce2c1aded999963ed6c 100644 (file)
 #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 */