Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2008 16:16:30 +0000 (UTC)
From:      Robert Noland <rnoland@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186434 - head/sys/dev/agp
Message-ID:  <200812231616.mBNGGU9Z006874@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812231616.mBNGGU9Z006874>