From: Wolfgang Denk Date: Sun, 22 Nov 2009 23:43:17 +0100 Subject: [U-Boot] [PATCH 5/8] lcd: make 16bpp work In-Reply-To: <5d6b28b1993d090ee26fa192c1784739eb12db3f.1255086085.git.rubini@ unipv.it> References: <5d6b28b1993d090ee26fa192c1784739eb12db3f.1255086085.git.rubini@ unipv.it> Message-ID: <20091122224317.DCD8CE34A27@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Alessandro Rubini, In message <5d6b28b1993d090ee26fa192c1784739eb12db3f.1255086085.git.rubini@ unipv.it> you wrote: > From: Alessandro Rubini > > Signed-off-by: Alessandro Rubini > Acked-by: Andrea Gallo > --- > 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 /* 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_