[coreboot-gerrit] New patch to review for coreboot: ecfa02a libpayload: video: Make cursor fixup independent of visibility
Marc Jones (marc.jones@se-eng.com)
gerrit at coreboot.org
Mon Dec 22 23:03:08 CET 2014
Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7908
-gerrit
commit ecfa02a3434ed0d629a7ab1f98edb8f1c960689d
Author: Julius Werner <jwerner at chromium.org>
Date: Tue Apr 22 13:06:13 2014 -0700
libpayload: video: Make cursor fixup independent of visibility
The video console runs a video_console_fixup_cursor() function after
every printed character to make sure the cursor is still in the output
window and avoid overflows. For some crazy reason, this function does
not run when cursor_enabled is false... however, that variable is only
about cursor *visibility*, and it's imperative that we still do proper
bounds checking for our output even if the cursor itself doesn't get
displayed (otherwise we can end up overwriting malloc cookies that cause
a panic on the next free() and other fun things like that).
In fact, there seems to be no reason at all to even keep track of the
cursor visibility state in the generic video console framework (the
specific backends already do it, too), so let's remove that code
entirely. Also set the default cursor visibilty in the corebootfb
backend to 0 since that's consistent with what the other backends do.
BUG=None
TEST=Turn on video console on Big, generate enough output to make it
scroll, make sure it does not crash.
Original-Change-Id: I1201a5bccb4711b6ecfc4cf47a8ace16331501b4
Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/196323
Original-Reviewed-by: Gabe Black <gabeblack at chromium.org>
Original-Reviewed-by: Hung-Te Lin <hungte at chromium.org>
Original-Reviewed-by: Stefan Reinauer <reinauer at chromium.org>
(cherry picked from commit 1f880bca06ed0a3f2c75abab399d32a2e51ed10e)
Signed-off-by: Marc Jones <marc.jones at se-eng.com>
Change-Id: I6c67a9efb00d96fcd67f7bc1ab55a23e78fc479e
---
payloads/libpayload/drivers/video/corebootfb.c | 4 ----
payloads/libpayload/drivers/video/video.c | 12 ++----------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/payloads/libpayload/drivers/video/corebootfb.c b/payloads/libpayload/drivers/video/corebootfb.c
index d661466..f0f1007 100644
--- a/payloads/libpayload/drivers/video/corebootfb.c
+++ b/payloads/libpayload/drivers/video/corebootfb.c
@@ -247,10 +247,6 @@ static int corebootfb_init(void)
// clear boot splash screen if there is one.
corebootfb_clear();
-
- corebootfb_set_cursor(0, 0);
- corebootfb_enable_cursor(1);
-
return 0;
}
diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c
index ce0374d..318548b 100644
--- a/payloads/libpayload/drivers/video/video.c
+++ b/payloads/libpayload/drivers/video/video.c
@@ -60,7 +60,6 @@ static struct video_console *console;
static int cursorx;
static int cursory;
-static unsigned int cursor_enabled = 1;
void video_get_rows_cols(unsigned int *rows, unsigned int *cols)
{
@@ -74,9 +73,6 @@ void video_get_rows_cols(unsigned int *rows, unsigned int *cols)
static void video_console_fixup_cursor(void)
{
- if (!cursor_enabled)
- return;
-
if (cursorx < 0)
cursorx = 0;
@@ -101,11 +97,6 @@ void video_console_cursor_enable(int state)
{
if (console && console->enable_cursor)
console->enable_cursor(state);
-
- cursor_enabled = state;
-
- if (cursor_enabled)
- video_console_fixup_cursor();
}
void video_console_clear(void)
@@ -197,6 +188,7 @@ static struct console_output_driver cons = {
int video_init(void)
{
int i;
+ unsigned int dummy_cursor_enabled;
for (i = 0; i < ARRAY_SIZE(console_list); i++) {
if (console_list[i]->init())
@@ -207,7 +199,7 @@ int video_init(void)
if (console->get_cursor)
console->get_cursor((unsigned int*)&cursorx,
(unsigned int*)&cursory,
- &cursor_enabled);
+ &dummy_cursor_enabled);
if (cursorx) {
cursorx = 0;
More information about the coreboot-gerrit
mailing list