xf86-video-intel: 2 commits - src/i830_driver.c src/i830_memory.c

Eric Anholt anholt at kemper.freedesktop.org
Mon Mar 24 13:48:37 PDT 2008


 src/i830_driver.c |   16 +++++-----------
 src/i830_memory.c |   17 -----------------
 2 files changed, 5 insertions(+), 28 deletions(-)

New commits:
commit c02ab432dd7058c700c35eecf6215daf5f262c51
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Mar 24 13:48:20 2008 -0700

    Revert "Use mprotect on unbound AGP memory to attempt to catch use while unbound."
    
    While I still like the idea, the mprotect calls themselves are failing on
    Linux and causing more trouble than they're worth.
    
    This reverts commit a1612b7728d4153499fe86b6713a13c8702cc7d9.
    
    Conflicts:
    
    	src/i830_driver.c
    	src/i830_memory.c

diff --git a/src/i830_driver.c b/src/i830_driver.c
index c2ddf45..50d9808 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -171,7 +171,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/mman.h>
 #include <errno.h>
 
 #include "xf86.h"
@@ -697,15 +696,6 @@ I830MapMem(ScrnInfoPtr pScrn)
 	 pI830->FbBase + pI830->LpRing->mem->offset;
    }
 
-   /* Mark the pages we haven't yet bound into AGP as inaccessible. */
-   if (pI830->FbMapSize > pI830->stolen_size) {
-      if (mprotect(pI830->FbBase + pI830->stolen_size,
-		   pI830->FbMapSize - pI830->stolen_size, PROT_NONE) != 0) {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "Failed to mprotect unbound AGP: %s\n", strerror(errno));
-      }
-   }
-
    return TRUE;
 }
 
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 9e23c3c..a38ee78 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -101,7 +101,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include "xf86.h"
 #include "xf86_OSproc.h"
@@ -204,31 +203,15 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 					mem->allocated_size, mem->tiling);
     }
 
-    /* Mark the pages accessible now that they're bound. */
-    if (mprotect(pI830->FbBase + mem->offset, ALIGN(mem->size, GTT_PAGE_SIZE),
-		 PROT_READ | PROT_WRITE) != 0) {
-	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		   "Failed to mprotect %s: %s\n", mem->name, strerror(errno));
-    }
-
     return TRUE;
 }
 
 static Bool
 i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 {
-    I830Ptr pI830 = I830PTR(pScrn);
-
     if (mem == NULL || !mem->bound)
 	return TRUE;
 
-    /* Mark the pages accessible now that they're bound. */
-    if (mprotect(pI830->FbBase + mem->offset, ALIGN(mem->size, GTT_PAGE_SIZE),
-		 PROT_NONE) != 0) {
-	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		   "Failed to mprotect %s: %s\n", mem->name, strerror(errno));
-    }
-
     if (mem->tiling != TILE_NONE)
 	i830_clear_tiling(pScrn, mem->fence_nr);
 
commit 552a1b824db31a234d7c5cb71057ed0e0ce64477
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Mar 24 13:25:37 2008 -0700

    Disable a bunch of clock gating disables on IGD_GM, which doesn't need them.
    
    Besides our driver having fallen through to the GM965 path for
    RENCLK_GATE_D1, the BIOS was turning some of these on.  It may be relevant
    for previous platforms as well to zero out the fields that should be zero
    in the other registers.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 98f4261..c2ddf45 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1887,7 +1887,11 @@ SetHWOperatingState(ScrnInfoPtr pScrn)
 
    /* Disable clock gating reported to work incorrectly according to the specs.
     */
-   if (IS_I965GM(pI830)) {
+   if (IS_IGD_GM(pI830)) {
+      OUTREG(RENCLK_GATE_D1, 0);
+      OUTREG(RENCLK_GATE_D2, 0);
+      OUTREG(DSPCLK_GATE_D, VRHUNIT_CLOCK_GATE_DISABLE);
+   } else if (IS_I965GM(pI830)) {
       OUTREG(RENCLK_GATE_D1, I965_RCC_CLOCK_GATE_DISABLE);
    } else if (IS_I965G(pI830)) {
       OUTREG(RENCLK_GATE_D1,


More information about the xorg-commit mailing list