public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 03/13] lcd: atmel: move atmel-specific fb_put_word to atmel_lcdfb
Date: Wed, 4 Feb 2015 15:26:34 +0800	[thread overview]
Message-ID: <54D1C9AA.7070204@atmel.com> (raw)
In-Reply-To: <1422963152-17634-4-git-send-email-nikita@compulab.co.il>

On 02/03/2015 07:32 PM, Nikita Kiryanov wrote:
> Reduce the amount of platform-specific code in common/lcd.c by moving Atmel
> implementation of fb_put_word() to atmel_lcdfb.c. Since we must also have a
> default implementation for everybody else, make the remainder of the code
> into a weak function.
>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Cc: Bo Shen <voice.shen@atmel.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Anatolij Gustschin <agust@denx.de>

Acked-by: Bo Shen <voice.shen@atmel.com>

> ---
> Changes in V2:
> 	- Minor commit message update
>
>   common/lcd.c                | 11 +----------
>   drivers/video/atmel_lcdfb.c |  9 +++++++++
>   2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/common/lcd.c b/common/lcd.c
> index 0f6c2e4..f17b35b 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -642,20 +642,11 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
>   #endif
>
>   #if defined(CONFIG_BMP_16BPP)
> -#if defined(CONFIG_ATMEL_LCD_BGR555)
> -static inline void fb_put_word(uchar **fb, uchar **from)
> -{
> -	*(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
> -	*(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
> -	*from += 2;
> -}
> -#else
> -static inline void fb_put_word(uchar **fb, uchar **from)
> +__weak void fb_put_word(uchar **fb, uchar **from)
>   {
>   	*(*fb)++ = *(*from)++;
>   	*(*fb)++ = *(*from)++;
>   }
> -#endif
>   #endif /* CONFIG_BMP_16BPP */
>
>   int lcd_display_bitmap(ulong bmp_image, int x, int y)
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index fa6a82c..c7991cd 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -34,6 +34,15 @@ ushort *configuration_get_cmap(void)
>   	return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
>   }
>
> +#if defined(CONFIG_BMP_16BPP) && defined(CONFIG_ATMEL_LCD_BGR555)
> +void fb_put_word(uchar **fb, uchar **from)
> +{
> +	*(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
> +	*(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
> +	*from += 2;
> +}
> +#endif
> +
>   void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
>   {
>   #if defined(CONFIG_ATMEL_LCD_BGR555)
>

  reply	other threads:[~2015-02-04  7:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 11:32 [U-Boot] [PATCH V2 00/13] common lcd refactor Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 01/13] lcd: move platform-specific structs to their own headers Nikita Kiryanov
2015-02-04  6:48   ` Bo Shen
2015-02-03 11:32 ` [U-Boot] [PATCH V2 02/13] lcd: split configuration_get_cmap Nikita Kiryanov
2015-02-04  7:25   ` Bo Shen
2015-02-08 11:35     ` Nikita Kiryanov
2015-02-09  3:43       ` Bo Shen
2015-02-03 11:32 ` [U-Boot] [PATCH V2 03/13] lcd: atmel: move atmel-specific fb_put_word to atmel_lcdfb Nikita Kiryanov
2015-02-04  7:26   ` Bo Shen [this message]
2015-02-03 11:32 ` [U-Boot] [PATCH V2 04/13] lcd: mpc8xx: move mpc823-specific fb_put_byte to mpc8xx_lcd.c Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 05/13] lcd: atmel: introduce lcd_logo_set_cmap Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 06/13] lcd: mpc823: move mpc823-specific lcd_logo_set_cmap code to mpc8xx_lcd.c Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 07/13] lcd: logo: move generic cmap setting to lcd_logo_set_cmap() Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 08/13] lcd: introduce lcd_set_cmap Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 09/13] lcd: remove unused includes Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 10/13] lcd: various cleanups Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 11/13] lcd: rename bitmap_plot to better represent its functionality Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 12/13] lcd: dt: extract simplefb support Nikita Kiryanov
2015-02-03 11:32 ` [U-Boot] [PATCH V2 13/13] lcd: split splash code into its own function Nikita Kiryanov
2015-02-04  2:37 ` [U-Boot] [PATCH V2 00/13] common lcd refactor Josh Wu
2015-02-04  8:03 ` Bo Shen
2015-02-10 12:43 ` Anatolij Gustschin

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=54D1C9AA.7070204@atmel.com \
    --to=voice.shen@atmel.com \
    --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