diff options
author | Gabe Black <gabeblack@google.com> | 2012-10-05 23:35:04 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-11-09 19:02:11 +0100 |
commit | dd9e4e58cdd0a684e301f1b16b2f92e20e0b3418 (patch) | |
tree | 226d9afec3055398ec9f3c582beb5e3ddf8fd426 /payloads/libpayload/drivers | |
parent | a54b6a61433600fe80d215dc8f8489fab44d0bfd (diff) |
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>
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r-- | payloads/libpayload/drivers/video/video.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c index 13606d5eb3..d7fc8de923 100644 --- a/payloads/libpayload/drivers/video/video.c +++ b/payloads/libpayload/drivers/video/video.c @@ -183,29 +183,36 @@ static struct console_output_driver cons = { .putchar = video_console_putchar }; -int video_console_init(void) +int video_init(void) { - int i; - - for(i = 0; i < ARRAY_SIZE(console_list); i++) { - if (console_list[i]->init()) - continue; + int i; - console = console_list[i]; + for (i = 0; i < ARRAY_SIZE(console_list); i++) { + if (console_list[i]->init()) + continue; - if (console->get_cursor) - console->get_cursor((unsigned int*)&cursorx, (unsigned int*)&cursory, &cursor_enabled); + console = console_list[i]; - if (cursorx) { - cursorx = 0; - cursory++; - } + if (console->get_cursor) + console->get_cursor((unsigned int*)&cursorx, + (unsigned int*)&cursory, + &cursor_enabled); - video_console_fixup_cursor(); - console_add_output_driver(&cons); - return 0; + if (cursorx) { + cursorx = 0; + cursory++; } + video_console_fixup_cursor(); return 0; + } +} + +int video_console_init(void) +{ + video_init(); + if (console) + console_add_output_driver(&cons); + return 0; } |