[U-Boot] [PATCH] lcd: restore ability to display 8 bpp BMPs on 16 bpp LCDs

Nikita Kiryanov nikita at compulab.co.il
Thu Dec 20 11:52:34 CET 2012


Commit fb6a9aab7ae78c (LCD: display 32bpp decompressed bitmap image)
broke the check that allowed U-Boot to display 8 bpp BMPs on a 16
bpp LCD screen, effectively turning this feature off.

Restore this feature by changing the check back to the same meaning
it originally had.
To avoid future confusion, the check has also been rephrased to make
its meaning clear.

Signed-off-by: Nikita Kiryanov <nikita at compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg at compulab.co.il>
---
 common/lcd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/lcd.c b/common/lcd.c
index 4c83a8b..cfa1134 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -834,7 +834,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 	}
 
 	/* We support displaying 8bpp BMPs on 16bpp LCDs */
-	if (bpix != bmp_bpix && (bmp_bpix != 8 || bpix != 16 || bpix != 32)) {
+	if (bpix != bmp_bpix && !(bmp_bpix == 8 && bpix == 16)) {
 		printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
 			bpix,
 			le16_to_cpu(bmp->header.bit_count));
-- 
1.7.10.4



More information about the U-Boot mailing list