summaryrefslogtreecommitdiff
path: root/sys/dev/pci/agp.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-03-16 19:00:29 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-03-16 19:00:29 +0000
commitc5322cc7f26f297d89d5739341558d77a823ca0a (patch)
tree89262368ac92e725ff85a9bd6201003c7e69d4c7 /sys/dev/pci/agp.c
parent68d85f5a89fb982d3c281c6c189cd217dc0d9ae0 (diff)
Make agp(4) attach at vga(4) instead of pchb(4). This is because sometimes
agp and drm need to use the same memory mapping, the best way to deal with that is to allow them to share (that's coming later), for this to work cleanly we move the attach point of agp. Ideally most agp drivers would attach at pchb, with only agp_i810 (and any that work similarly) attaching at vga, but this will do for now. ok kettenis@, miod@.
Diffstat (limited to 'sys/dev/pci/agp.c')
-rw-r--r--sys/dev/pci/agp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c
index 49bcbef2704..05526203d67 100644
--- a/sys/dev/pci/agp.c
+++ b/sys/dev/pci/agp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agp.c,v 1.16 2008/01/04 00:23:26 kettenis Exp $ */
+/* $OpenBSD: agp.c,v 1.17 2008/03/16 19:00:28 oga Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
* All rights reserved.
@@ -110,6 +110,11 @@ agp_probe(struct device *parent, void *match, void *aux)
struct agpbus_attach_args *aaa = aux;
struct pci_attach_args *pa = &aaa->apa_pci_args;
+ /* pci_args must be a pchb */
+ if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE ||
+ PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_BRIDGE_HOST)
+ return (0);
+
if (agp_lookup(pa) == NULL)
return (0);