[U-Boot] [PATCH v4 15/16] lcd: Add CONSOLE_SCROLL_LINES option to speed console

Simon Glass sjg at chromium.org
Mon Oct 8 21:55:48 CEST 2012


Hi Lucas,

On Fri, Sep 28, 2012 at 7:51 AM, Lucas Stach <dev at lynxeye.de> wrote:
> Am Donnerstag, den 27.09.2012, 17:44 -0700 schrieb Simon Glass:
>> When the cursor position gets to the end of the LCD console we normally
>> scroll by one line. This adds an option to increase that value.
>>
>> Console scrolling is often slow, and if a large amount of output is
>> being sent, increasing this option to 10 or so will speed things up
>> considerably.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>> Changes in v3:
>> - Fix tiny bug in mult-line lcd scrolling
>>
>> Changes in v4:
>> - Use CONFIG_CONSOLE_SCROLL_LINES instead of CONSOLE_SCROLL_LINES
>> - Put default CONFIG_CONSOLE_SCROLL_LINES at top of file
>>
>>  README       |    6 ++++++
>>  common/lcd.c |   18 +++++++++++++++---
>>  2 files changed, 21 insertions(+), 3 deletions(-)
>>
>> diff --git a/README b/README
>> index 1d0ce50..14b1f83 100644
>> --- a/README
>> +++ b/README
>> @@ -1449,6 +1449,12 @@ The following options need to be configured:
>>               here, since it is cheaper to change data cache settings on
>>               a per-section basis.
>>
>> +             CONFIG_CONSOLE_SCROLL_LINES
>> +
>> +             When the console need to be scrolled, this is the number of
>> +             lines to scroll by. It defaults to 1. Increasing this makes
>> +             the console jump but can help speed up operation when scrolling
>> +             is slow.
>>
>>  - Splash Screen Support: CONFIG_SPLASH_SCREEN
>>
>> diff --git a/common/lcd.c b/common/lcd.c
>> index 74fa3f9..460f0ca 100644
>> --- a/common/lcd.c
>> +++ b/common/lcd.c
>> @@ -76,6 +76,11 @@
>>  #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
>>  #endif
>>
>> +/* By default we scroll by a single line */
>> +#ifndef CONFIG_CONSOLE_SCROLL_LINES
>> +#define CONFIG_CONSOLE_SCROLL_LINES 1
>> +#endif
>> +
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>>  ulong lcd_setmem (ulong addr);
>> @@ -131,12 +136,20 @@ void lcd_set_flush_dcache(int flush)
>>
>>  static void console_scrollup(void)
>>  {
>> +     const int rows = CONFIG_CONSOLE_SCROLL_LINES;
>> +
>>       /* Copy up rows ignoring the first one */
> Comment is inaccurate as you possibly ignore more than the first line.
>
>> -     memcpy(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE);
>> +     memcpy(CONSOLE_ROW_FIRST,
>> +            lcd_console_address + CONSOLE_ROW_SIZE * rows,
>> +            CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
>>
>>       /* Clear the last one */
> Same as above.

OK thanks, I will tidy these up.

>
>> -     memset(CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE);
>> +     memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
>> +             COLOR_MASK(lcd_color_bg),
>> +            CONSOLE_ROW_SIZE * rows);
>> +
>>       lcd_sync();
>> +     console_row -= rows;
>>  }
>>
>>  /*----------------------------------------------------------------------*/
>> @@ -165,7 +178,6 @@ static inline void console_newline(void)
>>       if (console_row >= CONSOLE_ROWS) {
>>               /* Scroll everything up */
>>               console_scrollup();
>> -             --console_row;
>>       } else {
>>               lcd_sync();
>>       }
>
>

Regards,
Simon


More information about the U-Boot mailing list