libpayload: Separate video initialization and the video console.

It's possible to want to display text on the display without using it as a
console. This change separates the initialization of the video code from
setting up the video console by pulling out everything but installing the
console into a new function called video_init.

Change-Id: Ie07654ca13f79489c0e9b3a4998b96f598ab8513
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/1733
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Gabe Black 2012-10-05 23:35:04 -07:00 committed by Stefan Reinauer
parent a54b6a6143
commit dd9e4e58cd
2 changed files with 24 additions and 16 deletions

View File

@ -183,7 +183,7 @@ static struct console_output_driver cons = {
.putchar = video_console_putchar .putchar = video_console_putchar
}; };
int video_console_init(void) int video_init(void)
{ {
int i; int i;
@ -194,7 +194,9 @@ int video_console_init(void)
console = console_list[i]; console = console_list[i];
if (console->get_cursor) if (console->get_cursor)
console->get_cursor((unsigned int*)&cursorx, (unsigned int*)&cursory, &cursor_enabled); console->get_cursor((unsigned int*)&cursorx,
(unsigned int*)&cursory,
&cursor_enabled);
if (cursorx) { if (cursorx) {
cursorx = 0; cursorx = 0;
@ -202,10 +204,15 @@ int video_console_init(void)
} }
video_console_fixup_cursor(); video_console_fixup_cursor();
return 0;
}
}
int video_console_init(void)
{
video_init();
if (console)
console_add_output_driver(&cons); console_add_output_driver(&cons);
return 0; return 0;
} }
return 0;
}

View File

@ -192,6 +192,7 @@ void speaker_tone(u16 freq, unsigned int duration);
* @ingroup input * @ingroup input
* @{ * @{
*/ */
int video_init(void);
int video_console_init(void); int video_console_init(void);
void video_console_putchar(unsigned int ch); void video_console_putchar(unsigned int ch);
void video_console_putc(u8 row, u8 col, unsigned int ch); void video_console_putc(u8 row, u8 col, unsigned int ch);