forked from pool/grub2
3e026f665c
- Add safety measure to pcr snapshot by checking platform and tpm status * safe_tpm_pcr_snapshot.patch - Fix installation failure due to unavailable nvram device on ppc64le (bsc#1201361) * 0001-grub-install-set-point-of-no-return-for-powerpc-ieee1275.patch - Add patches to dynamically allocate additional memory regions for EFI systems (bsc#1202438) * 0001-mm-Allow-dynamically-requesting-additional-memory-re.patch * 0002-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch * 0003-kern-efi-mm-Extract-function-to-add-memory-regions.patch * 0004-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch * 0005-kern-efi-mm-Implement-runtime-addition-of-pages.patch - Enlarge the default heap size and defer the disk cache invalidation (bsc#1202438) * 0001-kern-efi-mm-Enlarge-the-default-heap-size.patch * 0002-mm-Defer-the-disk-cache-invalidation.patch - Add patches for ALP FDE support * 0001-devmapper-getroot-Have-devmapper-recognize-LUKS2.patch * 0002-devmapper-getroot-Set-up-cheated-LUKS2-cryptodisk-mo.patch * 0003-disk-cryptodisk-When-cheatmounting-use-the-sector-in.patch * 0004-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch * 0005-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch * 0006-EFI-console-Do-not-set-colorstate-until-the-first-te.patch * 0007-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch * 0008-linuxefi-Use-common-grub_initrd_load.patch * 0009-Add-crypttab_entry-to-obviate-the-need-to-input-pass.patch * 0010-templates-import-etc-crypttab-to-grub.cfg.patch OBS-URL: https://build.opensuse.org/request/show/1004537 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=419
76 lines
2.6 KiB
Diff
76 lines
2.6 KiB
Diff
From 9b12dc80d4254e22c41805cecf2494a8e6a50e3e Mon Sep 17 00:00:00 2001
|
|
From: Hans de Goede <hdegoede@redhat.com>
|
|
Date: Fri, 28 Jan 2022 12:43:49 +0100
|
|
Subject: [PATCH 07/10] EFI: console: Do not set cursor until the first text
|
|
output
|
|
|
|
To allow flickerfree boot the EFI console code does not call
|
|
grub_efi_set_text_mode (1) until some text is actually output.
|
|
|
|
Depending on if the output text is because of an error loading
|
|
e.g. the .cfg file; or because of showing the menu the cursor needs
|
|
to be on or off when the first text is shown.
|
|
|
|
So far the cursor was hardcoded to being on, but this is causing
|
|
drawing artifacts + slow drawing of the menu as reported here:
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1946969
|
|
|
|
Handle the cursorstate in the same way as the colorstate to fix this,
|
|
when no text has been output yet, just cache the cursorstate and
|
|
then use the last set value when the first text is output.
|
|
|
|
Fixes: 2d7c3abd871f ("efi/console: Do not set text-mode until we actually need it")
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
---
|
|
grub-core/term/efi/console.c | 19 ++++++++++++++++---
|
|
1 file changed, 16 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
|
|
index c44b2ac318..a3622e4fe5 100644
|
|
--- a/grub-core/term/efi/console.c
|
|
+++ b/grub-core/term/efi/console.c
|
|
@@ -31,7 +31,15 @@ typedef enum {
|
|
}
|
|
grub_text_mode;
|
|
|
|
+typedef enum {
|
|
+ GRUB_CURSOR_MODE_UNDEFINED = -1,
|
|
+ GRUB_CURSOR_MODE_OFF = 0,
|
|
+ GRUB_CURSUR_MODE_ON
|
|
+}
|
|
+grub_cursor_mode;
|
|
+
|
|
static grub_text_mode text_mode = GRUB_TEXT_MODE_UNDEFINED;
|
|
+static grub_cursor_mode cursor_mode = GRUB_CURSOR_MODE_UNDEFINED;
|
|
static grub_term_color_state text_colorstate = GRUB_TERM_COLOR_UNDEFINED;
|
|
|
|
static grub_uint32_t
|
|
@@ -119,8 +127,12 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)),
|
|
{
|
|
grub_efi_simple_text_output_interface_t *o;
|
|
|
|
- if (grub_efi_is_finished)
|
|
- return;
|
|
+ if (grub_efi_is_finished || text_mode != GRUB_TEXT_MODE_AVAILABLE)
|
|
+ {
|
|
+ /* Cache cursor changes before the first text-output */
|
|
+ cursor_mode = on;
|
|
+ return;
|
|
+ }
|
|
|
|
o = grub_efi_system_table->con_out;
|
|
efi_call_2 (o->enable_cursor, o, on);
|
|
@@ -143,7 +155,8 @@ grub_prepare_for_text_output (struct grub_term_output *term)
|
|
return GRUB_ERR_BAD_DEVICE;
|
|
}
|
|
|
|
- grub_console_setcursor (term, 1);
|
|
+ if (cursor_mode != GRUB_CURSOR_MODE_UNDEFINED)
|
|
+ grub_console_setcursor (term, cursor_mode);
|
|
if (text_colorstate != GRUB_TERM_COLOR_UNDEFINED)
|
|
grub_console_setcolorstate (term, text_colorstate);
|
|
text_mode = GRUB_TEXT_MODE_AVAILABLE;
|
|
--
|
|
2.34.1
|
|
|