diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2012-12-13 13:55:19 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2012-12-13 13:55:19 +0000 |
commit | 06112a6138a72260414aa1c01670057eadf30003 (patch) | |
tree | 4d109cb042e5030354826e7e3b77126194c5187a /sys/arch | |
parent | 5d424d8390d4d1b6ea61c6fdf1fb97c15e526ddc (diff) |
iMac G3 grahic cards have a ``misc'' pci subclass that's why they weren't
attached to vgafb(4) since the use of the generic DEVICE_IS_VGA_PCI macro
in r1.26. Correct this and document why we should attach devices with such
subclass.
Fix a regression introduced in august when adding the glue to attach drm(4)
on macppc, reported by brynet@ and nick@ on bugs@, thanks and sorry for the
delay!
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/macppc/pci/vgafb_pci.c | 13 | ||||
-rw-r--r-- | sys/arch/macppc/pci/vgafb_pcivar.h | 10 |
2 files changed, 11 insertions, 12 deletions
diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c index 681413f85a6..ed764fd3eac 100644 --- a/sys/arch/macppc/pci/vgafb_pci.c +++ b/sys/arch/macppc/pci/vgafb_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb_pci.c,v 1.26 2012/08/30 21:54:13 mpi Exp $ */ +/* $OpenBSD: vgafb_pci.c,v 1.27 2012/12/13 13:55:18 mpi Exp $ */ /* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */ /* @@ -147,8 +147,15 @@ vgafb_pci_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; - if (DEVICE_IS_VGA_PCI(pa->pa_class) == 0) - return (0); + if (DEVICE_IS_VGA_PCI(pa->pa_class) == 0) { + /* + * XXX Graphic cards found in iMac G3 have a ``Misc'' + * subclass, match them all. + */ + if (PCI_CLASS(pa->pa_class) != PCI_CLASS_DISPLAY || + PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_MISC) + return (0); + } /* If it's the console, we have a winner! */ if (!bcmp(&pa->pa_tag, &vgafb_pci_console_tag, sizeof(pa->pa_tag))) { diff --git a/sys/arch/macppc/pci/vgafb_pcivar.h b/sys/arch/macppc/pci/vgafb_pcivar.h index 11ce586abe6..b21b0fcaa46 100644 --- a/sys/arch/macppc/pci/vgafb_pcivar.h +++ b/sys/arch/macppc/pci/vgafb_pcivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb_pcivar.h,v 1.6 2012/06/21 10:08:16 mpi Exp $ */ +/* $OpenBSD: vgafb_pcivar.h,v 1.7 2012/12/13 13:55:18 mpi Exp $ */ /* $NetBSD: vga_pcivar.h,v 1.1 1996/11/19 04:38:36 cgd Exp $ */ /* @@ -28,14 +28,6 @@ * rights to redistribute these changes. */ -#define DEVICE_IS_VGA_PCI(class) \ - (((PCI_CLASS(class) == PCI_CLASS_DISPLAY && \ - PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_VGA) || \ - (PCI_CLASS(class) == PCI_CLASS_DISPLAY && \ - PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_MISC) || \ - (PCI_CLASS(class) == PCI_CLASS_PREHISTORIC && \ - PCI_SUBCLASS(class) == PCI_SUBCLASS_PREHISTORIC_VGA)) ? 1 : 0) - extern pcitag_t vgafb_pci_console_tag; /* XXX */ |