[U-Boot] [PATCH 7/9 v3] LCD: support 8bpp BMPs on 16bpp displays

Anatolij Gustschin agust at denx.de
Fri Feb 6 17:14:32 CET 2009


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 <lg at denx.de>
> ---
> 
> 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);
 		}


More information about the U-Boot mailing list