Commit 0d89efef773318b241df7cb1295ac72742e6f848
Committed by
Tom Warren
1 parent
77139f5170
Exists in
master
and in
54 other branches
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>
Showing 2 changed files with 23 additions and 5 deletions Side-by-side Diff
README
... | ... | @@ -1478,6 +1478,12 @@ |
1478 | 1478 | here, since it is cheaper to change data cache settings on |
1479 | 1479 | a per-section basis. |
1480 | 1480 | |
1481 | + CONFIG_CONSOLE_SCROLL_LINES | |
1482 | + | |
1483 | + When the console need to be scrolled, this is the number of | |
1484 | + lines to scroll by. It defaults to 1. Increasing this makes | |
1485 | + the console jump but can help speed up operation when scrolling | |
1486 | + is slow. | |
1481 | 1487 | |
1482 | 1488 | - Splash Screen Support: CONFIG_SPLASH_SCREEN |
1483 | 1489 |
common/lcd.c
... | ... | @@ -76,6 +76,11 @@ |
76 | 76 | #define CONFIG_LCD_ALIGNMENT PAGE_SIZE |
77 | 77 | #endif |
78 | 78 | |
79 | +/* By default we scroll by a single line */ | |
80 | +#ifndef CONFIG_CONSOLE_SCROLL_LINES | |
81 | +#define CONFIG_CONSOLE_SCROLL_LINES 1 | |
82 | +#endif | |
83 | + | |
79 | 84 | DECLARE_GLOBAL_DATA_PTR; |
80 | 85 | |
81 | 86 | ulong lcd_setmem (ulong addr); |
82 | 87 | |
83 | 88 | |
... | ... | @@ -131,12 +136,20 @@ |
131 | 136 | |
132 | 137 | static void console_scrollup(void) |
133 | 138 | { |
134 | - /* Copy up rows ignoring the first one */ | |
135 | - memcpy(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE); | |
139 | + const int rows = CONFIG_CONSOLE_SCROLL_LINES; | |
136 | 140 | |
137 | - /* Clear the last one */ | |
138 | - memset(CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE); | |
141 | + /* Copy up rows ignoring those that will be overwritten */ | |
142 | + memcpy(CONSOLE_ROW_FIRST, | |
143 | + lcd_console_address + CONSOLE_ROW_SIZE * rows, | |
144 | + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows); | |
145 | + | |
146 | + /* Clear the last rows */ | |
147 | + memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows, | |
148 | + COLOR_MASK(lcd_color_bg), | |
149 | + CONSOLE_ROW_SIZE * rows); | |
150 | + | |
139 | 151 | lcd_sync(); |
152 | + console_row -= rows; | |
140 | 153 | } |
141 | 154 | |
142 | 155 | /*----------------------------------------------------------------------*/ |
... | ... | @@ -165,7 +178,6 @@ |
165 | 178 | if (console_row >= CONSOLE_ROWS) { |
166 | 179 | /* Scroll everything up */ |
167 | 180 | console_scrollup(); |
168 | - --console_row; | |
169 | 181 | } else { |
170 | 182 | lcd_sync(); |
171 | 183 | } |