From edfe16a6d9f8c6830d7ad93ee7616225fe4e9c13 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 24 Feb 2020 17:35:39 +0100 Subject: OvmfPkg/QemuVideoDxe: unbreak "secondary-vga" and "bochs-display" support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In edk2 commit 333f32ec23dd, QemuVideoDxe gained support for QEMU's "secondary-vga" device model (originally introduced in QEMU commit 63e3e24db2e9). In QEMU commit 765c94290863, the "bochs-display" device was introduced, which would work with QemuVideoDxe out of the box, reusing the "secondary-vga" logic. Support for both models has been broken since edk2 commit 662bd0da7fd7. Said patch ended up requiring VGA IO Ports -- i.e., at least one of EFI_PCI_IO_ATTRIBUTE_VGA_IO and EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 -- even if the device wasn't actually VGA compatible. Restrict the IO Ports requirement to VGA compatible devices. Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jordan Justen Cc: Marc W Chen Cc: Philippe Mathieu-Daudé Fixes: 662bd0da7fd77e4d2cf9ef4a78015af5cad7d9db Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2555 Signed-off-by: Laszlo Ersek Message-Id: <20200224171741.7494-1-lersek@redhat.com> Acked-by: Ard Biesheuvel Reviewed-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé --- OvmfPkg/QemuVideoDxe/Driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c index 6a4a860b3c..37bbbbe843 100644 --- a/OvmfPkg/QemuVideoDxe/Driver.c +++ b/OvmfPkg/QemuVideoDxe/Driver.c @@ -292,7 +292,7 @@ QemuVideoControllerDriverStart ( } SupportedVgaIo &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16); - if (SupportedVgaIo == 0) { + if (SupportedVgaIo == 0 && IS_PCI_VGA (&Pci)) { Status = EFI_UNSUPPORTED; goto ClosePciIo; } -- cgit v1.2.3