From c5322cc7f26f297d89d5739341558d77a823ca0a Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Sun, 16 Mar 2008 19:00:29 +0000 Subject: 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@. --- sys/dev/pci/agp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci/agp.c') 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); -- cgit v1.2.3