]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Add gzipped logo support
authorMark Jackson <mpfj@mimc.co.uk>
Thu, 31 Jul 2008 15:09:00 +0000 (16:09 +0100)
committerWolfgang Denk <wd@denx.de>
Thu, 31 Jul 2008 15:48:50 +0000 (17:48 +0200)
The README file states that CONFIG_VIDEO_BMP_GZIP behaves as follows:

  If this option is set, additionally to standard BMP
  images, gzipped BMP images can be displayed via the
  splashscreen support or the bmp command.

However, the splashscreen function *only* supports standard BMP images.

This patch adds the documented gzip support.

Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
common/lcd.c

index eec1f53b0a784655384f43dabe9509d653b1fe0b..3bbc7bafaf190d03ebff5faa6705d207658cfaf0 100644 (file)
@@ -740,6 +740,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
+#ifdef CONFIG_VIDEO_BMP_GZIP
+extern bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp);
+#endif
 
 static void *lcd_logo (void)
 {
@@ -761,6 +764,16 @@ static void *lcd_logo (void)
                addr = simple_strtoul(s, NULL, 16);
                do_splash = 0;
 
+#ifdef CONFIG_VIDEO_BMP_GZIP
+               bmp_image_t *bmp = (bmp_image_t *)addr;
+               unsigned long len;
+
+               if (!((bmp->header.signature[0]=='B') &&
+                     (bmp->header.signature[1]=='M'))) {
+                       addr = (ulong)gunzip_bmp(addr, &len);
+               }
+#endif
+
                if (lcd_display_bitmap (addr, 0, 0) == 0) {
                        return ((void *)lcd_base);
                }