goto CloseProtocol;\r
}\r
\r
+ Status = EFI_UNSUPPORTED;\r
//\r
// Recognize non-transitional modern devices. Also, we'll have to parse the\r
// PCI capability list, so make sure the CapabilityPtr field will be valid.\r
Pci.Hdr.RevisionID >= 0x01 &&\r
Pci.Device.SubsystemID >= 0x40 &&\r
(Pci.Hdr.Status & EFI_PCI_STATUS_CAPABILITY) != 0) {\r
- Status = EFI_SUCCESS;\r
- } else {\r
- Status = EFI_UNSUPPORTED;\r
+ //\r
+ // The virtio-vga device is special. It can be driven both as a VGA device\r
+ // with a linear framebuffer, and through its underlying, modern,\r
+ // virtio-gpu-pci device, which has no linear framebuffer itself. For\r
+ // compatibility with guest OSes that insist on inheriting a linear\r
+ // framebuffer from the firmware, we should leave virtio-vga to\r
+ // QemuVideoDxe, and support only virtio-gpu-pci here.\r
+ //\r
+ // Both virtio-vga and virtio-gpu-pci have DeviceId 0x1050, but only the\r
+ // former has device class PCI_CLASS_DISPLAY_VGA.\r
+ //\r
+ if (Pci.Hdr.DeviceId != 0x1050 || !IS_PCI_VGA (&Pci)) {\r
+ Status = EFI_SUCCESS;\r
+ }\r
}\r
\r
CloseProtocol:\r