From b700254aa5150023a13902adbe31839ec4f926cb Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 25 Mar 2010 18:56:26 +0000 Subject: Add coreboot framebuffer support to libpayload Signed-off-by: Stefan Reinauer Acked-by: Patrick Georgi git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5295 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/drivers/video/video.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'payloads/libpayload/drivers/video/video.c') diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c index 1eadce61cb..13606d5eb3 100644 --- a/payloads/libpayload/drivers/video/video.c +++ b/payloads/libpayload/drivers/video/video.c @@ -35,6 +35,10 @@ extern struct video_console geodelx_video_console; #endif +#ifdef CONFIG_COREBOOT_VIDEO_CONSOLE +extern struct video_console coreboot_video_console; +#endif + #ifdef CONFIG_VGA_VIDEO_CONSOLE extern struct video_console vga_video_console; #endif @@ -44,6 +48,9 @@ static struct video_console *console_list[] = #ifdef CONFIG_GEODELX_VIDEO_CONSOLE &geodelx_video_console, #endif +#ifdef CONFIG_COREBOOT_VIDEO_CONSOLE + &coreboot_video_console, +#endif #ifdef CONFIG_VGA_VIDEO_CONSOLE &vga_video_console, #endif @@ -66,12 +73,12 @@ static void video_console_fixup_cursor(void) if (cursory < 0) cursory = 0; - if (cursorx >= VIDEO_COLS) { + if (cursorx >= console->columns) { cursorx = 0; cursory++; } - while(cursory >= VIDEO_ROWS) { + while(cursory >= console->rows) { console->scroll_up(); cursory--; } @@ -112,10 +119,12 @@ void video_console_putc(u8 row, u8 col, unsigned int ch) void video_console_putchar(unsigned int ch) { /* replace black-on-black with light-gray-on-black. - do it here, instead of in libc/console.c */ + * do it here, instead of in libc/console.c + */ if ((ch & 0xFF00) == 0) { ch |= 0x0700; } + switch(ch & 0xFF) { case '\r': cursorx = 0; @@ -129,12 +138,12 @@ void video_console_putchar(unsigned int ch) cursorx--; if (cursorx < 0) { cursory--; - cursorx = VIDEO_COLS; + cursorx = console->columns; } break; case '\t': - while(cursorx % 8 && cursorx < VIDEO_COLS) { + while(cursorx % 8 && cursorx < console->columns) { if (console) console->putc(cursory, cursorx, (ch & 0xFF00) | ' '); -- cgit v1.2.3