summaryrefslogtreecommitdiff
path: root/common/lcd.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-10-17 13:24:59 +0000
committerTom Warren <twarren@nvidia.com>2012-11-19 08:15:40 -0700
commit0d89efef773318b241df7cb1295ac72742e6f848 (patch)
tree22f558975e9a58433615dd70549a1f604319b5bc /common/lcd.c
parent77139f5170ca74a7724f773ac8b355f8e191576c (diff)
downloadu-boot-imx-0d89efef773318b241df7cb1295ac72742e6f848.zip
u-boot-imx-0d89efef773318b241df7cb1295ac72742e6f848.tar.gz
u-boot-imx-0d89efef773318b241df7cb1295ac72742e6f848.tar.bz2
lcd: Add CONFIG_CONSOLE_SCROLL_LINES option to speed console
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>
Diffstat (limited to 'common/lcd.c')
-rw-r--r--common/lcd.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/common/lcd.c b/common/lcd.c
index d2a3e910..3017604 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)
{
- /* 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();
}