From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Fri, 06 Feb 2009 17:14:32 +0100 Subject: [U-Boot] [PATCH 7/9 v3] LCD: support 8bpp BMPs on 16bpp displays In-Reply-To: References: Message-ID: <498C61E8.8050906@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 Guennadi Liakhovetski wrote: > This patch also simplifies some ifdefs in lcd.c, introduces a generic > vidinfo_t, which new drivers are encouraged to use and old drivers to switch > over to. > > Signed-off-by: Guennadi Liakhovetski > --- > > Changes since v1: no changes. > > common/lcd.c | 56 ++++++++++++++++++++++++++++++++------------------------ > include/lcd.h | 21 +++++++++++++-------- > 2 files changed, 45 insertions(+), 32 deletions(-) Applied to u-boot-video/master. Also fixed some style issues by additionally applying a trivial patch below. Note that I consider this horrible ifdef mess in common/lcd.c as a bug (not your bug!) that should be fixed before 2009.03-rc1 or even earlier. pxa, mpc823 and atmel LCD drivers provide lcd_setcolreg() for color map setting and it could be used in lcd_display_bitmap() instead of duplicating the color map setting code for platforms in question. Other LCD drivers should provide own/controller-specific lcd_setcolreg(). I will try to help fixing these bugs, but I can not test the code as I do not have the hardware. Thanks, Anatolij diff --git a/common/lcd.c b/common/lcd.c index e4ac6c2..6ce14d2 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -747,8 +747,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) for (i = 0; i < height; ++i) { WATCHDOG_RESET(); - for (j = 0; j < width ; j++) - if (bpix!=16) { + for (j = 0; j < width; j++) { + if (bpix != 16) { #if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD) *(fb++) = *(bmap++); #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200) @@ -758,6 +758,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) *(uint16_t *)fb = cmap_base[*(bmap++)]; fb += sizeof(uint16_t) / sizeof(*fb); } + } bmap += (width - padded_line); fb -= (byte_width + lcd_line_length); }