[U-Boot] [PATCH 5/8] lcd: make 16bpp work

Wolfgang Denk wd at denx.de
Sun Nov 22 23:43:17 CET 2009


Dear Alessandro Rubini,

In message <5d6b28b1993d090ee26fa192c1784739eb12db3f.1255086085.git.rubini@ unipv.it> you wrote:
> From: Alessandro Rubini <rubini at unipv.it>
> 
> Signed-off-by: Alessandro Rubini <rubini at unipv.it>
> Acked-by: Andrea Gallo <andrea.gallo at stericsson.com>
> ---
>  common/lcd.c |   26 ++++++++++++++++++++------
>  1 files changed, 20 insertions(+), 6 deletions(-)
> 
> diff --git a/common/lcd.c b/common/lcd.c
> index 4e31618..d05c025 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -63,7 +63,7 @@
>  /************************************************************************/
>  #ifdef CONFIG_LCD_LOGO
>  # include <bmp_logo.h>		/* 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
> @@ -244,10 +244,12 @@ 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) {
> -				*d++ = (bits & 0x80) ?
> -						lcd_color_fg : lcd_color_bg;
> -				bits <<= 1;
> +			{
> +				u16 *d = (u16 *)dest;

Please do not declare variables in the middle of the code; move
declaration to start of function and avoid the {...} block.


Anatolij, will you pick up this (cleaned up) patch, then?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You got to learn three things. What's  real,  what's  not  real,  and
what's the difference."           - Terry Pratchett, _Witches Abroad_


More information about the U-Boot mailing list