* Fri Sep 16 2022 Miroslav Rezanina <mrezanin@redhat.com> - 20220526git16779ede2d36-4

- edk2-OvmfPkg-QemuVideoDxe-fix-bochs-mode-init.patch [RHELX-58]
- Resolves: RHELX-58
  (Guest console turns black with uefi rhel guests and stdvga)
This commit is contained in:
Miroslav Rezanina 2022-09-16 03:10:55 -04:00
parent 48d88437af
commit cf6de6db69
2 changed files with 93 additions and 1 deletions

View File

@ -0,0 +1,85 @@
From 9c11e4f884ab15c60d8a13ca7084742eb2f0e50b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 7 Sep 2022 11:15:04 +0200
Subject: [PATCH] OvmfPkg/QemuVideoDxe: fix bochs mode init
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
RH-MergeRequest: 17: OvmfPkg/QemuVideoDxe: fix bochs mode init
RH-Jira: RHELX-58
RH-Acked-by: Oliver Steffen <osteffen@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Pawel Polawski <ppolawsk@redhat.com>
RH-Commit: [1/1] a4be311ea4177a20113b80744c34f8bb77b2d775 (kraxel/centos-edk2)
Add VgaInb() helper function to read vga registers. With that in place
fix the unblanking. We need to put the ATT_ADDRESS_REGISTER flip flop
into a known state, which is done by reading the
INPUT_STATUS_1_REGISTER. Reading the INPUT_STATUS_1_REGISTER only works
when the device is in color mode, so make sure that bit (0x01) is set in
MISC_OUTPUT_REGISTER.
Currently the mode setting works more by luck because
ATT_ADDRESS_REGISTER flip flop happens to be in the state we need.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
(cherry picked from commit 512042eba87ff97a4820a55cf3b1a89a8afd1cc7)
---
OvmfPkg/QemuVideoDxe/Driver.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index b91909a14e..c28171d137 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -984,6 +984,34 @@ VgaOutb (
}
}
+STATIC
+UINT8
+VgaInb (
+ QEMU_VIDEO_PRIVATE_DATA *Private,
+ UINTN Reg
+ )
+{
+ EFI_STATUS Status;
+ UINT8 Data;
+
+ if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO) {
+ Data = 0;
+ Status = Private->PciIo->Mem.Read (
+ Private->PciIo,
+ EfiPciIoWidthUint8,
+ PCI_BAR_IDX2,
+ 0x400 - 0x3c0 + Reg,
+ 1,
+ &Data
+ );
+ ASSERT_EFI_ERROR (Status);
+ } else {
+ Data = inb (Private, Reg);
+ }
+
+ return Data;
+}
+
VOID
InitializeBochsGraphicsMode (
QEMU_VIDEO_PRIVATE_DATA *Private,
@@ -998,7 +1026,11 @@ InitializeBochsGraphicsMode (
ModeData->ColorDepth
));
- /* unblank */
+ /* set color mode */
+ VgaOutb (Private, MISC_OUTPUT_REGISTER, 0x01);
+
+ /* reset flip flop + unblank */
+ VgaInb (Private, INPUT_STATUS_1_REGISTER);
VgaOutb (Private, ATT_ADDRESS_REGISTER, 0x20);
BochsWrite (Private, VBE_DISPI_INDEX_ENABLE, 0);
--
2.31.1

View File

@ -24,7 +24,7 @@ ExclusiveArch: x86_64 aarch64
Name: edk2
Version: %{GITDATE}git%{GITCOMMIT}
Release: 3%{?dist}
Release: 4%{?dist}
Summary: UEFI firmware for 64-bit virtual machines
License: BSD-2-Clause-Patent and OpenSSL and MIT
URL: http://www.tianocore.org
@ -78,6 +78,8 @@ Patch0030: 0030-OvmfPkg-Remove-HttpDynamicCommand-from-shell-RHEL-on.patch
Patch0031: 0031-ArmVirtPkg-Remove-HttpDynamicCommand-from-shell-RHEL.patch
Patch0032: 0032-OvmfPkg-Remove-LinuxInitrdDynamicShellCommand-RHEL-o.patch
Patch0033: 0033-ArmVirtPkg-Remove-LinuxInitrdDynamicShellCommand-RHE.patch
# For RHELX-58 - Guest console turns black with uefi rhel guests and stdvga
Patch34: edk2-OvmfPkg-QemuVideoDxe-fix-bochs-mode-init.patch
# python3-devel and libuuid-devel are required for building tools.
@ -528,6 +530,11 @@ KERNEL_IMG=$(rpm -q -l $KERNEL_PKG | egrep '^/lib/modules/[^/]+/vmlinuz$')
%changelog
* Fri Sep 16 2022 Miroslav Rezanina <mrezanin@redhat.com> - 20220526git16779ede2d36-4
- edk2-OvmfPkg-QemuVideoDxe-fix-bochs-mode-init.patch [RHELX-58]
- Resolves: RHELX-58
(Guest console turns black with uefi rhel guests and stdvga)
* Mon Aug 01 2022 Miroslav Rezanina <mrezanin@redhat.com> - 20220526git16779ede2d36-3
- edk2-openssl-jump-to-8.7.0-branch-2022-07-22.patch [bz#2074843]
- edk2-ovmf-vars-generator-Use-max-cpu.patch [bz#2111567]