[U-Boot] [PATCH 2/7] video: Implement additional video API functions in cfb_console

Simon Glass sjg at chromium.org
Sat Sep 29 03:11:12 CEST 2012


From: Stefan Reinauer <reinauer at chromium.org>

Implement the new video API functions to provide access to screen size,
etc.

Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
 drivers/video/cfb_console.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 19d061f..c39d896 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1865,3 +1865,35 @@ int drv_video_init(void)
 	/* Return success */
 	return 1;
 }
+
+void video_position_cursor(unsigned col, unsigned row)
+{
+	console_col = min(col, CONSOLE_COLS - 1);
+	console_row = min(row, CONSOLE_ROWS - 1);
+}
+
+int video_get_pixel_width(void)
+{
+	return VIDEO_VISIBLE_COLS;
+}
+
+int video_get_pixel_height(void)
+{
+	return VIDEO_VISIBLE_ROWS;
+}
+
+int video_get_screen_rows(void)
+{
+	return CONSOLE_ROWS;
+}
+
+int video_get_screen_columns(void)
+{
+	return CONSOLE_COLS;
+}
+
+void video_clear(void)
+{
+	memsetl(video_fb_address,
+		(VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), 0);
+}
-- 
1.7.7.3



More information about the U-Boot mailing list