public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nikita Kiryanov <nikita@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] lcd: Fix fb offset calculation for bpix == 16 in BMP display
Date: Thu, 04 Oct 2012 10:48:01 +0200	[thread overview]
Message-ID: <506D4D41.4030609@compulab.co.il> (raw)
In-Reply-To: <1348881077-11246-6-git-send-email-sjg@chromium.org>

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.

>   	switch (bmp_bpix) {
>   	case 1: /* pass through */
>

  reply	other threads:[~2012-10-04  8:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29  1:11 [U-Boot] [PATCH 0/7] lcd/video: Add parameter API and compressed bitmaps Simon Glass
2012-09-29  1:11 ` [U-Boot] [PATCH 1/7] video: Provide an API to access video parameters Simon Glass
2012-11-06 22:08   ` [U-Boot] [PATCH v2] " Anatolij Gustschin
2012-09-29  1:11 ` [U-Boot] [PATCH 2/7] video: Implement additional video API functions in cfb_console Simon Glass
2012-11-06 23:56   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2012-09-29  1:11 ` [U-Boot] [PATCH 3/7] lcd: Provide an API to access LCD parameters Simon Glass
2012-09-29  1:11 ` [U-Boot] [PATCH 4/7] lcd: Fix BMP decode bug that skips the wrong padded row Simon Glass
2012-09-29  1:11 ` [U-Boot] [PATCH 5/7] lcd: Fix fb offset calculation for bpix == 16 in BMP display Simon Glass
2012-10-04  8:48   ` Nikita Kiryanov [this message]
2012-10-09 12:28     ` Simon Glass
2012-09-29  1:11 ` [U-Boot] [PATCH 6/7] lcd: Implement RLE8 bitmap decoding Simon Glass
2012-10-01 17:01   ` Che-liang Chiou
2012-09-29  1:11 ` [U-Boot] [PATCH 7/7] video: Skip bitmaps which do not fit into the screen in cfb_console Simon Glass
2012-11-07  0:15 ` [U-Boot] [PATCH 0/7] lcd/video: Add parameter API and compressed bitmaps Anatolij Gustschin
2012-11-07  0:21   ` Simon Glass

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=506D4D41.4030609@compulab.co.il \
    --to=nikita@compulab.co.il \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox