]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
efi/boot: make sure graphics mode is set while booting through MB2
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Thu, 10 Oct 2019 08:58:45 +0000 (10:58 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 10 Oct 2019 08:58:45 +0000 (10:58 +0200)
If a bootloader is using native driver instead of EFI GOP it might
reset graphics mode to be different from what has been originally set
by firmware. While booting through MB2 Xen either need to parse video
setting passed by MB2 and use them instead of what GOP reports or
reset the mode to synchronise it with firmware - prefer the latter.

Observed while booting Xen using MB2 with EFI GRUB2 compiled with
all possible video drivers where native drivers take priority over firmware.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/common/efi/boot.c

index 00fd1391755f520c863dfe0f8d4e418c6e15fbf6..cb2b2336a701a083b828d5bd008e53c0d2ee1dae 100644 (file)
@@ -1049,8 +1049,12 @@ static void __init efi_set_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN gop
     EFI_STATUS status;
     UINTN info_size;
 
-    /* Set graphics mode. */
-    if ( gop_mode < gop->Mode->MaxMode && gop_mode != gop->Mode->Mode )
+    /*
+     * Set graphics mode to a selected one and reset it if we didn't come
+     * directly from EFI loader as video settings might have been already modified.
+     */
+    if ( gop_mode < gop->Mode->MaxMode &&
+         (gop_mode != gop->Mode->Mode || !efi_enabled(EFI_LOADER)) )
         gop->SetMode(gop, gop_mode);
 
     /* Get graphics and frame buffer info. */