Module Name: src
Committed By: riastradh
Date: Sun Apr 5 12:55:20 UTC 2015
Modified Files:
src/sys/dev/pci: agp_i810.c
Log Message:
Don't use the video BIOS memory as an i915 flush page!
To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/pci/agp_i810.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/agp_i810.c
diff -u src/sys/dev/pci/agp_i810.c:1.117 src/sys/dev/pci/agp_i810.c:1.118
--- src/sys/dev/pci/agp_i810.c:1.117 Fri Mar 6 22:03:06 2015
+++ src/sys/dev/pci/agp_i810.c Sun Apr 5 12:55:20 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: agp_i810.c,v 1.117 2015/03/06 22:03:06 riastradh Exp $ */
+/* $NetBSD: agp_i810.c,v 1.118 2015/04/05 12:55:20 riastradh Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.117 2015/03/06 22:03:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.118 2015/04/05 12:55:20 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -602,6 +602,16 @@ fail0: agp_generic_detach(sc);
return error;
}
+/*
+ * Skip pages reserved by the BIOS. Notably, skip 0xa0000-0xfffff,
+ * which includes the video BIOS at 0xc0000-0xdffff which the display
+ * drivers need for video mode detection.
+ *
+ * XXX Is there an MI name for this, or a conventional x86 name? Or
+ * should we really use bus_dma instead?
+ */
+#define PCIBIOS_MIN_MEM 0x100000
+
static int
agp_i810_setup_chipset_flush_page(struct agp_softc *sc)
{
@@ -621,7 +631,7 @@ agp_i810_setup_chipset_flush_page(struct
/* Read the PCI config register: 4-byte on gen3, 8-byte on gen>=4. */
if (isc->chiptype == CHIP_I915) {
addr = pci_conf_read(pc, tag, AGP_I915_IFPADDR);
- minaddr = PAGE_SIZE; /* XXX PCIBIOS_MIN_MEM? */
+ minaddr = PCIBIOS_MIN_MEM;
maxaddr = UINT32_MAX;
} else {
hi = pci_conf_read(pc, tag, AGP_I965_IFPADDR+4);
@@ -643,7 +653,7 @@ agp_i810_setup_chipset_flush_page(struct
return EIO;
#endif
}
- minaddr = PAGE_SIZE; /* XXX PCIBIOS_MIN_MEM? */
+ minaddr = PCIBIOS_MIN_MEM;
maxaddr = MIN(UINT64_MAX, ~(bus_addr_t)0);
}
@@ -695,8 +705,7 @@ agp_i810_teardown_chipset_flush_page(str
AGP_I965_IFPADDR + 4, 0);
}
isc->flush_addr = 0;
- bus_space_free(isc->flush_bst, isc->flush_bsh,
- PAGE_SIZE);
+ bus_space_free(isc->flush_bst, isc->flush_bsh, PAGE_SIZE);
} else {
/* Otherwise, just unmap the pre-allocated page. */
bus_space_unmap(isc->flush_bst, isc->flush_bsh, PAGE_SIZE);