
Hi Nikita,
On Thu, Oct 4, 2012 at 1:48 AM, Nikita Kiryanov nikita@compulab.co.il wrote:
Hi Simon,
On 09/29/2012 03:11 AM, Simon Glass wrote:
From: Tom Wai-Hong Tam waihong@chromium.org
For bpix == 16, each pixel is 2-byte. fb offset should shift more x bytes.
Signed-off-by: Tom Wai-Hong Tam waihong@chromium.org Signed-off-by: Simon Glass sjg@chromium.org
common/lcd.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/lcd.c b/common/lcd.c index 7c6cb09..004a6be 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -775,8 +775,10 @@ 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);
fb = (uchar *) (lcd_base +
(y + height - 1) * lcd_line_length + x * bpix / 8);
fb = (uchar *) (lcd_base + (y + height - 1) * lcd_line_length +
x);
/* additional fb shift for bpix == 16 since each pixel is 2-byte
*/
if (bpix == 16)
fb += x;
Why is this change necessary? if bpix == 16 then x * bpix / 8 == 2 * x anyway.
Yes I agree, I can't see what the difference might me. Tom, do you have any idea on this please?
Regards, Simon
switch (bmp_bpix) { case 1: /* pass through */