summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-11-26 10:35:43 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-11-26 10:35:43 +0000
commit21bf0d98fe86c8006a14862017c848bca0c51a95 (patch)
tree7e30618e7c3079f497035690860d622095b8ef41
parent464afe6e47a10f3be60e044677bf8f7ab272a34d (diff)
fix new agp code on amd64
- internal intel graphics semi-agp chipsets need special handling in pchb.c - re-add the i965GM device - use the correct major device id for /dev/agp0 on amd64 (not the i386 one) ok deraadt@
-rw-r--r--etc/etc.amd64/MAKEDEV.md4
-rw-r--r--sys/arch/amd64/pci/pchb.c27
-rw-r--r--sys/arch/i386/pci/pchb.c3
-rw-r--r--sys/dev/pci/agp.c3
-rw-r--r--sys/dev/pci/agp_i810.c5
5 files changed, 36 insertions, 6 deletions
diff --git a/etc/etc.amd64/MAKEDEV.md b/etc/etc.amd64/MAKEDEV.md
index 77cdeb63f3b..7673cfa1de3 100644
--- a/etc/etc.amd64/MAKEDEV.md
+++ b/etc/etc.amd64/MAKEDEV.md
@@ -1,5 +1,5 @@
vers(__file__,
- {-$OpenBSD: MAKEDEV.md,v 1.22 2007/11/25 22:33:09 reyk Exp $-},
+ {-$OpenBSD: MAKEDEV.md,v 1.23 2007/11/26 10:35:42 reyk Exp $-},
etc.MACHINE)dnl
dnl
dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org>
@@ -68,7 +68,7 @@ _DEV(urio, 65)
_DEV(usb, 61)
_DEV(uscan, 77)
_TITLE(spec)
-_DEV(agp, 87)
+_DEV(agp, 86)
dnl _DEV(apm, 21)
_DEV(apm, 83)
_DEV(au, 42)
diff --git a/sys/arch/amd64/pci/pchb.c b/sys/arch/amd64/pci/pchb.c
index dfd27f45f4b..571bdc5b814 100644
--- a/sys/arch/amd64/pci/pchb.c
+++ b/sys/arch/amd64/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.12 2007/11/25 17:11:12 oga Exp $ */
+/* $OpenBSD: pchb.c,v 1.13 2007/11/26 10:35:42 reyk Exp $ */
/* $NetBSD: pchb.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -166,6 +166,31 @@ pchbattach(struct device *parent, struct device *self, void *aux)
has_agp = 0;
switch (PCI_VENDOR(pa->pa_id)) {
+ case PCI_VENDOR_INTEL:
+ switch (PCI_PRODUCT(pa->pa_id)) {
+ case PCI_PRODUCT_INTEL_82915G_HB:
+ case PCI_PRODUCT_INTEL_82915GM_HB:
+ case PCI_PRODUCT_INTEL_82945GP_MCH:
+ case PCI_PRODUCT_INTEL_82945GM_MCH:
+ case PCI_PRODUCT_INTEL_82Q963_HB:
+ case PCI_PRODUCT_INTEL_82965_MCH:
+ case PCI_PRODUCT_INTEL_82965GM_MCH:
+ /*
+ * The host bridge is either in GFX mode (internal
+ * graphics) or in AGP mode. In GFX mode, we pretend
+ * to have AGP because the graphics memory access
+ * is very similar and the AGP GATT code will
+ * deal with this. In the latter case, the
+ * pci_get_capability(PCI_CAP_AGP) test below will
+ * fire, so we do no harm by already setting the flag.
+ */
+ has_agp = 1;
+ break;
+ }
+ break;
+ }
+
+ switch (PCI_VENDOR(pa->pa_id)) {
case PCI_VENDOR_AMD:
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_AMD_AMD64_HT:
diff --git a/sys/arch/i386/pci/pchb.c b/sys/arch/i386/pci/pchb.c
index 081dcaed476..6173e3f8612 100644
--- a/sys/arch/i386/pci/pchb.c
+++ b/sys/arch/i386/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.58 2007/11/25 17:11:12 oga Exp $ */
+/* $OpenBSD: pchb.c,v 1.59 2007/11/26 10:35:42 reyk Exp $ */
/* $NetBSD: pchb.c,v 1.65 2007/08/15 02:26:13 markd Exp $ */
/*
@@ -328,6 +328,7 @@ pchbattach(struct device *parent, struct device *self, void *aux)
case PCI_PRODUCT_INTEL_82945GM_MCH:
case PCI_PRODUCT_INTEL_82Q963_HB:
case PCI_PRODUCT_INTEL_82965_MCH:
+ case PCI_PRODUCT_INTEL_82965GM_MCH:
/*
* The host bridge is either in GFX mode (internal
* graphics) or in AGP mode. In GFX mode, we pretend
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c
index 6c500c11bd2..9b0dc719337 100644
--- a/sys/dev/pci/agp.c
+++ b/sys/dev/pci/agp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agp.c,v 1.8 2007/11/25 17:11:12 oga Exp $ */
+/* $OpenBSD: agp.c,v 1.9 2007/11/26 10:35:42 reyk Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
* All rights reserved.
@@ -95,6 +95,7 @@ const struct agp_product agp_products[] = {
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82945G_IGD_1, agp_i810_attach },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82945GM_IGD, agp_i810_attach },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82965_IGD_1, agp_i810_attach },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82965GM_MCH, agp_i810_attach },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82965GM_IGD_1, agp_i810_attach },
#endif
#if NAGP_INTEL > 0
diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c
index 030fcb5c88c..e4565aba04b 100644
--- a/sys/dev/pci/agp_i810.c
+++ b/sys/dev/pci/agp_i810.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agp_i810.c,v 1.19 2007/11/26 00:04:38 oga Exp $ */
+/* $OpenBSD: agp_i810.c,v 1.20 2007/11/26 10:35:42 reyk Exp $ */
/* $NetBSD: agp_i810.c,v 1.15 2003/01/31 00:07:39 thorpej Exp $ */
/*-
@@ -150,6 +150,8 @@ agp_i810_vgamatch(struct pci_attach_args *pa)
case PCI_PRODUCT_INTEL_82Q963_IGD_2:
case PCI_PRODUCT_INTEL_82965_IGD_1:
case PCI_PRODUCT_INTEL_82965_IGD_2:
+ case PCI_PRODUCT_INTEL_82965GM_IGD_1:
+ case PCI_PRODUCT_INTEL_82965GM_IGD_2:
return (1);
}
@@ -219,6 +221,7 @@ agp_i810_attach(struct agp_softc *sc, struct pci_attach_args *pa)
case PCI_PRODUCT_INTEL_82Q963_IGD_1:
case PCI_PRODUCT_INTEL_82Q963_IGD_2:
case PCI_PRODUCT_INTEL_82965GM_IGD_1:
+ case PCI_PRODUCT_INTEL_82965GM_IGD_2:
isc->chiptype = CHIP_I965;
break;
}