grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix screen coud be filled with leftover artifacts
@ 2024-06-20  6:48 Michael Chang via Grub-devel
  2024-06-20  7:12 ` Michael Chang via Grub-devel
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Chang via Grub-devel @ 2024-06-20  6:48 UTC (permalink / raw
  To: The development of GNU GRUB; +Cc: Michael Chang

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>
---
 grub-core/normal/menu.c      | 7 ++++---
 grub-core/term/efi/console.c | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index 6a90e091f..f24544b27 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -881,13 +881,14 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
       if (! e)
 	continue; /* Menu is empty.  */
 
-      grub_cls ();
-
       if (auto_boot)
 	grub_menu_execute_with_fallback (menu, e, autobooted,
 					 &execution_callback, &notify_boot);
       else
-	grub_menu_execute_entry (e, 0);
+	{
+	  grub_cls ();
+	  grub_menu_execute_entry (e, 0);
+	}
       if (autobooted)
 	break;
     }
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
index bb587f39d..258b52737 100644
--- a/grub-core/term/efi/console.c
+++ b/grub-core/term/efi/console.c
@@ -432,7 +432,7 @@ grub_console_cls (struct grub_term_output *term __attribute__ ((unused)))
   grub_efi_simple_text_output_interface_t *o;
   grub_efi_int32_t orig_attr;
 
-  if (grub_efi_is_finished || text_mode != GRUB_TEXT_MODE_AVAILABLE)
+  if (grub_prepare_for_text_output (term) != GRUB_ERR_NONE)
     return;
 
   o = grub_efi_system_table->con_out;
-- 
2.45.2


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix screen coud be filled with leftover artifacts
  2024-06-20  6:48 [PATCH] Fix screen coud be filled with leftover artifacts Michael Chang via Grub-devel
@ 2024-06-20  7:12 ` Michael Chang via Grub-devel
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Chang via Grub-devel @ 2024-06-20  7:12 UTC (permalink / raw
  To: The development of GNU GRUB; +Cc: Michael Chang

On Thu, Jun 20, 2024 at 02:48:55PM GMT, Michael Chang wrote:
> 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.

Here the captured screen to the issue happened:

https://paste.opensuse.org/pastes/cbef185ed55c

Thanks,
Michael

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-20  7:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20  6:48 [PATCH] Fix screen coud be filled with leftover artifacts Michael Chang via Grub-devel
2024-06-20  7:12 ` Michael Chang via Grub-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).