diff options
author | Guomin Jiang <guomin.jiang@intel.com> | 2022-02-22 11:29:23 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-03-03 05:17:46 +0000 |
commit | b422b0fcf92dd4103dfc16d8d5f77fbec2d8c5b9 (patch) | |
tree | 4443a732f23761c3f5a4a3d1528a26e4c0052360 /EmulatorPkg | |
parent | 906242343f7a654402f6f999d447aa9d29a8f4d4 (diff) | |
download | edk2-b422b0fcf92dd4103dfc16d8d5f77fbec2d8c5b9.tar.gz edk2-b422b0fcf92dd4103dfc16d8d5f77fbec2d8c5b9.tar.bz2 edk2-b422b0fcf92dd4103dfc16d8d5f77fbec2d8c5b9.zip |
EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2668
WindowOpen will fail in some case. for example, without XServer.
Shouldn't set ModeInfo in this case to avoid the caller use it
incorrectly
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Diffstat (limited to 'EmulatorPkg')
-rw-r--r-- | EmulatorPkg/EmuGopDxe/GopScreen.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c index 41f748bc64..88d95b88e1 100644 --- a/EmulatorPkg/EmuGopDxe/GopScreen.c +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c @@ -1,6 +1,6 @@ /*++ @file
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -107,11 +107,7 @@ EmuGopSetMode ( return EFI_UNSUPPORTED;
}
- ModeData = &Private->ModeData[ModeNumber];
- This->Mode->Mode = ModeNumber;
- Private->GraphicsOutput.Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;
- Private->GraphicsOutput.Mode->Info->VerticalResolution = ModeData->VerticalResolution;
- Private->GraphicsOutput.Mode->Info->PixelsPerScanLine = ModeData->HorizontalResolution;
+ ModeData = &Private->ModeData[ModeNumber];
if (Private->HardwareNeedsStarting) {
Status = EmuGopStartWindow (
@@ -128,6 +124,11 @@ EmuGopSetMode ( Private->HardwareNeedsStarting = FALSE;
}
+ This->Mode->Mode = ModeNumber;
+ Private->GraphicsOutput.Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;
+ Private->GraphicsOutput.Mode->Info->VerticalResolution = ModeData->VerticalResolution;
+ Private->GraphicsOutput.Mode->Info->PixelsPerScanLine = ModeData->HorizontalResolution;
+
Status = Private->EmuGraphicsWindow->Size (
Private->EmuGraphicsWindow,
ModeData->HorizontalResolution,
|