]> git.ipfire.org Git - thirdparty/grub.git/commit
efi/console: Properly clear leftover artifacts from the screen
authorMichael Chang <mchang@suse.com>
Thu, 3 Oct 2024 07:23:08 +0000 (15:23 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Oct 2024 10:36:56 +0000 (12:36 +0200)
commite5f047be053a1d6d10590bc413d089535a13454c
tree41c94f463fcc9bb71bc5193ff99be148c96707d5
parentc5ae124e11f28f637cbd38cb4d6c1b9817baa135
efi/console: Properly clear leftover artifacts from the screen

A regression in GRUB 2.12 causes the GRUB screen to become cluttered
with artifacts from the previous screen whether it's the UEFI post UI,
UEFI shell or any graphical UI running before GRUB. This issue occurs
in situations like booting GRUB from the UEFI shell and going straight
to the rescue or command shell causing visual discomfort.

The regression was introduced by commit 2d7c3abd8 (efi/console: Do not
set text-mode until it is actually needed). To address the screen
flickering issue this commit suppresses the text-mode setting until the
first output is requested. Before text-mode is set any attempt to clear
the screen has no effect. This inactive period renders the clear screen
ineffective in early boot stages, potentially leaving leftover artifacts
that will clutter the GRUB console display, as there is no guarantee
there will always be a clear screen after the first output.

The issue is fixed by ensuring grub_console_cls() to work through lazy
mode-setting, while also avoiding screen clearing for the hidden menu
which the flicker-free patch aims to improve.

Fixes: 2d7c3abd8 (efi/console: Do not set text-mode until we actually need it)
Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/normal/menu.c
grub-core/term/efi/console.c