From owner-svn-src-stable@FreeBSD.ORG Tue Jan 6 17:05:44 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4FED106566B; Tue, 6 Jan 2009 17:05:44 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A85578FC14; Tue, 6 Jan 2009 17:05:44 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n06H5ioN036936; Tue, 6 Jan 2009 17:05:44 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n06H5i3F036935; Tue, 6 Jan 2009 17:05:44 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200901061705.n06H5i3F036935@svn.freebsd.org> From: Robert Noland Date: Tue, 6 Jan 2009 17:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186832 - in stable/7/sys: . contrib/pf dev/cxgb pci sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2009 17:05:46 -0000 Author: rnoland Date: Tue Jan 6 17:05:44 2009 New Revision: 186832 URL: http://svn.freebsd.org/changeset/base/186832 Log: MFC r186434 Fix up handling of Intel G4X chips some more. Note that you need at least xf86-video-intel 2.4.3 for this to work. The G4X doesn't put the GATT into the same area of stolen memory as all the other chips and older versions of the driver didn't handle that properly. Approved by: kib Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/agp_i810.c stable/7/sys/sys/copyright.h (props changed) Modified: stable/7/sys/pci/agp_i810.c ============================================================================== --- stable/7/sys/pci/agp_i810.c Tue Jan 6 16:24:22 2009 (r186831) +++ stable/7/sys/pci/agp_i810.c Tue Jan 6 17:05:44 2009 (r186832) @@ -167,7 +167,7 @@ static const struct agp_i810_match { "Intel GM965 SVGA controller"}, {0x2A128086, CHIP_I965, 0x00020000, "Intel GME965 SVGA controller"}, - {0x2A428086, CHIP_I965, 0x00020000, + {0x2A428086, CHIP_G4X, 0x00020000, "Intel GM45 SVGA controller"}, {0x2E028086, CHIP_G4X, 0x00020000, "Intel 4 Series SVGA controller"}, @@ -284,6 +284,7 @@ agp_i810_probe(device_t dev) case CHIP_I915: case CHIP_I965: case CHIP_G33: + case CHIP_G4X: deven = pci_read_config(bdev, AGP_I915_DEVEN, 4); if ((deven & AGP_I915_DEVEN_D2F0) == AGP_I915_DEVEN_D2F0_DISABLED) { @@ -348,6 +349,7 @@ agp_i810_dump_regs(device_t dev) case CHIP_I915: case CHIP_I965: case CHIP_G33: + case CHIP_G4X: device_printf(dev, "AGP_I855_GCC1: 0x%02x\n", pci_read_config(sc->bdev, AGP_I855_GCC1, 1)); device_printf(dev, "AGP_I915_MSAC: 0x%02x\n", @@ -397,7 +399,7 @@ agp_i810_attach(device_t dev) return error; if (sc->chiptype != CHIP_I965 && sc->chiptype != CHIP_G33 && - ptoa((vm_paddr_t)Maxmem) > 0xfffffffful) + sc->chiptype != CHIP_G4X && ptoa((vm_paddr_t)Maxmem) > 0xfffffffful) { device_printf(dev, "agp_i810.c does not support physical " "memory above 4GB.\n"); @@ -659,8 +661,7 @@ agp_i810_attach(device_t dev) return EINVAL; } - if (sc->chiptype != CHIP_G4X) - gtt_size += 4; + gtt_size += 4; sc->stolen = (stolen - gtt_size) * 1024 / 4096; if (sc->stolen > 0) @@ -780,6 +781,7 @@ agp_i810_set_aperture(device_t dev, u_in case CHIP_I915: case CHIP_I965: case CHIP_G33: + case CHIP_G4X: return agp_generic_set_aperture(dev, aperture); } @@ -798,7 +800,8 @@ agp_i810_write_gtt_entry(device_t dev, i u_int32_t pte; pte = (u_int32_t)physical | 1; - if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33) { + if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33 || + sc->chiptype == CHIP_G4X) { pte |= (physical & 0x0000000f00000000ull) >> 28; } else { /* If we do actually have memory above 4GB on an older system, @@ -825,6 +828,10 @@ agp_i810_write_gtt_entry(device_t dev, i bus_write_4(sc->sc_res[0], (offset >> AGP_PAGE_SHIFT) * 4 + (512 * 1024), pte); break; + case CHIP_G4X: + bus_write_4(sc->sc_res[0], + (offset >> AGP_PAGE_SHIFT) * 4 + (2 * 1024 * 1024), pte); + break; } }