From owner-svn-src-head@FreeBSD.ORG Tue Dec 23 16:16:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CD5E1065670; Tue, 23 Dec 2008 16:16:31 +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 1BB528FC14; Tue, 23 Dec 2008 16:16:31 +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 mBNGGUuR006875; Tue, 23 Dec 2008 16:16:30 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBNGGU9Z006874; Tue, 23 Dec 2008 16:16:30 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200812231616.mBNGGU9Z006874@svn.freebsd.org> From: Robert Noland Date: Tue, 23 Dec 2008 16:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186434 - head/sys/dev/agp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2008 16:16:31 -0000 Author: rnoland Date: Tue Dec 23 16:16:30 2008 New Revision: 186434 URL: http://svn.freebsd.org/changeset/base/186434 Log: 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. Tested by: ganbold Approved by: kib MFC after: 2 weeks Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue Dec 23 16:04:33 2008 (r186433) +++ head/sys/dev/agp/agp_i810.c Tue Dec 23 16:16:30 2008 (r186434) @@ -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; } }