public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] bmp: Respect "splashpos" if it is defined
@ 2013-06-06 17:57 Otavio Salvador
  2013-06-06 18:16 ` Otavio Salvador
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Otavio Salvador @ 2013-06-06 17:57 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Otavio Salvador <otavio@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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-08 18:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06 17:57 [U-Boot] [PATCH] bmp: Respect "splashpos" if it is defined Otavio Salvador
2013-06-06 18:16 ` Otavio Salvador
2013-06-17 21:36 ` Otavio Salvador
2013-07-01 22:01 ` Anatolij Gustschin
2013-07-01 22:25   ` Otavio Salvador
2013-07-01 22:04 ` [U-Boot] [PATCH] video: consolidate splash screen alignment code Anatolij Gustschin
2013-07-01 22:24   ` Otavio Salvador
2013-07-08 18:47   ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox