From: Alessandro Rubini Date: Sat, 13 Mar 2010 16:44:08 +0000 (+0100) Subject: lcd: make 16bpp work X-Git-Tag: v2010.03-rc3~5^2 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=acb13868936a28502782a16e1edaec378e494a29 lcd: make 16bpp work Support for 16bpp was supposed to be in the code but was not working. This makes it work and has been tested in the nhk8815 board. Signed-off-by: Alessandro Rubini Acked-by: Andrea Gallo Signed-off-by: Anatolij Gustschin --- diff --git a/common/lcd.c b/common/lcd.c index db799db6b2..64fb1c6408 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -63,7 +63,7 @@ /************************************************************************/ #ifdef CONFIG_LCD_LOGO # include /* Get logo data, width and height */ -# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) +# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16) # error Default Color Map overlaps with Logo Color Map # endif #endif @@ -218,8 +218,12 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) for (row=0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { uchar *s = str; - uchar *d = dest; int i; +#if LCD_BPP == LCD_COLOR16 + ushort *d = (ushort *)dest; +#else + uchar *d = dest; +#endif #if LCD_BPP == LCD_MONOCHROME uchar rest = *d & -(1 << (8-off)); @@ -244,7 +248,7 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) bits <<= 1; } #elif LCD_BPP == LCD_COLOR16 - for (c=0; c<16; ++c) { + for (c=0; c<8; ++c) { *d++ = (bits & 0x80) ? lcd_color_fg : lcd_color_bg; bits <<= 1; @@ -521,6 +525,13 @@ void bitmap_plot (int x, int y) cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]); #elif defined(CONFIG_ATMEL_LCD) cmap = (uint *) (panel_info.mmio + ATMEL_LCDC_LUT(0)); +#else + /* + * default case: generic system with no cmap (most likely 16bpp) + * We set cmap to the source palette, so no change is done. + * This avoids even more ifdef in the next stanza + */ + cmap = bmp_logo_palette; #endif WATCHDOG_RESET(); @@ -559,10 +570,15 @@ void bitmap_plot (int x, int y) } } else { /* true color mode */ + u16 col16; fb16 = (ushort *)(lcd_base + y * lcd_line_length + x); for (i=0; i