[PATCH v5 2/2] efi_loader: Set default console colors on efi_cout_clear_screen if needed

Jan Kiszka jan.kiszka at siemens.com
Wed Jan 18 22:25:00 CET 2023


From: Jan Kiszka <jan.kiszka at siemens.com>

Ensures a consistent background color of the whole screen for succeeding
outputs as both demanded by the spec and implemented in EDK2 as well.

Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
---
 lib/efi_loader/efi_console.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index faa605e88d1..db31b2a751a 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -501,6 +501,12 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
 {
 	EFI_ENTRY("%p", this);
 
+	/* Set default colors if not done yet */
+	if (efi_con_mode.attribute == 0) {
+		efi_con_mode.attribute = 0x07;
+		printf(ESC "[0;37;40m");
+	}
+
 	efi_clear_screen();
 
 	return EFI_EXIT(EFI_SUCCESS);
-- 
2.35.3



More information about the U-Boot mailing list