Problem noticed/fix tested by sebastia@ on macppc.
sparc64 problems in earlier diff pointed out by deraadt@
'looks good' kettenis@ 'commit' deraadt@
-/* $OpenBSD: vgafb.c,v 1.58 2013/10/21 10:36:16 miod Exp $ */
+/* $OpenBSD: vgafb.c,v 1.59 2014/07/22 04:42:51 jsg Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
vgafb_burn(sc, WSDISPLAYIO_VIDEO_ON, 0); /* paranoia */
}
+ if (vga_aperture_needed(pa))
+ printf("%s: aperture needed\n", sc->sc_dev.dv_xname);
+
config_found(self, &waa, wsemuldisplaydevprint);
}
-/* $OpenBSD: vgafb.c,v 1.60 2013/10/20 20:07:27 miod Exp $ */
+/* $OpenBSD: vgafb.c,v 1.61 2014/07/22 04:42:51 jsg Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
#include <dev/pci/pcidevs.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
+#include <dev/pci/vga_pcivar.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>
/* sc->sc_ofhandle = PCITAG_NODE(sc->sc_pcitag); */
}
+ if (vga_aperture_needed(pa))
+ printf("%s: aperture needed\n", sc->sc_sunfb.sf_dev.dv_xname);
+
fbwscons_attach(&sc->sc_sunfb, &vgafb_accessops, sc->sc_console);
}
-/* $OpenBSD: vga_pci.c,v 1.79 2014/07/12 23:16:23 jsg Exp $ */
+/* $OpenBSD: vga_pci.c,v 1.80 2014/07/22 04:42:51 jsg Exp $ */
/* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */
/*
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
-#include <dev/pci/drm/i915/i915_devlist.h>
-#include <dev/pci/drm/radeon/radeon_devlist.h>
-
#include <dev/pci/agpvar.h>
#include <dev/ic/mc6845reg.h>
};
#endif
-static const struct pci_matchid aperture_blacklist[] = {
- /* server adapters found in mga200 drm driver */
- { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200E_SE },
- { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200E_SE_B },
- { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200EH },
- { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200ER },
- { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200EV },
- { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200EW },
-
- /* server adapters found in ast drm driver */
- { PCI_VENDOR_ASPEED, PCI_PRODUCT_ASPEED_AST2000 },
- { PCI_VENDOR_ASPEED, PCI_PRODUCT_ASPEED_AST2100 },
-
- /* ati adapters found in servers */
- { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RAGEXL },
- { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_ES1000 },
-
- /* xgi found in some poweredges/supermicros/tyans */
- { PCI_VENDOR_XGI, PCI_PRODUCT_XGI_VOLARI_Z7 },
- { PCI_VENDOR_XGI, PCI_PRODUCT_XGI_VOLARI_Z9 },
-};
-
int
vga_pci_match(struct device *parent, void *match, void *aux)
{
return (1);
}
-int
-vga_aperture_needed(struct pci_attach_args *pa)
-{
-#if defined(__i386__) || defined(__amd64__) || \
- defined(__sparc64__) || defined(__macppc__)
- 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);
-#endif
- return (1);
-}
-
void
vga_pci_attach(struct device *parent, struct device *self, void *aux)
{
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
+#include <dev/pci/pcidevs.h>
#include <dev/pci/vga_pcivar.h>
+#include <dev/pci/drm/i915/i915_devlist.h>
+#include <dev/pci/drm/radeon/radeon_devlist.h>
#if NDRM > 0
int
bus_space_unmap(bar->bst, bar->bsh, bar->size);
}
}
+
+static const struct pci_matchid aperture_blacklist[] = {
+ /* server adapters found in mga200 drm driver */
+ { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200E_SE },
+ { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200E_SE_B },
+ { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200EH },
+ { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200ER },
+ { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200EV },
+ { PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200EW },
+
+ /* server adapters found in ast drm driver */
+ { PCI_VENDOR_ASPEED, PCI_PRODUCT_ASPEED_AST2000 },
+ { PCI_VENDOR_ASPEED, PCI_PRODUCT_ASPEED_AST2100 },
+
+ /* ati adapters found in servers */
+ { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RAGEXL },
+ { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_ES1000 },
+
+ /* xgi found in some poweredges/supermicros/tyans */
+ { PCI_VENDOR_XGI, PCI_PRODUCT_XGI_VOLARI_Z7 },
+ { PCI_VENDOR_XGI, PCI_PRODUCT_XGI_VOLARI_Z9 },
+};
+
+int
+vga_aperture_needed(struct pci_attach_args *pa)
+{
+#if defined(__i386__) || defined(__amd64__) || \
+ defined(__sparc64__) || defined(__macppc__)
+ 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);
+#endif
+ return (1);
+}
-/* $OpenBSD: vga_pcivar.h,v 1.17 2013/08/12 04:11:52 jsg Exp $ */
+/* $OpenBSD: vga_pcivar.h,v 1.18 2014/07/22 04:42:51 jsg Exp $ */
/* $NetBSD: vga_pcivar.h,v 1.1 1998/03/22 15:16:19 drochner Exp $ */
/*
struct vga_pci_bar *vga_pci_bar_map(struct vga_pci_softc *, int,
bus_size_t, int);
void vga_pci_bar_unmap(struct vga_pci_bar*);
+int vga_aperture_needed(struct pci_attach_args *);
#if NDRM > 0
int vga_drmsubmatch(struct device *, void *, void *);