aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/video/video.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-03-25 18:56:26 +0000
committerStefan Reinauer <stepan@openbios.org>2010-03-25 18:56:26 +0000
commitb700254aa5150023a13902adbe31839ec4f926cb (patch)
tree087400b833d533b12097fa21454815aff6df9784 /payloads/libpayload/drivers/video/video.c
parent7208f6e031957ab163136546c191d577c7418299 (diff)
Add coreboot framebuffer support to libpayload
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5295 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers/video/video.c')
-rw-r--r--payloads/libpayload/drivers/video/video.c19
1 files changed, 14 insertions, 5 deletions
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) | ' ');