[U-Boot] [PATCH 3/5] lcd: Call lcd_sync() after completing the scroll

Simon Glass sjg at chromium.org
Sun Apr 19 15:21:00 CEST 2015


On sandbox, if you add a printf() to malloc() for debugging, the output will
eventually cause the screen to scroll. Since lcd_sync() calls SDL functions
which allocate memory, and this happens before we have updated
console_curr_row, U-Boot gets locked in an infinite loop.

Flip the order of the two statements to avoid this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 common/lcd_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 8bf83b9..ab48fd6 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -120,8 +120,8 @@ static void console_scrollup(void)
 		*ppix++ = bg_color;
 	}
 #endif
-	lcd_sync();
 	console_curr_row -= rows;
+	lcd_sync();
 }
 
 static inline void console_back(void)
-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list