Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Don't use the video BIOS memory as an i915 flush...



details:   https://anonhg.NetBSD.org/src/rev/728ef7a31fe3
branches:  trunk
changeset: 337177:728ef7a31fe3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 05 12:55:20 2015 +0000

description:
Don't use the video BIOS memory as an i915 flush page!

diffstat:

 sys/dev/pci/agp_i810.c |  21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diffs (63 lines):

diff -r ce73418be4f2 -r 728ef7a31fe3 sys/dev/pci/agp_i810.c
--- a/sys/dev/pci/agp_i810.c    Sun Apr 05 11:33:15 2015 +0000
+++ b/sys/dev/pci/agp_i810.c    Sun Apr 05 12:55:20 2015 +0000
@@ -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 @@
        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 @@
        /* 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 @@
                        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_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);



Home | Main Index | Thread Index | Old Index