[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.12] efi/boot: make sure graphics mode is set while booting through MB2



commit bc87a2df6f706c582103d14c672b7303555957f7
Author:     Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
AuthorDate: Fri Oct 25 11:42:29 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Oct 25 11:42:29 2019 +0200

    efi/boot: make sure graphics mode is set while booting through MB2
    
    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@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: af9f357fb8dbceb9c5dd1c5cb8b4e198f6149456
    master date: 2019-10-10 10:58:45 +0200
---
 xen/common/efi/boot.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 00fd139175..cb2b2336a7 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -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. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.