]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/EmuGopDxe/GopScreen.c
EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully
[mirror_edk2.git] / EmulatorPkg / EmuGopDxe / GopScreen.c
index 41f748bc640201de214f51697b36080c32e84c4f..88d95b88e1627363beff62c5a65d8ac2b8757e82 100644 (file)
@@ -1,6 +1,6 @@
 /*++ @file\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>\r
 Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -107,11 +107,7 @@ EmuGopSetMode (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  ModeData                                                 = &Private->ModeData[ModeNumber];\r
-  This->Mode->Mode                                         = ModeNumber;\r
-  Private->GraphicsOutput.Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;\r
-  Private->GraphicsOutput.Mode->Info->VerticalResolution   = ModeData->VerticalResolution;\r
-  Private->GraphicsOutput.Mode->Info->PixelsPerScanLine    = ModeData->HorizontalResolution;\r
+  ModeData = &Private->ModeData[ModeNumber];\r
 \r
   if (Private->HardwareNeedsStarting) {\r
     Status = EmuGopStartWindow (\r
@@ -128,6 +124,11 @@ EmuGopSetMode (
     Private->HardwareNeedsStarting = FALSE;\r
   }\r
 \r
+  This->Mode->Mode                                         = ModeNumber;\r
+  Private->GraphicsOutput.Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;\r
+  Private->GraphicsOutput.Mode->Info->VerticalResolution   = ModeData->VerticalResolution;\r
+  Private->GraphicsOutput.Mode->Info->PixelsPerScanLine    = ModeData->HorizontalResolution;\r
+\r
   Status = Private->EmuGraphicsWindow->Size (\r
                                          Private->EmuGraphicsWindow,\r
                                          ModeData->HorizontalResolution,\r