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 trust the MSAC register after all; use the...



details:   https://anonhg.NetBSD.org/src/rev/f8d6d9ccaccf
branches:  trunk
changeset: 796590:f8d6d9ccaccf
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jun 11 14:04:48 2014 +0000

description:
Don't trust the MSAC register after all; use the GMADR BAR size.

Previously this read the MSAC register from the wrong PCI device.
Experiments reveal that even on the right PCI device, per the
datasheet, the GMADR BAR size is correct.

Not clear that the driver has any business reading any of these GMCH
registers to discern the aperture size -- seems to me they are meant
to be written by the BIOS to determine the GMADR BAR size.  Lacking a
variety of hardware to test, though, I'll leave this as is for now...

diffstat:

 sys/dev/pci/agp_i810.c |  14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diffs (42 lines):

diff -r 0054e1654148 -r f8d6d9ccaccf sys/dev/pci/agp_i810.c
--- a/sys/dev/pci/agp_i810.c    Wed Jun 11 13:15:44 2014 +0000
+++ b/sys/dev/pci/agp_i810.c    Wed Jun 11 14:04:48 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_i810.c,v 1.87 2014/06/11 13:15:44 riastradh Exp $  */
+/*     $NetBSD: agp_i810.c,v 1.88 2014/06/11 14:04:48 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.87 2014/06/11 13:15:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.88 2014/06/11 14:04:48 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -993,7 +993,7 @@
        struct agp_i810_softc *isc = sc->as_chipc;
        pcireg_t reg;
        u_int32_t size;
-       u_int16_t miscc, gcc1, msac;
+       u_int16_t miscc, gcc1;
 
        size = 0;
 
@@ -1021,13 +1021,7 @@
        case CHIP_I915:
        case CHIP_G33:
        case CHIP_G4X:
-               reg = pci_conf_read(isc->vga_pa.pa_pc, isc->vga_pa.pa_tag,
-                   AGP_I915_MSAC);
-               msac = (u_int16_t)(reg >> 16);
-               if (msac & AGP_I915_MSAC_APER_128M)
-                       size = 128 * 1024 * 1024;
-               else
-                       size = 256 * 1024 * 1024;
+               size = sc->as_apsize;
                break;
        case CHIP_I965:
                size = 512 * 1024 * 1024;



Home | Main Index | Thread Index | Old Index