]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/lcd.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / common / lcd.c
index 2996e0deb462955dcb3e16fdf872a574c793a0e7..787d80e3cbeb1da848a2ac756a159121eb064b41 100644 (file)
@@ -33,7 +33,6 @@
 
 #if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
        defined(CONFIG_CPU_MONAHANS)
-#define CONFIG_CPU_PXA
 #include <asm/byteorder.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
 static void lcd_drawchars(ushort x, ushort y, uchar *str, int count);
-static inline void lcd_puts_xy(ushort x, ushort y, uchar *s);
 static inline void lcd_putc_xy(ushort x, ushort y, uchar  c);
 
 static int lcd_init(void *lcdbase);
 
 static void *lcd_logo(void);
 
-static int lcd_getbgcolor(void);
 static void lcd_setfgcolor(int color);
 static void lcd_setbgcolor(int color);
 
@@ -374,15 +371,6 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
        }
 }
 
-/*----------------------------------------------------------------------*/
-
-static inline void lcd_puts_xy(ushort x, ushort y, uchar *s)
-{
-       lcd_drawchars(x, y, s, strlen((char *)s));
-}
-
-/*----------------------------------------------------------------------*/
-
 static inline void lcd_putc_xy(ushort x, ushort y, uchar c)
 {
        lcd_drawchars(x, y, &c, 1);
@@ -497,7 +485,7 @@ void lcd_clear(void)
        /* set framebuffer to background color */
 #if (LCD_BPP != LCD_COLOR32)
        memset((char *)lcd_base,
-               COLOR_MASK(lcd_getbgcolor()),
+               COLOR_MASK(lcd_color_bg),
                lcd_line_length * panel_info.vl_row);
 #else
        u32 *ppix = lcd_base;
@@ -615,20 +603,6 @@ static void lcd_setbgcolor(int color)
        lcd_color_bg = color;
 }
 
-/*----------------------------------------------------------------------*/
-
-int lcd_getfgcolor(void)
-{
-       return lcd_color_fg;
-}
-
-/*----------------------------------------------------------------------*/
-
-static int lcd_getbgcolor(void)
-{
-       return lcd_color_bg;
-}
-
 /************************************************************************/
 /* ** Chipset depending Bitmap / Logo stuff...                          */
 /************************************************************************/
@@ -967,8 +941,13 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                return 1;
        }
 
-       /* We support displaying 8bpp BMPs on 16bpp LCDs */
-       if (bpix != bmp_bpix && !(bmp_bpix == 8 && bpix == 16)) {
+       /*
+        * We support displaying 8bpp BMPs on 16bpp LCDs
+        * and displaying 24bpp BMPs on 32bpp LCDs
+        * */
+       if (bpix != bmp_bpix &&
+           !(bmp_bpix == 8 && bpix == 16) &&
+           !(bmp_bpix == 24 && bpix == 32)) {
                printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
                        bpix, get_unaligned_le16(&bmp->header.bit_count));
                return 1;
@@ -1043,7 +1022,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 
        switch (bmp_bpix) {
        case 1: /* pass through */
-       case 8:
+       case 8: {
 #ifdef CONFIG_LCD_BMP_RLE8
                u32 compression = get_unaligned_le32(&bmp->header.compression);
                if (compression == BMP_BI_RLE8) {
@@ -1076,7 +1055,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                        fb -= byte_width + lcd_line_length;
                }
                break;
-
+       }
 #if defined(CONFIG_BMP_16BPP)
        case 16:
                for (i = 0; i < height; ++i) {
@@ -1089,7 +1068,19 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                }
                break;
 #endif /* CONFIG_BMP_16BPP */
-
+#if defined(CONFIG_BMP_24BMP)
+       case 24:
+               for (i = 0; i < height; ++i) {
+                       for (j = 0; j < width; j++) {
+                               *(fb++) = *(bmap++);
+                               *(fb++) = *(bmap++);
+                               *(fb++) = *(bmap++);
+                               *(fb++) = 0;
+                       }
+                       fb -= lcd_line_length + width * (bpix / 8);
+               }
+               break;
+#endif /* CONFIG_BMP_24BMP */
 #if defined(CONFIG_BMP_32BPP)
        case 32:
                for (i = 0; i < height; ++i) {