From: "Guomin Jiang" <guomin.jiang@intel.com>
To: devel@edk2.groups.io
Cc: Andrew Fish <afish@apple.com>, Ray Ni <ray.ni@intel.com>
Subject: [PATCH v2 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully
Date: Tue, 1 Mar 2022 17:18:50 +0800 [thread overview]
Message-ID: <20220301091850.828-3-guomin.jiang@intel.com> (raw)
In-Reply-To: <20220301091850.828-1-guomin.jiang@intel.com>
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
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
EmulatorPkg/EmuGopDxe/GopScreen.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
index 41f748bc6402..9249eca1dd03 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
@@ -108,10 +108,6 @@ EmuGopSetMode (
}
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;
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,
--
2.35.1.windows.2
next prev parent reply other threads:[~2022-03-01 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 9:18 [PATCH v2 0/2] Avoid Emulator Segmentation fault Guomin Jiang
2022-03-01 9:18 ` [PATCH v2 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Guomin Jiang
2022-03-01 9:23 ` Ni, Ray
2022-03-01 9:18 ` Guomin Jiang [this message]
2022-03-01 9:20 ` [PATCH v2 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully Ni, Ray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220301091850.828-3-guomin.jiang@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox