From 88af68e6fba1f28152ca994c2e2530c4490b2a8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Sun, 27 Nov 2016 23:01:30 +0100 Subject: [PATCH] syscons - Make sure we draw the terminal border during syscons startup. * Try drawing the border first in scinit. If we use the UEFI framebuffer, and efi_fb_info.vaddr is still NULL, we call sc_set_border again in scmeminit() when efi_fb_info.vaddr will be definitely non-NULL. * This makes sure that we clear any garbage left from the UEFI bootloader stage on the screen, after ae88e4ee083dbf5a51e10cae2cdf213e2a7c5225. --- sys/dev/misc/syscons/syscons.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/misc/syscons/syscons.c b/sys/dev/misc/syscons/syscons.c index ad86af6a90..d1c0d4c233 100644 --- a/sys/dev/misc/syscons/syscons.c +++ b/sys/dev/misc/syscons/syscons.c @@ -113,6 +113,7 @@ static void *kernel_console_ts; static char init_done = COLD; static char shutdown_in_progress = FALSE; static char sc_malloc = FALSE; +static char sc_filled_border = FALSE; /* filled initial VT border */ static int saver_mode = CONS_NO_SAVER; /* LKM/user saver */ static int run_scrn_saver = FALSE; /* should run the saver? */ @@ -559,6 +560,12 @@ scmeminit(void *arg) /* initialize history buffer & pointers */ sc_alloc_history_buffer(sc_console, 0, 0, TRUE); #endif + + /* Fill initial terminal border, efi_fb_info.vaddr should be non-NULL now */ + if (!sc_filled_border) { + sc_filled_border = TRUE; + sc_set_border(sc_console, sc_console->border); + } } SYSINIT(sc_mem, SI_BOOT1_POST, SI_ORDER_ANY, scmeminit, NULL); @@ -3111,6 +3118,11 @@ scinit(int unit, int flags) if (!ISGRAPHSC(scp)) { sc_set_cursor_image(scp); sc_draw_cursor_image(scp); + /* If framebuffer vaddr is still 0, we can't draw the border yet */ + if (scp->sc->fbi != NULL && scp->sc->fbi->vaddr != 0) { + sc_filled_border = TRUE; + sc_set_border(scp, scp->border); + } } /* save font and palette */ -- 2.11.4.GIT