All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] Add flexibility to mx51 video support
Date: Wed, 03 Nov 2010 12:30:39 +0100	[thread overview]
Message-ID: <4CD147DF.609@denx.de> (raw)
In-Reply-To: <1288752995-31121-1-git-send-email-renato.frias@gmail.com>

On 11/03/2010 03:56 AM, Renato Frias wrote:
> From: Renato Frias <renato.frias@freescale.com>
> 
> -int mx51_fb_init(struct fb_videomode *mode)
> +int mx51_fb_init(struct fb_videomode *mode, u32 ipu_di, u32 bppix)
>  {
>  	int ret;
> +	uint32_t pixfmt = 0;
>  
>  	ret = ipu_probe();
>  	if (ret)
> @@ -635,8 +635,23 @@ int mx51_fb_init(struct fb_videomode *mode)
>  
>  	lcd_base += 56;
>  
> +	switch (bppix) {
> +	case 32:
> +		pixfmt = IPU_PIX_FMT_BGR32;
> +		break;
> +	case 24:
> +		pixfmt = IPU_PIX_FMT_BGR24;
> +		break;
> +	case 18:
> +		pixfmt = IPU_PIX_FMT_RGB666;
> +		break;
> +	case 16:
> +		pixfmt = IPU_PIX_FMT_RGB565;
> +		break;
> +	}
> +

This is a code duplication of bpp_to_pixfmt() in the same file, adding
only an additional case. If you prefer to have a function passing an
integer as a fb_info structure, rearrange both functions to factorize
code and avoid duplications.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

      reply	other threads:[~2010-11-03 11:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03  2:56 [U-Boot] [PATCH v2 1/3] Add flexibility to mx51 video support Renato Frias
2010-11-03 11:30 ` Stefano Babic [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=4CD147DF.609@denx.de \
    --to=sbabic@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.