Only initialize StdOut if there's no GOP available.  This avoids
forcefully switching StdOut to the maximum supported resolution, and
thus very likely changing the GOP mode without having first parsed the
command line options.

Signed-off-by: Roger Pau Monné <roger....@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/arch/x86/efi/efi-boot.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index f46c1f021e..42aa135446 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -820,12 +820,6 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, 
EFI_SYSTEM_TABLE *SystemTable
 
     efi_init(ImageHandle, SystemTable);
 
-    efi_console_set_mode();
-
-    if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
-                           &cols, &rows) == EFI_SUCCESS )
-        efi_arch_console_init(cols, rows);
-
     gop = efi_get_gop(&gop_handle);
 
     if ( gop )
@@ -887,6 +881,15 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, 
EFI_SYSTEM_TABLE *SystemTable
 
         efi_arch_edid(gop_handle);
     }
+    else
+    {
+        /* If no GOP, init ConOut (StdOut) to the max supported size. */
+        efi_console_set_mode();
+
+        if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
+                               &cols, &rows) == EFI_SUCCESS )
+            efi_arch_console_init(cols, rows);
+    }
 
     efi_arch_edd();
     efi_arch_cpu();
-- 
2.40.0


Reply via email to