All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donghwa Lee <dh09.lee@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] LCD: drawing 32bpp uncompressed bitmap image
Date: Mon, 23 Apr 2012 10:47:07 +0900	[thread overview]
Message-ID: <4F94B49B.3070101@samsung.com> (raw)

This patch supports drawing 32bpp uncompressed bitmap image.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
---
 common/lcd.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index bf1a6a9..a7b04d2 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
 
@@ -739,8 +739,14 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 		height = panel_info.vl_row - y;
 
 	bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset);
+
+#ifndef CONFIG_EXYNOS_FB
 	fb   = (uchar *) (lcd_base +
 		(y + height - 1) * lcd_line_length + x * bpix / 8);
+#else
+	fb = (uchar *) (lcd_base + (y + height) *
+			(panel_info.vl_col * (bpix / 8)) + x * (bpix / 8));
+#endif
 
 	switch (bmp_bpix) {
 	case 1: /* pass through */
@@ -788,9 +794,21 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 			bmap += (padded_line - width) * 2;
 			fb   -= (width * 2 + lcd_line_length);
 		}
+
 		break;
 #endif /* CONFIG_BMP_16BPP */
-
+	case 32:
+		for (i = 0; i < height; ++i) {
+			for (j = 0; j < width; j++) {
+				*(fb++) = *(bmap++);
+				*(fb++) = *(bmap++);
+				*(fb++) = *(bmap++);
+				*(fb++) = *(bmap++);
+			}
+			fb  -= ((panel_info.vl_col *
+				(bpix / 8)) + width * (bpix / 8));
+		}
+		break;
 	default:
 		break;
 	};
-- 
1.7.4.1

             reply	other threads:[~2012-04-23  1:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  1:47 Donghwa Lee [this message]
2012-04-24 15:55 ` [U-Boot] [PATCH 1/2] LCD: drawing 32bpp uncompressed bitmap image Anatolij Gustschin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F94B49B.3070101@samsung.com \
    --to=dh09.lee@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.