summaryrefslogtreecommitdiff
path: root/recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch')
-rw-r--r--recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch b/recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch
new file mode 100644
index 0000000000..47da73ef5e
--- /dev/null
+++ b/recipes/u-boot/u-boot-1.1.4/at32stk1000/cmd-bmp-add-gzip-compressed-bmp.patch
@@ -0,0 +1,90 @@
+Index: u-boot-orig/common/cmd_bmp.c
+===================================================================
+--- u-boot-orig.orig/common/cmd_bmp.c 2007-01-05 14:50:55.000000000 +0100
++++ u-boot-orig/common/cmd_bmp.c 2007-01-05 15:59:21.000000000 +0100
+@@ -176,13 +176,83 @@
+ */
+ static int bmp_display(ulong addr, int x, int y)
+ {
++ int ret;
++#ifdef CONFIG_VIDEO_BMP_GZIP
++ bmp_image_t *bmp = (bmp_image_t *)addr;
++ unsigned char *dst = NULL;
++ ulong len;
++
++ if (!((bmp->header.signature[0]=='B') &&
++ (bmp->header.signature[1]=='M'))) {
++
++ /*
++ * Decompress bmp image
++ */
++ len = CFG_VIDEO_LOGO_MAX_SIZE;
++ dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
++ if (dst == NULL) {
++ printf("Error: malloc in gunzip failed!\n");
++ return(1);
++ }
++ if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)addr, &len) != 0) {
++ free(dst);
++ printf("There is no valid bmp file at the given address\n");
++ return(1);
++ }
++ if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
++ printf("Image could be truncated "
++ "(increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
++ }
++
++ /*
++ * Set addr to decompressed image
++ */
++ bmp = (bmp_image_t *)dst;
++
++ /*
++ * Check for bmp mark 'BM'
++ */
++ if (!((bmp->header.signature[0] == 'B') &&
++ (bmp->header.signature[1] == 'M'))) {
++ printf("There is no valid bmp file at the given address\n");
++ free(dst);
++ return(1);
++ }
++ }
++
++ if (dst) {
++ addr = (ulong)dst;
++ }
++#endif /* CONFIG_VIDEO_BMP_GZIP */
++
+ #if defined(CONFIG_LCD)
+ extern int lcd_display_bitmap (ulong, int, int);
+
+- return (lcd_display_bitmap (addr, x, y));
++ ret = lcd_display_bitmap (addr, x, y);
++ if (ret) {
++#ifdef CONFIG_VIDEO_BMP_GZIP
++ free(dst);
++#endif
++ return ret;
++ }
++#ifdef CONFIG_VIDEO_BMP_GZIP
++ free(dst);
++#endif
++ return 0;
++
+ #elif defined(CONFIG_VIDEO)
+ extern int video_display_bitmap (ulong, int, int);
+- return (video_display_bitmap (addr, x, y));
++ ret = video_display_bitmap (addr, x, y);
++ if (ret) {
++#ifdef CONFIG_VIDEO_BMP_GZIP
++ free(dst);
++#endif
++ return ret;
++ }
++#ifdef CONFIG_VIDEO_BMP_GZIP
++ free(dst);
++#endif
++ return 0;
+ #else
+ # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO
+ #endif