From 3c5a4af6e943231ea75d58f6cf85b785a156b7b9 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 28 Nov 2019 05:40:15 +0000 Subject: [PATCH] Also turn of teken for RB_MULTIPLE RB_MULTIPLE without RB_SERIAL set is valid, and means 'Video first, then serial' to the kernel (so kernel messages go to both, but /etc/rc uses video console (this should be fixed, btw, but another day)). Check for RB_MULTIPLE as well as RB_SERIAL where we want to to serial things. This means we'll use the old code for emulation in these situations, which is likely best since we're outputing to both and the old code is ligher weight allowing both to keep up w/o weird scrolling things. --- stand/efi/libefi/efi_console.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 555716335cdc..d3563d0b4d81 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -824,9 +824,13 @@ efi_cons_update_mode(void) * terminal emulator for efi text mode to support the menu. * While teken is too expensive to be used on serial console, the * pre-teken emulator is light enough to be used on serial console. + * + * When doing multiple consoles (both serial and video), + * also just use the old emulator. RB_MULTIPLE also implies + * we're using a serial console. */ mode = parse_uefi_con_out(); - if ((mode & RB_SERIAL) == 0) { + if ((mode & (RB_SERIAL | RB_MULTIPLE)) == 0) { if (buffer != NULL) { if (tp.tp_row == rows && tp.tp_col == cols) return (true); @@ -998,7 +1002,11 @@ efi_cons_putchar(int c) { unsigned char ch = c; - if ((mode & RB_SERIAL) != 0) { + /* + * Don't use Teken when we're doing pure serial, or a multiple console + * with video "primary" because that's also serial. + */ + if ((mode & (RB_SERIAL | RB_MULTIPLE)) != 0) { input_byte(ch); return; }