diff mbox

[U-Boot] cfb_console: flush FB cache at end of public functions

Message ID 1348356578-10522-1-git-send-email-eric.nelson@boundarydevices.com
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Eric Nelson Sept. 22, 2012, 11:29 p.m. UTC
Removed internal cache_flush operations and placed a flush of the
entire frame-buffer at the end of each public function.

Changed logo_plot() to static because it isn't called externally or
declared in a header.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>

---
 drivers/video/cfb_console.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

Comments

Anatolij Gustschin May 6, 2013, 1:02 p.m. UTC | #1
On Sat, 22 Sep 2012 16:29:38 -0700
Eric Nelson <eric.nelson@boundarydevices.com> wrote:

> Removed internal cache_flush operations and placed a flush of the
> entire frame-buffer at the end of each public function.
> 
> Changed logo_plot() to static because it isn't called externally or
> declared in a header.
> 
> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
> 
> ---
>  drivers/video/cfb_console.c |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)

Applied to u-boot-video/master after rebasing and moving the
cache flush from drv_video_init() to video_init().

Thanks,

Anatolij
Eric Nelson May 6, 2013, 3:15 p.m. UTC | #2
On 05/06/2013 06:02 AM, Anatolij Gustschin wrote:
> On Sat, 22 Sep 2012 16:29:38 -0700
> Eric Nelson <eric.nelson@boundarydevices.com> wrote:
>
>> Removed internal cache_flush operations and placed a flush of the
>> entire frame-buffer at the end of each public function.
>>
>> Changed logo_plot() to static because it isn't called externally or
>> declared in a header.
>>
>> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
>>
>> ---
>>   drivers/video/cfb_console.c |   16 +++++++++-------
>>   1 files changed, 9 insertions(+), 7 deletions(-)
>
> Applied to u-boot-video/master after rebasing and moving the
> cache flush from drv_video_init() to video_init().
>

Thanks Anatolij.
diff mbox

Patch

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 19d061f..1372353 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -557,8 +557,6 @@  static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 					SWAP32((video_font_draw_table32
 						[bits & 15][3] & eorx) ^ bgx);
 			}
-			if (cfb_do_flush_cache)
-				flush_cache((ulong)dest0, 32);
 			dest0 += VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE;
 			s++;
 		}
@@ -627,8 +625,6 @@  static void video_invertchar(int xx, int yy)
 		for (x = firstx; x < lastx; x++) {
 			u8 *dest = (u8 *)(video_fb_address) + x + y;
 			*dest = ~*dest;
-			if (cfb_do_flush_cache)
-				flush_cache((ulong)dest, 4);
 		}
 	}
 }
@@ -672,6 +668,8 @@  void console_cursor(int state)
 		}
 		cursor_state = state;
 	}
+	if (cfb_do_flush_cache)
+		flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 }
 #endif
 
@@ -724,8 +722,6 @@  static void console_clear_line(int line, int begin, int end)
 			memsetl(offset + i * VIDEO_LINE_LEN, size, bgx);
 	}
 #endif
-	if (cfb_do_flush_cache)
-		flush_cache((ulong)CONSOLE_ROW_FIRST, CONSOLE_SIZE);
 }
 
 static void console_scrollup(void)
@@ -828,6 +824,8 @@  void video_putc(const char c)
 		}
 	}
 	CURSOR_SET;
+	if (cfb_do_flush_cache)
+		flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 }
 
 void video_puts(const char *s)
@@ -1474,13 +1472,15 @@  int video_display_bitmap(ulong bmp_image, int x, int y)
 	}
 #endif
 
+	if (cfb_do_flush_cache)
+		flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 	return (0);
 }
 #endif
 
 
 #ifdef CONFIG_VIDEO_LOGO
-void logo_plot(void *screen, int width, int x, int y)
+static void logo_plot(void *screen, int width, int x, int y)
 {
 
 	int xcount, i;
@@ -1862,6 +1862,8 @@  int drv_video_init(void)
 	if (stdio_register(&console_dev) != 0)
 		return 0;
 
+	if (cfb_do_flush_cache)
+		flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 	/* Return success */
 	return 1;
 }