summaryrefslogtreecommitdiff
path: root/drivers/cfb_console.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2005-09-22 09:04:17 +0200
committerStefan Roese <sr@denx.de>2005-09-22 09:04:17 +0200
commit98f4a3dfcbee54ce2b1d16ef2a2901493e65e5d2 (patch)
treefd82268230e750ae4d6e12c12ae60b5f784eec4c /drivers/cfb_console.c
parent5810dc3a2e4f5f9075f4a1818317b41e552843e5 (diff)
Add SM501 support to HH405 board.
Add support for gzip compressed bmp's (CONFIG_VIDEO_BMP_GZIP). Add support for eeprom write-enable (CFG_EEPROM_WREN). Patch by Stefan Roese, 22 Sep 2005
Diffstat (limited to 'drivers/cfb_console.c')
-rw-r--r--drivers/cfb_console.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/drivers/cfb_console.c b/drivers/cfb_console.c
index 1eaac4771e..aba4a0341b 100644
--- a/drivers/cfb_console.c
+++ b/drivers/cfb_console.c
@@ -131,6 +131,16 @@ CONFIG_VIDEO_HW_CURSOR: - Uses the hardware cursor capability of the
#endif
/*****************************************************************************/
+/* Defines for the SED13806 driver */
+/*****************************************************************************/
+#ifdef CONFIG_VIDEO_SM501
+
+#ifdef CONFIG_HH405
+#define VIDEO_FB_LITTLE_ENDIAN
+#endif
+#endif
+
+/*****************************************************************************/
/* Include video_fb.h after definitions of VIDEO_HW_RECTFILL etc */
/*****************************************************************************/
#include <video_fb.h>
@@ -372,6 +382,8 @@ static const int video_font_draw_table32[16][4] = {
{ 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff } };
+int gunzip(void *, int, unsigned char *, unsigned long *);
+
/******************************************************************************/
static void video_drawchars (int xx, int yy, unsigned char *s, int count)
@@ -751,13 +763,42 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
unsigned colors;
unsigned long compression;
bmp_color_table_entry_t cte;
+#ifdef CONFIG_VIDEO_BMP_GZIP
+ unsigned char *dst = NULL;
+ ulong len;
+#endif
WATCHDOG_RESET ();
if (!((bmp->header.signature[0] == 'B') &&
(bmp->header.signature[1] == 'M'))) {
+
+#ifdef CONFIG_VIDEO_BMP_GZIP
+ /*
+ * Could be a gzipped bmp image, try to decrompress...
+ */
+ len = CFG_VIDEO_LOGO_MAX_SIZE;
+ dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
+ if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)bmp_image, &len) != 0) {
+ printf ("Error: no valid bmp or bmp.gz image at %lx\n", bmp_image);
+ free(dst);
+ return 1;
+ }
+
+ /*
+ * Set addr to decompressed image
+ */
+ bmp = (bmp_image_t *)dst;
+
+ if (!((bmp->header.signature[0] == 'B') &&
+ (bmp->header.signature[1] == 'M'))) {
+ printf ("Error: no valid bmp.gz image at %lx\n", bmp_image);
+ return 1;
+ }
+#else
printf ("Error: no valid bmp image at %lx\n", bmp_image);
return 1;
+#endif /* CONFIG_VIDEO_BMP_GZIP */
}
width = le32_to_cpu (bmp->header.width);
@@ -947,6 +988,13 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
le16_to_cpu (bmp->header.bit_count));
break;
}
+
+#ifdef CONFIG_VIDEO_BMP_GZIP
+ if (dst) {
+ free(dst);
+ }
+#endif
+
return (0);
}
#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
@@ -1061,7 +1109,6 @@ static void *video_logo (void)
}
#endif /* CONFIG_SPLASH_SCREEN */
-
logo_plot (video_fb_address, VIDEO_COLS, 0, 0);
sprintf (info, " %s", &version_string);