]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lcd: Add CONFIG_CONSOLE_SCROLL_LINES option to speed console
authorSimon Glass <sjg@chromium.org>
Wed, 17 Oct 2012 13:24:59 +0000 (13:24 +0000)
committerTom Warren <twarren@nvidia.com>
Mon, 19 Nov 2012 15:15:40 +0000 (08:15 -0700)
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>
Signed-off-by: Tom Warren <twarren@nvidia.com>
README
common/lcd.c

diff --git a/README b/README
index 5c03be79187a09321abd5e618f2312e5e6fcb548..037513a1340c1a250aa3ec02ca7cbc6ad5f09236 100644 (file)
--- a/README
+++ b/README
@@ -1478,6 +1478,12 @@ CBFS (Coreboot Filesystem) support
                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
 
index d2a3e9103141400341eb363277ea3dd814260bbc..3017604734bb27ce9d5057bafd3f0ee8033584be 100644 (file)
 #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)
 {
-       /* Copy up rows ignoring the first one */
-       memcpy(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE);
+       const int rows = CONFIG_CONSOLE_SCROLL_LINES;
+
+       /* Copy up rows ignoring those that will be overwritten */
+       memcpy(CONSOLE_ROW_FIRST,
+              lcd_console_address + CONSOLE_ROW_SIZE * rows,
+              CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
+
+       /* Clear the last rows */
+       memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
+               COLOR_MASK(lcd_color_bg),
+              CONSOLE_ROW_SIZE * rows);
 
-       /* Clear the last one */
-       memset(CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE);
        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();
        }