diff mbox

[U-Boot,2/2] video: speedup writing strings to fb console

Message ID 1413630834-3509-2-git-send-email-smoch@web.de
State Superseded
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Sören Moch Oct. 18, 2014, 11:13 a.m. UTC
With enabled framebuffer console the printenv command can take several
seconds to complete. This patch temporarily disables cache flush when
writing strings to fb console. Then there is no noticable delay anymore.

Tested with imx6 hdmi framebuffer.

Signed-off-by: Soeren Moch <smoch@web.de>
---
 drivers/video/cfb_console.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 9231927..e7548e1 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1160,10 +1160,19 @@  void video_putc(struct stdio_dev *dev, const char c)
 
 void video_puts(struct stdio_dev *dev, const char *s)
 {
+	int flush = cfb_do_flush_cache;
 	int count = strlen(s);
 
+	/* temporarily disable cache flush */
+	cfb_do_flush_cache = 0;
+
 	while (count--)
 		video_putc(dev, *s++);
+
+	if (flush) {
+		cfb_do_flush_cache = flush;
+		flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
+	}
 }
 
 /*