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 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully
Date: Tue, 22 Feb 2022 11:40:38 +0800 [thread overview]
Message-ID: <20220222034038.966-3-guomin.jiang@intel.com> (raw)
In-Reply-To: <20220222034038.966-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 | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
index 41f748bc6402..ec5ef795d6e5 100644
--- a/EmulatorPkg/EmuGopDxe/GopScreen.c
+++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
@@ -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-02-22 3:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 3:40 [PATCH 0/2] Avoid Emulator Segmentation fault Guomin Jiang
2022-02-22 3:40 ` [PATCH 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Guomin Jiang
2022-02-22 3:40 ` Guomin Jiang [this message]
2022-03-01 7:16 ` [PATCH 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully Ni, Ray
[not found] ` <16D5FEACC0A8B3B7.28921@groups.io>
2022-02-24 0:55 ` [edk2-devel] " Guomin Jiang
[not found] ` <16D5FEAC9A733E6B.24964@groups.io>
2022-02-24 0:56 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Guomin Jiang
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=20220222034038.966-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