From 8e7d7fd4bf3bf0a0387af7616d739ec4aba9b1f0 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 5 Oct 2012 23:43:37 -0700 Subject: 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 Reviewed-on: http://review.coreboot.org/1734 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- payloads/libpayload/drivers/video/video.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'payloads/libpayload/drivers/video') diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c index d7fc8de923..61bb02abc0 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) -- cgit v1.2.3