Source-Changes-HG archive

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

[src/netbsd-3]: src/sys Pull up following revision(s) (requested by tron in t...



details:   https://anonhg.NetBSD.org/src/rev/29720e9574ab
branches:  netbsd-3
changeset: 577831:29720e9574ab
user:      riz <riz%NetBSD.org@localhost>
date:      Tue Feb 14 20:39:35 2006 +0000

description:
Pull up following revision(s) (requested by tron in ticket #1168):
        sys/dev/pci/agp_i810.c: revision 1.28
        sys/arch/i386/pci/pchb.c: revision 1.57
        sys/dev/pci/agpvar.h: revision 1.11
        sys/dev/pci/agp_via.c: revision 1.9
        sys/dev/pci/agp.c: revision 1.37
        sys/dev/pci/agpreg.h: revision 1.10
        sys/dev/pci/pcidevs: revision 1.757
        sys/dev/pci/agp_amd.c: revision 1.14
        sys/dev/pci/agp_intel.c: revision 1.17
        sys/dev/pci/agp_sis.c: revision 1.8
        sys/dev/pci/agp_ali.c: revision 1.9
        sys/arch/i386/pci/pchb_rnd.c: revision 1.16
PR/32550: Michael Eriksson: No agp(4) support for i915 integrated graphics

diffstat:

 sys/arch/i386/pci/pchb.c     |    6 +-
 sys/arch/i386/pci/pchb_rnd.c |    6 +-
 sys/dev/pci/agp.c            |   12 ++-
 sys/dev/pci/agp_ali.c        |    6 +-
 sys/dev/pci/agp_amd.c        |    6 +-
 sys/dev/pci/agp_i810.c       |  162 ++++++++++++++++++++++++++++++++----------
 sys/dev/pci/agp_intel.c      |    6 +-
 sys/dev/pci/agp_sis.c        |    6 +-
 sys/dev/pci/agp_via.c        |    6 +-
 sys/dev/pci/agpreg.h         |   16 +++-
 sys/dev/pci/agpvar.h         |    4 +-
 sys/dev/pci/pcidevs          |   14 ++-
 12 files changed, 181 insertions(+), 69 deletions(-)

diffs (truncated from 655 to 300 lines):

diff -r 5234ae9213ef -r 29720e9574ab sys/arch/i386/pci/pchb.c
--- a/sys/arch/i386/pci/pchb.c  Tue Feb 14 20:37:36 2006 +0000
+++ b/sys/arch/i386/pci/pchb.c  Tue Feb 14 20:39:35 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pchb.c,v 1.55 2005/02/03 21:35:44 perry Exp $  */
+/*     $NetBSD: pchb.c,v 1.55.4.1 2006/02/14 20:39:35 riz Exp $        */
 
 /*-
  * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.55 2005/02/03 21:35:44 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.55.4.1 2006/02/14 20:39:35 riz Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -299,6 +299,8 @@
                case PCI_PRODUCT_INTEL_82845G_DRAM:
                case PCI_PRODUCT_INTEL_82855GM_MCH:
                case PCI_PRODUCT_INTEL_82865_HB:
+               case PCI_PRODUCT_INTEL_82915G_HB:
+               case PCI_PRODUCT_INTEL_82915GM_HB:
                        /*
                         * The host bridge is either in GFX mode (internal
                         * graphics) or in AGP mode. In GFX mode, we pretend
diff -r 5234ae9213ef -r 29720e9574ab sys/arch/i386/pci/pchb_rnd.c
--- a/sys/arch/i386/pci/pchb_rnd.c      Tue Feb 14 20:37:36 2006 +0000
+++ b/sys/arch/i386/pci/pchb_rnd.c      Tue Feb 14 20:39:35 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pchb_rnd.c,v 1.13 2003/07/06 07:24:31 tron Exp $       */
+/*     $NetBSD: pchb_rnd.c,v 1.13.14.1 2006/02/14 20:39:35 riz Exp $   */
 
 /*
  * Copyright (c) 2000 Michael Shalayeff
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pchb_rnd.c,v 1.13 2003/07/06 07:24:31 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pchb_rnd.c,v 1.13.14.1 2006/02/14 20:39:35 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -75,6 +75,8 @@
                case PCI_PRODUCT_INTEL_82860_HB:
                case PCI_PRODUCT_INTEL_82865_HB:
                case PCI_PRODUCT_INTEL_82875P_HB:
+               case PCI_PRODUCT_INTEL_82915G_HB:
+               case PCI_PRODUCT_INTEL_82915GM_HB:
                        sc->sc_st = pa->pa_memt;
                        if (bus_space_map(sc->sc_st, I82802_IOBASE,
                            I82802_IOSIZE, 0, &sc->sc_sh) != 0) {
diff -r 5234ae9213ef -r 29720e9574ab sys/dev/pci/agp.c
--- a/sys/dev/pci/agp.c Tue Feb 14 20:37:36 2006 +0000
+++ b/sys/dev/pci/agp.c Tue Feb 14 20:39:35 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp.c,v 1.34 2005/02/27 00:27:32 perry Exp $   */
+/*     $NetBSD: agp.c,v 1.34.2.1 2006/02/14 20:39:35 riz Exp $ */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.34 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.34.2.1 2006/02/14 20:39:35 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -161,6 +161,10 @@
          NULL,                 agp_i810_attach },
        { PCI_VENDOR_INTEL,     PCI_PRODUCT_INTEL_82865_HB,
          NULL,                 agp_i810_attach },
+       { PCI_VENDOR_INTEL,     PCI_PRODUCT_INTEL_82915G_HB,
+         NULL,                 agp_i810_attach },
+       { PCI_VENDOR_INTEL,     PCI_PRODUCT_INTEL_82915GM_HB,
+         NULL,                 agp_i810_attach },
 #endif
 
 #if NAGP_INTEL > 0
@@ -300,13 +304,13 @@
 }
 
 int
-agp_map_aperture(struct pci_attach_args *pa, struct agp_softc *sc)
+agp_map_aperture(struct pci_attach_args *pa, struct agp_softc *sc, int reg)
 {
        /*
         * Find the aperture. Don't map it (yet), this would
         * eat KVA.
         */
-       if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, AGP_APBASE,
+       if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, reg,
            PCI_MAPREG_TYPE_MEM, &sc->as_apaddr, &sc->as_apsize,
            &sc->as_apflags) != 0)
                return ENXIO;
diff -r 5234ae9213ef -r 29720e9574ab sys/dev/pci/agp_ali.c
--- a/sys/dev/pci/agp_ali.c     Tue Feb 14 20:37:36 2006 +0000
+++ b/sys/dev/pci/agp_ali.c     Tue Feb 14 20:39:35 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_ali.c,v 1.6 2005/02/27 00:27:32 perry Exp $        */
+/*     $NetBSD: agp_ali.c,v 1.6.2.1 2006/02/14 20:39:35 riz Exp $      */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_ali.c,v 1.6 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_ali.c,v 1.6.2.1 2006/02/14 20:39:35 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -93,7 +93,7 @@
        sc->as_chipc = asc;
        sc->as_methods = &agp_ali_methods;
 
-       if (agp_map_aperture(pa, sc) != 0) {
+       if (agp_map_aperture(pa, sc, AGP_APBASE) != 0) {
                aprint_error(": failed to map aperture\n");
                free(asc, M_AGP);
                return ENXIO;
diff -r 5234ae9213ef -r 29720e9574ab sys/dev/pci/agp_amd.c
--- a/sys/dev/pci/agp_amd.c     Tue Feb 14 20:37:36 2006 +0000
+++ b/sys/dev/pci/agp_amd.c     Tue Feb 14 20:39:35 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_amd.c,v 1.11 2005/02/27 00:27:32 perry Exp $       */
+/*     $NetBSD: agp_amd.c,v 1.11.2.1 2006/02/14 20:39:35 riz Exp $     */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_amd.c,v 1.11 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_amd.c,v 1.11.2.1 2006/02/14 20:39:35 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -193,7 +193,7 @@
                return error;
        }
 
-       if (agp_map_aperture(pa, sc) != 0) {
+       if (agp_map_aperture(pa, sc, AGP_APBASE) != 0) {
                aprint_error(": can't map aperture\n");
                agp_generic_detach(sc);
                free(asc, M_AGP);
diff -r 5234ae9213ef -r 29720e9574ab sys/dev/pci/agp_i810.c
--- a/sys/dev/pci/agp_i810.c    Tue Feb 14 20:37:36 2006 +0000
+++ b/sys/dev/pci/agp_i810.c    Tue Feb 14 20:39:35 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_i810.c,v 1.25 2005/02/27 00:27:32 perry Exp $      */
+/*     $NetBSD: agp_i810.c,v 1.25.2.1 2006/02/14 20:39:35 riz Exp $    */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.25 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.25.2.1 2006/02/14 20:39:35 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -58,10 +58,23 @@
 #define READ1(off)     bus_space_read_1(isc->bst, isc->bsh, off)
 #define READ4(off)     bus_space_read_4(isc->bst, isc->bsh, off)
 #define WRITE4(off,v)  bus_space_write_4(isc->bst, isc->bsh, off, v)
+#define WRITEGTT(off, v)                                               \
+       do {                                                            \
+               if (isc->chiptype == CHIP_I915) {                       \
+                       bus_space_write_4(isc->gtt_bst, isc->gtt_bsh,   \
+                           (u_int32_t)((off) >> AGP_PAGE_SHIFT) * 4,   \
+                           (v));                                       \
+               } else {                                                \
+                       WRITE4(AGP_I810_GTT +                           \
+                           (u_int32_t)((off) >> AGP_PAGE_SHIFT) * 4,   \
+                           (v));                                       \
+               }                                                       \
+       } while (0)
 
 #define CHIP_I810 0    /* i810/i815 */
 #define CHIP_I830 1    /* 830M/845G */
 #define CHIP_I855 2    /* 852GM/855GM/865G */
+#define CHIP_I915 3    /* 915G/915GM */
 
 struct agp_i810_softc {
        u_int32_t initial_aperture;     /* aperture size at startup */
@@ -70,8 +83,10 @@
        u_int32_t dcache_size;          /* i810 only */
        u_int32_t stolen;               /* number of i830/845 gtt entries
                                           for stolen memory */
-       bus_space_tag_t bst;            /* bus_space tag */
-       bus_space_handle_t bsh;         /* bus_space handle */
+       bus_space_tag_t bst;            /* register bus_space tag */
+       bus_space_handle_t bsh;         /* register bus_space handle */
+       bus_space_tag_t gtt_bst;        /* GTT bus_space tag */
+       bus_space_handle_t gtt_bsh;     /* GTT bus_space handle */
        struct pci_attach_args vga_pa;
 
        void *sc_powerhook;
@@ -122,6 +137,8 @@
        case PCI_PRODUCT_INTEL_82845G_IGD:
        case PCI_PRODUCT_INTEL_82855GM_IGD:
        case PCI_PRODUCT_INTEL_82865_IGD:
+       case PCI_PRODUCT_INTEL_82915G_IGD:
+       case PCI_PRODUCT_INTEL_82915GM_IGD:
                return (1);
        }
 
@@ -134,7 +151,7 @@
        struct agp_softc *sc = (void *)self;
        struct agp_i810_softc *isc;
        struct agp_gatt *gatt;
-       int error;
+       int error, apbase;
 
        isc = malloc(sizeof *isc, M_AGP, M_NOWAIT|M_ZERO);
        if (isc == NULL) {
@@ -164,13 +181,6 @@
        /* XXXfvdl */
        sc->as_dmat = isc->vga_pa.pa_dmat;
 
-       error = agp_map_aperture(&isc->vga_pa, sc);
-       if (error != 0) {
-               aprint_error(": can't map aperture\n");
-               free(isc, M_AGP);
-               return error;
-       }
-
        switch (PCI_PRODUCT(isc->vga_pa.pa_id)) {
        case PCI_PRODUCT_INTEL_82810_GC:
        case PCI_PRODUCT_INTEL_82810_DC100_GC:
@@ -186,13 +196,45 @@
        case PCI_PRODUCT_INTEL_82865_IGD:
                isc->chiptype = CHIP_I855;
                break;
+       case PCI_PRODUCT_INTEL_82915G_IGD:
+       case PCI_PRODUCT_INTEL_82915GM_IGD:
+               isc->chiptype = CHIP_I915;
+               break;
+       }
+
+       apbase = isc->chiptype == CHIP_I915 ? AGP_I915_GMADR : AGP_I810_GMADR;
+       error = agp_map_aperture(&isc->vga_pa, sc, apbase);
+       if (error != 0) {
+               aprint_error(": can't map aperture\n");
+               free(isc, M_AGP);
+               return error;
        }
 
-       error = pci_mapreg_map(&isc->vga_pa, AGP_I810_MMADR,
-           PCI_MAPREG_TYPE_MEM, 0, &isc->bst, &isc->bsh, NULL, NULL);
-       if (error != 0) {
-               aprint_error(": can't map mmadr registers\n");
-               return error;
+       if (isc->chiptype == CHIP_I915) {
+               error = pci_mapreg_map(&isc->vga_pa, AGP_I915_MMADR,
+                   PCI_MAPREG_TYPE_MEM, 0, &isc->bst, &isc->bsh, NULL, NULL);
+               if (error != 0) {
+                       aprint_error(": can't map mmadr registers\n");
+                       agp_generic_detach(sc);
+                       return error;
+               }
+               error = pci_mapreg_map(&isc->vga_pa, AGP_I915_GTTADR,
+                   PCI_MAPREG_TYPE_MEM, 0, &isc->gtt_bst, &isc->gtt_bsh,
+                   NULL, NULL);
+               if (error != 0) {
+                       aprint_error(": can't map gttadr registers\n");
+                       /* XXX we should release mmadr here */
+                       agp_generic_detach(sc);
+                       return error;
+               }
+       } else {
+               error = pci_mapreg_map(&isc->vga_pa, AGP_I810_MMADR,
+                   PCI_MAPREG_TYPE_MEM, 0, &isc->bst, &isc->bsh, NULL, NULL);
+               if (error != 0) {
+                       aprint_error(": can't map mmadr registers\n");
+                       agp_generic_detach(sc);
+                       return error;
+               }
        }
 
        isc->initial_aperture = AGP_GET_APERTURE(sc);
@@ -265,7 +307,7 @@
                WRITE4(AGP_I810_PGTBL_CTL, pgtblctl);
 
                gatt->ag_physical = pgtblctl & ~1;
-       } else {        /* CHIP_I855 */
+       } else if (isc->chiptype == CHIP_I855) {
                /* The 855GM automatically initializes the 128k gatt on boot. */
                pcireg_t reg;
                u_int32_t pgtblctl;



Home | Main Index | Thread Index | Old Index