summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/QemuVideoDxe/Driver.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-08-18 11:01:56 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-09-01 22:54:33 +0200
commit442c2ab81e87766f49a0f5656f39512bf1908028 (patch)
tree39371a168618835c6543b35496d3fd3cae9c011e /OvmfPkg/QemuVideoDxe/Driver.c
parentb10d5ddc0385f39d2c2c62843710b7609a4ca169 (diff)
downloadedk2-442c2ab81e87766f49a0f5656f39512bf1908028.tar.gz
edk2-442c2ab81e87766f49a0f5656f39512bf1908028.tar.bz2
edk2-442c2ab81e87766f49a0f5656f39512bf1908028.zip
OvmfPkg/QemuVideoDxe: don't incorrectly bind virtio-gpu-pci
The PCI (Vendor ID, Device ID) pair (0x1af4, 0x1050) stands for both the virtio-vga and the virtio-gpu-pci device models of QEMU. They differ in two things: - the former has a VGA-compatibility linear framebuffer on top of the latter, - the former has PCI_CLASS_DISPLAY_VGA device class, while the latter has PCI_CLASS_DISPLAY_OTHER. In commit 94210dc95e9f ("OvmfPkg: QemuVideoDxe: add virtio-vga support"), we enabled QemuVideoDxe to drive virtio-vga simply by adding its (Vendor ID, Device ID) pair to gQemuVideoCardList. This change inadvertently allowed QemuVideoDxe to bind virtio-gpu-pci, which it cannot drive though. Restrict QemuVideoDxe to PCI_CLASS_DISPLAY_VGA, in order to exclude virtio-gpu-pci. For the other cards that QemuVideoDxe drives, this makes no difference. (Note that OvmfPkg's PlatformBootManagerLib instance has always only added PCI_CLASS_DISPLAY_VGA devices to ConOut; see DetectAndPreparePlatformPciDevicePath().) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Fixes: 94210dc95e9f7c6ff4066a9b35a288e6f1c271bf Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/QemuVideoDxe/Driver.c')
-rw-r--r--OvmfPkg/QemuVideoDxe/Driver.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 8d962b4438..fc8025ec46 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -134,6 +134,9 @@ QemuVideoControllerDriverSupported (
}
Status = EFI_UNSUPPORTED;
+ if (!IS_PCI_VGA (&Pci)) {
+ goto Done;
+ }
Card = QemuVideoDetect(Pci.Hdr.VendorId, Pci.Hdr.DeviceId);
if (Card != NULL) {
DEBUG ((EFI_D_INFO, "QemuVideo: %s detected\n", Card->Name));