From: Liu Ying <Ying.Liu@freescale.com>
Date: Tue, 11 Jan 2011 07:29:58 +0000 (+0800)
Subject: lcd: align fb writing address for horizontal display offset
X-Git-Tag: v2025.01-rc5-pxa1908~19715
X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-favicon.png?a=commitdiff_plain;h=8d46d5b1864aa49830c58abfdd230c7224b83459;p=u-boot.git

lcd: align fb writing address for horizontal display offset

CONFIG_SPLASH_SCREEN_ALIGN makes uboot support display
offset for splashimage. The framebuffer writing address
should be calculated according to different kinds of
framebuffer pixel format, i.e., bits per pixel value.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
---

diff --git a/common/lcd.c b/common/lcd.c
index d854c21e95..0555ab4fb7 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -731,7 +731,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 
 	bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset);
 	fb   = (uchar *) (lcd_base +
-		(y + height - 1) * lcd_line_length + x);
+		(y + height - 1) * lcd_line_length + x * bpix / 8);
 
 	switch (bmp_bpix) {
 	case 1: /* pass through */