From bb7f0b1acfbfd9f009713b54bd2f633024b7e9af Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 4 Jun 2013 15:25:42 -0300 Subject: [PATCH] bmp: Respect "splashpos" if it is defined Signed-off-by: Otavio Salvador --- common/cmd_bmp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index 5a52edde31..48e045e08a 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -33,6 +33,10 @@ #include #include +#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 */ -- 2.40.1