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 13/13] lcd: split splash code into its own function
Date: Sun, 01 Feb 2015 15:59:41 +0200	[thread overview]
Message-ID: <54CE314D.2010001@compulab.co.il> (raw)
In-Reply-To: <CAPnjgZ0vpm2epkKBAfw_dXwKfmAtr+EJ6utDsw8UU+_MFEQf_A@mail.gmail.com>

Hi Simon,

On 01/31/2015 02:25 AM, Simon Glass wrote:
> Hi Nikita,
>
> On 29 January 2015 at 04:21, Nikita Kiryanov <nikita@compulab.co.il> wrote:
>> lcd_logo() currently performs tasks well beyond just displaying the logo.
>> It has code which displays splash image, it has logic which determines
>> when the different display features are displayed, and it is coupled with
>> the lcd console because it holds the responsibility of returning the
>> lcd console base address.
>>
>> Make lcd_logo() just about the logo by:
>> * Moving splash image display code into a dedicated function
>> * Moving the logic regarding when various features are displayed to
>>    lcd_clear() (which is arguably not the correct name for housing such
>>    code either, but it is currently the most fitting location code wise)
>> * Move the responsibility of setting the console base address to
>>    lcd_clear() too.
>>
>> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
>> Cc: Bo Shen <voice.shen@atmel.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Anatolij Gustschin <agust@denx.de>
>> ---
>>   common/lcd.c     | 52 ++++++++++++++++++++++------------------------------
>>   common/splash.c  | 16 ++++++++++++++++
>>   include/splash.h | 11 ++++++++++-
>>   3 files changed, 48 insertions(+), 31 deletions(-)
>>
>> diff --git a/common/lcd.c b/common/lcd.c
>> index d0c0aff..f33942c 100644
>> --- a/common/lcd.c
>> +++ b/common/lcd.c
>> @@ -46,7 +46,7 @@
>>   DECLARE_GLOBAL_DATA_PTR;
>>
>>   static int lcd_init(void *lcdbase);
>> -static void *lcd_logo(void);
>> +static void lcd_logo(void);
>>   static void lcd_setfgcolor(int color);
>>   static void lcd_setbgcolor(int color);
>>
>> @@ -169,6 +169,9 @@ void lcd_clear(void)
>>   {
>>          short console_rows, console_cols;
>>          int bg_color;
>> +       char *s;
>> +       ulong addr;
>> +       static int do_splash = 1;
>>   #if LCD_BPP == LCD_COLOR8
>>          /* Setting the palette */
>>          lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
>> @@ -218,7 +221,23 @@ void lcd_clear(void)
>>   #endif
>>          console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
>>          lcd_init_console(lcd_base, console_rows, console_cols);
>> -       lcd_init_console(lcd_logo(), console_rows, console_cols);
>> +       if (do_splash) {
>> +               s = getenv("splashimage");
>> +               if (s) {
>> +                       do_splash = 0;
>> +                       addr = simple_strtoul(s, NULL, 16);
>> +                       if (lcd_splash(addr) == 0) {
>> +                               lcd_sync();
>> +                               return;
>> +                       }
>> +               }
>> +       }
>> +
>> +       lcd_logo();
>> +#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
>> +       addr = (ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length;
>> +       lcd_init_console((void *)addr, console_rows, console_cols);
>
> I'm just a bit unsure about this - before this function was always
> called. I have some idea but can you explain why it is now in an
> #ifidef?

The only time when the base address of the console is defined as anything other
than lcd_base, is when we get to the very end of the original lcd_logo() and
the above #defines apply. In all other cases, the address of lcd_base is used,
and that is set as default at the start of lcd_clear().

-- 
Regards,
Nikita Kiryanov

  reply	other threads:[~2015-02-01 13:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 11:21 [U-Boot] [PATCH 00/13] common lcd refactor Nikita Kiryanov
2015-01-29 11:21 ` [U-Boot] [PATCH 01/13] lcd: move platform specific structs to their own headers Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 02/13] lcd: split configuration_get_cmap Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-02-01 17:02     ` Nikita Kiryanov
2015-02-01 17:14       ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 03/13] lcd: atmel: move atmel specific fb_put_word to atmel_lcdfb Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 04/13] lcd: mpc8xx: move mpc823 specific fb_put_byte to mpc8xx_lcd.c Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 05/13] lcd: atmel: introduce lcd_logo_set_cmap Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 06/13] lcd: mpc823: move mpc823 specific lcd_logo_set_cmap code to mpc8xx_lcd.c Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 07/13] lcd: logo: move generic cmap setting to lcd_logo_set_cmap() Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 08/13] lcd: introduce lcd_set_cmap Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 09/13] lcd: remove unused includes Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 10/13] lcd: various cleanups Nikita Kiryanov
2015-01-31  0:24   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 11/13] lcd: rename bitmap_plot to better represent its functionality Nikita Kiryanov
2015-01-31  0:25   ` Simon Glass
2015-01-29 11:21 ` [U-Boot] [PATCH 12/13] lcd: dt: extract simplefb support Nikita Kiryanov
2015-01-29 17:14   ` Stephen Warren
2015-02-01 13:58     ` Nikita Kiryanov
2015-01-31  0:25   ` Simon Glass
2015-02-01 13:56     ` Nikita Kiryanov
2015-01-29 11:21 ` [U-Boot] [PATCH 13/13] lcd: split splash code into its own function Nikita Kiryanov
2015-01-31  0:25   ` Simon Glass
2015-02-01 13:59     ` Nikita Kiryanov [this message]
2015-02-01 16:25       ` 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=54CE314D.2010001@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