diff mbox

[U-Boot,v5,1/3] LCD: display 32bpp decompressed bitmap image

Message ID 4FAB50D9.4040709@samsung.com
State Accepted
Commit fb6a9aab7ae78c03f9e9c6724ee40d8a384644ad
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Donghwa Lee May 10, 2012, 5:23 a.m. UTC
This patch supports drawing 32bpp decompressed bitmap image.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
---
Changes for v4:
	- read image sequentially just as it is.

Changes for v1/v2/v3:
	- use lcd_line_length variable
	- convert BGR to RGB because BMP data format aligned BGR.

 common/lcd.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

Comments

Anatolij Gustschin May 24, 2012, 9:23 p.m. UTC | #1
Hi,

On Thu, 10 May 2012 14:23:37 +0900
Donghwa Lee <dh09.lee@samsung.com> wrote:

> This patch supports drawing 32bpp decompressed bitmap image.
> 
> Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
> Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
> ---
> Changes for v4:
> 	- read image sequentially just as it is.
> 
> Changes for v1/v2/v3:
> 	- use lcd_line_length variable
> 	- convert BGR to RGB because BMP data format aligned BGR.
> 
>  common/lcd.c |   19 ++++++++++++++++---
>  1 files changed, 16 insertions(+), 3 deletions(-)

Applied to u-boot-video/master. Thanks.

Anatolij
diff mbox

Patch

diff --git a/common/lcd.c b/common/lcd.c
index bf1a6a9..00cbf05 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -645,14 +645,14 @@  int lcd_display_bitmap(ulong bmp_image, int x, int y)
 
 	bpix = NBITS(panel_info.vl_bpix);
 
-	if ((bpix != 1) && (bpix != 8) && (bpix != 16)) {
+	if ((bpix != 1) && (bpix != 8) && (bpix != 16) && (bpix != 32)) {
 		printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
 			bpix, bmp_bpix);
 		return 1;
 	}
 
 	/* We support displaying 8bpp BMPs on 16bpp LCDs */
-	if (bpix != bmp_bpix && (bmp_bpix != 8 || bpix != 16)) {
+	if (bpix != bmp_bpix && (bmp_bpix != 8 || bpix != 16 || bpix != 32)) {
 		printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
 			bpix,
 			le16_to_cpu(bmp->header.bit_count));
@@ -669,7 +669,7 @@  int lcd_display_bitmap(ulong bmp_image, int x, int y)
 		cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
 		cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
-#elif !defined(CONFIG_ATMEL_LCD)
+#elif !defined(CONFIG_ATMEL_LCD) && !defined(CONFIG_EXYNOS_FB)
 		cmap = panel_info.cmap;
 #endif
 
@@ -791,6 +791,19 @@  int lcd_display_bitmap(ulong bmp_image, int x, int y)
 		break;
 #endif /* CONFIG_BMP_16BPP */
 
+#if defined(CONFIG_BMP_32BPP)
+	case 32:
+		for (i = 0; i < height; ++i) {
+			for (j = 0; j < width; j++) {
+				*(fb++) = *(bmap++);
+				*(fb++) = *(bmap++);
+				*(fb++) = *(bmap++);
+				*(fb++) = *(bmap++);
+			}
+			fb  -= (lcd_line_length + width * (bpix / 8));
+		}
+		break;
+#endif /* CONFIG_BMP_32BPP */
 	default:
 		break;
 	};