summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-06-06 11:11:11 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-06-06 11:11:11 +0000
commitc8677a8acfad56671a5a27001f0fce990d334c69 (patch)
tree87ab4ff85469c5a9a8d4749780ca7496f7e16330
parentb482aa9f29d5a8c64f422f9fec91d4fa5482b2bc (diff)
unfuck the rest of the way. when we bind the scribble pages to the
aperture, skip over dcache on i810 chipsets and stolen memory on later chips. I didn't notice this before because I mostly used this code with GEM code, which doesn't use the stolen memory.
-rw-r--r--sys/dev/pci/agp_i810.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c
index 64d1817f038..509ba476cc2 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.56 2009/06/06 10:56:30 oga Exp $ */
+/* $OpenBSD: agp_i810.c,v 1.57 2009/06/06 11:11:10 oga Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -473,9 +473,15 @@ agp_i810_attach(struct device *parent, struct device *self, void *aux)
printf(": can't get scribble page\n");
return;
}
+ tmp = isc->isc_apaddr;
+ if (isc->chiptype == CHIP_I810) {
+ tmp += isc->dcache_size;
+ } else {
+ tmp += isc->stolen << AGP_PAGE_SHIFT;
+ }
/* initialise all gtt entries to point to scribble page */
- for (tmp = isc->isc_apaddr; tmp < (isc->isc_apaddr + isc->isc_apsize);
+ for (; tmp < (isc->isc_apaddr + isc->isc_apsize);
tmp += AGP_PAGE_SIZE)
agp_i810_unbind_page(isc, tmp);