This extends the list of devices the installer will skip
asking the vga aperture question on to cover virtual machines.

If Xorg is going to be run machdep.allowaperture will have to
be manually set in sysctl.conf.  I suspect most people aren't
running X in VMs though, thoughts?

Needs the pcidevs change I just committed.

Index: vga_pci_common.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/vga_pci_common.c,v
retrieving revision 1.5
diff -u -p -r1.5 vga_pci_common.c
--- vga_pci_common.c    28 Jul 2014 15:00:27 -0000      1.5
+++ vga_pci_common.c    8 Aug 2014 15:41:23 -0000
@@ -175,6 +175,14 @@ static const struct pci_matchid aperture
        /* xgi found in some poweredges/supermicros/tyans */
        { PCI_VENDOR_XGI,               PCI_PRODUCT_XGI_VOLARI_Z7 },
        { PCI_VENDOR_XGI,               PCI_PRODUCT_XGI_VOLARI_Z9 },
+
+       /* devices found in VMs */
+       { PCI_VENDOR_BOCHS,             PCI_PRODUCT_BOCHS_VGA },
+       { PCI_VENDOR_INNOTEK,           PCI_PRODUCT_INNOTEK_VBGA },
+       { PCI_VENDOR_MICROSOFT,         PCI_PRODUCT_MICROSOFT_VGA },
+       { PCI_VENDOR_PARALLELS,         PCI_PRODUCT_PARALLELS_VIDEO },
+       { PCI_VENDOR_VMWARE,            PCI_PRODUCT_VMWARE_SVGA },
+       { PCI_VENDOR_VMWARE,            PCI_PRODUCT_VMWARE_SVGA2 },
 };
 
 int
@@ -182,9 +190,18 @@ vga_aperture_needed(struct pci_attach_ar
 {
 #if defined(__i386__) || defined(__amd64__) || \
     defined(__sparc64__) || defined(__macppc__)
+       uint32_t sub;
+
        if (pci_matchbyid(pa, i915_devices, nitems(i915_devices)) ||
            pci_matchbyid(pa, radeon_devices, nitems(radeon_devices)) ||
            pci_matchbyid(pa, aperture_blacklist, nitems(aperture_blacklist)))
+               return (0);
+       /* qemu/kvm/xen */
+       sub = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+       if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_CIRRUS) &&
+           (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CIRRUS_CL_GD5446) &&
+           (PCI_VENDOR(sub) == PCI_VENDOR_QUMRANET) &&
+           (PCI_PRODUCT(sub) == 0x1100))
                return (0);
 #endif
        return (1);

Reply via email to