Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1734
-gerrit
commit f7028e2b4478258dc1401dd618f2973e794f011e Author: Gabe Black gabeblack@google.com Date: Fri Oct 5 23:43:37 2012 -0700
libpayload: Add a function to retrieve the rows and cols of the video console.
This is useful if you need to put some text in a particular place on the screen, for instance in the middle.
Change-Id: I3dae6b62ca1917c5020ffa3e8115ea7e8e5c0643 Signed-off-by: Gabe Black gabeblack@google.com --- payloads/libpayload/drivers/video/video.c | 10 ++++++++++ payloads/libpayload/include/libpayload.h | 1 + 2 files changed, 11 insertions(+)
diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c index d7fc8de..61bb02a 100644 --- a/payloads/libpayload/drivers/video/video.c +++ b/payloads/libpayload/drivers/video/video.c @@ -62,6 +62,16 @@ static int cursorx; static int cursory; static unsigned int cursor_enabled = 1;
+void video_get_rows_cols(unsigned int *rows, unsigned int *cols) +{ + if (console) { + *cols = console->columns; + *rows = console->rows; + } else { + *cols = *rows = 0; + } +} + static void video_console_fixup_cursor(void) { if (!cursor_enabled) diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index c7e17d8..eaa0d0d 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -194,6 +194,7 @@ void speaker_tone(u16 freq, unsigned int duration); */ int video_init(void); int video_console_init(void); +void video_get_rows_cols(unsigned int *rows, unsigned int *cols); void video_console_putchar(unsigned int ch); void video_console_putc(u8 row, u8 col, unsigned int ch); void video_console_clear(void);