[U-Boot] [PATCH v2 18/19] lcd: Add CONSOLE_SCROLL_LINES option to speed console

Simon Glass
2012-06-13T16:19:54Z

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@chromium.org>
---

README | 6 ++++++
common/lcd.c | 15 +++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/README b/README
index ccdddbf..cb2c6cf 100644
--- a/README
+++ b/README
@@ -1407,6 +1407,12 @@ The following options need to be configured:
here, since it is cheaper to change data cache settings on
a per-section basis.

+ 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 758f158..b4e0853 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -134,12 +134,23 @@ void lcd_set_flush_dcache(int flush)

static void console_scrollup (void)
{
+ int rows = 1;
+
+#ifdef CONSOLE_SCROLL_LINES
+ rows = CONSOLE_SCROLL_LINES;
+#endif
/* Copy up rows ignoring the first one */
- 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 */
- 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;
}

/*----------------------------------------------------------------------*/
--
1.7.7.3