All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] EXYNOS: draw 32bpp bitmap TIZEN logo
Date: Tue, 24 Apr 2012 17:39:40 +0200	[thread overview]
Message-ID: <20120424173940.2ce4ee7f@wker> (raw)
In-Reply-To: <4F94B49E.5020802@samsung.com>

Hi,

On Mon, 23 Apr 2012 10:47:10 +0900
Donghwa Lee <dh09.lee@samsung.com> wrote:

> This patches support drawing 32bpp bitmap TIZEN logo in exynos fb.
> asm/arch/trats_logo.h data is compressed by zip and decomressed at

Did you use "gzip" to compress the trats.bmp bitmap? I suppose so,
but "gunzip" can't uncompress it:
$ gunzip img.gz
 gzip: img.gz: unexpected end of file

"gunzip -c img.gz > trats.bmp" works and I get a 520x120 32bpp bmp
file. The size of your compressed array is 80681. Probably one or
more bytes are missing at the end. Please check/fix this.

...
> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
> index 0eb7f58..c111855 100644
> --- a/drivers/video/exynos_fb.c
> +++ b/drivers/video/exynos_fb.c
...
> @@ -67,6 +69,38 @@ static void exynos_lcd_init(vidinfo_t *vid)
>  	exynos_fimd_lcd_init(vid);
>  }
>  
> +static void draw_logo(void *lcdbase)
> +{
> +	int x, y;
> +	unsigned int in_len, width, height;
> +	unsigned long out_len =
> +		(ARRAY_SIZE(trats_logo) * sizeof(*trats_logo)) + 1;

 * sizeof(*trats_logo) is not needed here, it is always 1.
Also this out_len variable should be named differently, src_len
is a better name i think.

> +	void *dst = NULL;
> +
> +	width = TRATS_LOGO_WIDTH;
> +	height = TRATS_LOGO_HEIGHT;
> +	x = ((panel_width - width) >> 1);
> +	y = ((panel_height - height) >> 1) - 5;

in your 1/2 path for common/lcd.c you are adding an
#ifndef CONFIG_EXYNOS_FB
#else
#endif

block for exynosfb specific drawing offset calculation.
The only difference is that you are using (y + height)
instead of (y + height - 1). This is not needed, just
set use "y = ((panel_height - height) >> 1) - 4;" here.

> +
> +	in_len = width * height * 8;

Please better use "in_len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE;" here
and define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE to be big enough to
contain a bitmap of your max. bitmap size (i.e. 520 * 120 * 4 +
space for bmp header/color table, so 300 KiB would be okay).

...
> diff --git a/include/configs/trats.h b/include/configs/trats.h
> index 5f913ca..b326035 100644
> --- a/include/configs/trats.h
> +++ b/include/configs/trats.h
> @@ -216,9 +216,11 @@
>  /* LCD */
>  #define CONFIG_EXYNOS_FB
>  #define CONFIG_LCD
> +#define CONFIG_CMD_BMP
>  #define CONFIG_FB_ADDR		0x52504000
>  #define CONFIG_S6E8AX0
>  #define CONFIG_EXYNOS_MIPI_DSIM
> -#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(1280 * 720 * 4)
> +#define CONFIG_VIDEO_BMP_GZIP
> +#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(500 * 120 * 4)

This should be bigger than the bitmap resolution. The bitmap file
contains the bmp header and maybe a color table, so for your current
bitmap define it to be 250000 bytes at least.

Thanks,
Anatolij

      parent reply	other threads:[~2012-04-24 15:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  1:47 [U-Boot] [PATCH 2/2] EXYNOS: draw 32bpp bitmap TIZEN logo Donghwa Lee
2012-04-23  9:00 ` Minkyu Kang
2012-04-23 10:16   ` Donghwa Lee
2012-04-23 10:56     ` Minkyu Kang
2012-04-23  9:22 ` Wolfgang Denk
2012-04-24  2:17   ` Donghwa Lee
2012-04-24 15:39 ` Anatolij Gustschin [this message]

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=20120424173940.2ce4ee7f@wker \
    --to=agust@denx.de \
    --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.