xf86-video-intel: Branch 'i830-pageflip' - 11 commits - src/common.h src/i810_accel.c src/i810_dri.c src/i810_driver.c src/i830_display.c src/i830_dri.c src/i830_driver.c src/i830_exa.c src/i830_memory.c

Michel Daenzer daenzer at kemper.freedesktop.org
Fri Mar 9 20:47:34 EET 2007


 src/common.h       |    1 
 src/i810_accel.c   |    3 -
 src/i810_dri.c     |    8 ++-
 src/i810_driver.c  |    7 --
 src/i830_display.c |   26 +++++++++--
 src/i830_dri.c     |    8 ---
 src/i830_driver.c  |  124 ++++++-----------------------------------------------
 src/i830_exa.c     |    2 
 src/i830_memory.c  |    8 ++-
 9 files changed, 51 insertions(+), 136 deletions(-)

New commits:
diff-tree 1991a90ae90b388c914985d20d6f8c3637856e9a (from aef161853033907c6916337cebe88c8f111dd542)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Fri Mar 9 19:47:13 2007 +0100

    Update SAREA pipe sizes in i830_crtc_dpms instead of i830PipeSetBase.
    
    This allows setting the size to 0 when a pipe gets disabled.

diff --git a/src/i830_display.c b/src/i830_display.c
index 8a2494f..7855712 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -399,14 +399,10 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x,
 	case 0:
 	    sPriv->pipeA_x = x;
 	    sPriv->pipeA_y = y;
-	    sPriv->pipeA_w = crtc->mode.HDisplay;
-	    sPriv->pipeA_h = crtc->mode.VDisplay;
 	    break;
 	case 1:
 	    sPriv->pipeB_x = x;
 	    sPriv->pipeB_y = y;
-	    sPriv->pipeB_w = crtc->mode.HDisplay;
-	    sPriv->pipeB_h = crtc->mode.VDisplay;
 	    break;
 	default:
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -514,6 +510,28 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mod
 	usleep(150);
 	break;
     }
+
+#ifdef XF86DRI
+    if (pI830->directRenderingEnabled) {
+	drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn->pScreen);
+	Bool enabled = crtc->enabled && mode != DPMSModeOff;
+
+	switch (pipe) {
+	case 0:
+	    sPriv->pipeA_w = enabled ? crtc->mode.HDisplay : 0;
+	    sPriv->pipeA_h = enabled ? crtc->mode.VDisplay : 0;
+	    break;
+	case 1:
+	    sPriv->pipeB_w = enabled ? crtc->mode.HDisplay : 0;
+	    sPriv->pipeB_h = enabled ? crtc->mode.VDisplay : 0;
+	    break;
+	default:
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "Can't update pipe %d in SAREA\n", pipe);
+	    break;
+	}
+    }
+#endif
 }
 
 static Bool
diff --git a/src/i830_exa.c b/src/i830_exa.c
index bef8fae..dfc8f99 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #define DEBUG_I830FALLBACK 1
 #endif
 
-#define ALWAYS_SYNC		1
+#define ALWAYS_SYNC		0
 
 #ifdef DEBUG_I830FALLBACK
 #define I830FALLBACK(s, arg...)				\
diff-tree aef161853033907c6916337cebe88c8f111dd542 (from parents)
Merge: 1b54ee493fb96f944aa81e56fa6f00a8067f87fc 14ee9195d203192d3f613919f230b20b900ffdba
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Fri Mar 9 15:14:48 2007 +0100

    Merge remote branch 'origin/master' into i830-pageflip

diff-tree 1b54ee493fb96f944aa81e56fa6f00a8067f87fc (from parents)
Merge: e972265261c421268e4fb806e587378d0adec577 81722a21d232fa6cfb11fbe3d984abab50e89bcc
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Fri Mar 9 15:13:50 2007 +0100

    Merge remote branch 'origin/master' into i830-pageflip
    
    Conflicts:
    
    	src/i830_dri.c

diff --cc src/i830_dri.c
index 9931acc,680a28e..5293574
@@@ -107,12 -107,7 +107,8 @@@
  static void I830DRITransitionTo3d(ScreenPtr pScreen);
  static void I830DRITransitionMultiToSingle3d(ScreenPtr pScreen);
  static void I830DRITransitionSingleToMulti3d(ScreenPtr pScreen);
 +static void I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num);
  
- #if 0
- static void I830DRIShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf);
- #endif
- 
  extern void GlxSetVisualConfigs(int nconfigs,
  				__GLXvisualConfig * configs,
  				void **configprivs);
@@@ -1418,24 -1254,8 +1414,20 @@@
   * allocate and free 3d-specific memory on demand.
   */
  
- 
- 
- 
- 
 +/* Use the miext/shadow module to maintain a list of dirty rectangles.
 + * These are blitted to the back buffer to keep both buffers clean
 + * during page-flipping when the 3d application isn't fullscreen.
 + *
 + * Unlike most use of the shadow code, both buffers are in video
 + * memory.
 + *
 + * An alternative to this would be to organize for all on-screen
 + * drawing operations to be duplicated for the two buffers.  That
 + * might be faster, but seems like a lot more work...
 + */
 +
  static void
 -I830EnablePageFlip(ScreenPtr pScreen)
 +I830DRISetPfMask(ScreenPtr pScreen, int pfMask)
  {
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
diff-tree 14ee9195d203192d3f613919f230b20b900ffdba (from a5f0522b1d34236278861fe15bac2df099f0a2c7)
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Mar 7 13:00:03 2007 -0800

    Bug #10157: Fix cursor corruption on server regen.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 30558ac..18a05ef 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2962,6 +2962,8 @@ I830CloseScreen(int scrnIndex, ScreenPtr
       pI830->CursorInfoRec = 0;
    }
 
+   i830_reset_allocations(pScrn);
+
    if (I830IsPrimary(pScrn)) {
       xf86GARTCloseScreen(scrnIndex);
 
diff-tree a5f0522b1d34236278861fe15bac2df099f0a2c7 (from 81722a21d232fa6cfb11fbe3d984abab50e89bcc)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date:   Wed Mar 7 15:49:47 2007 +0000

    Add some additional checks when XAA is enabled.

diff --git a/src/i810_accel.c b/src/i810_accel.c
index efbe290..1f859b8 100644
--- a/src/i810_accel.c
+++ b/src/i810_accel.c
@@ -597,7 +597,8 @@ I810RefreshRing(ScrnInfoPtr pScrn)
    if (pI810->LpRing->space < 0)
       pI810->LpRing->space += pI810->LpRing->mem.Size;
 
-   pI810->AccelInfoRec->NeedToSync = TRUE;
+   if (pI810->AccelInfoRec)
+      pI810->AccelInfoRec->NeedToSync = TRUE;
 }
 
 /* Emit on gaining VT?
diff --git a/src/i810_dri.c b/src/i810_dri.c
index 3e32283..72718d3 100644
--- a/src/i810_dri.c
+++ b/src/i810_dri.c
@@ -222,6 +222,7 @@ I810InitVisualConfigs(ScreenPtr pScreen)
 	       pConfigs[i].redSize = 5;
 	       pConfigs[i].greenSize = 6;
 	       pConfigs[i].blueSize = 5;
+	       pConfigs[i].alphaSize = 0;
 	       pConfigs[i].redMask = 0x0000F800;
 	       pConfigs[i].greenMask = 0x000007E0;
 	       pConfigs[i].blueMask = 0x0000001F;
@@ -1173,7 +1174,9 @@ I810DRIInitBuffers(WindowPtr pWin, Regio
       pbox++;
    }
    I810SelectBuffer(pScrn, I810_SELECT_FRONT);
-   pI810->AccelInfoRec->NeedToSync = TRUE;
+
+   if (pI810->AccelInfoRec)
+   	pI810->AccelInfoRec->NeedToSync = TRUE;
 }
 
 /* This routine is a modified form of XAADoBitBlt with the calls to
@@ -1332,7 +1335,8 @@ I810DRIMoveBuffers(WindowPtr pParent, DD
       DEALLOCATE_LOCAL(pboxNew1);
    }
 
-   pI810->AccelInfoRec->NeedToSync = TRUE;
+   if (pI810->AccelInfoRec)
+	pI810->AccelInfoRec->NeedToSync = TRUE;
 }
 
 
diff-tree 81722a21d232fa6cfb11fbe3d984abab50e89bcc (from 04f50961e2f1610c39e7e4b45811f2a6b517cad6)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Tue Mar 6 23:16:53 2007 -0800

    Remove usage of 'shadow' module. Use xf86CrtcScreenInit.
    
    With the new mode setting code, rotation is handled outside of the driver,
    so the old usage of the 'shadow' module is no longer needed. Code to
    initialize the crtc structures has been moved out of the driver and into the
    modes code.

diff --git a/src/common.h b/src/common.h
index 6e8ddbd..f596eb8 100644
--- a/src/common.h
+++ b/src/common.h
@@ -87,7 +87,6 @@ extern const char *I810ddcSymbols[];
 extern const char *I810fbSymbols[];
 extern const char *I810xaaSymbols[];
 extern const char *I810shadowFBSymbols[];
-extern const char *I810shadowSymbols[];
 #ifdef XF86DRI
 extern const char *I810driSymbols[];
 extern const char *I810drmSymbols[];
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 04166b7..6666d7f 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -341,12 +341,6 @@ const char *I810driSymbols[] = {
 
 #endif /* I830_ONLY */
 
-const char *I810shadowSymbols[] = {
-    "shadowSetup",
-    "shadowAdd",
-    NULL
-};
-
 const char *I810i2cSymbols[] = {
     "xf86CreateI2CBusRec",
     "xf86I2CBusInit",
@@ -435,7 +429,6 @@ i810Setup(pointer module, pointer opts, 
 			I810drmSymbols,
 			I810driSymbols,
 #endif
-			I810shadowSymbols,
 			I810shadowFBSymbols,
 			I810vbeSymbols, vbeOptionalSymbols,
 			I810ddcSymbols, I810int10Symbols, NULL);
diff --git a/src/i830_dri.c b/src/i830_dri.c
index f81251a..680a28e 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -108,10 +108,6 @@ static void I830DRITransitionTo3d(Screen
 static void I830DRITransitionMultiToSingle3d(ScreenPtr pScreen);
 static void I830DRITransitionSingleToMulti3d(ScreenPtr pScreen);
 
-#if 0
-static void I830DRIShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf);
-#endif
-
 extern void GlxSetVisualConfigs(int nconfigs,
 				__GLXvisualConfig * configs,
 				void **configprivs);
@@ -981,16 +977,7 @@ I830DRIFinishScreenInit(ScreenPtr pScree
 
    DPRINTF(PFX, "I830DRIFinishScreenInit\n");
 
-   /* Have shadow run only while there is 3d active.
-    */
-#if 0
-   if (pI830->allowPageFlip && pI830->drmMinor >= 1) {
-      shadowAdd(pScreen, 0, I830DRIShadowUpdate, 0, 0, 0);
-   }
-   else
-#endif
-      pI830->allowPageFlip = 0;
-
+   pI830->allowPageFlip = 0;
 
    if (!DRIFinishScreenInit(pScreen))
       return FALSE;
@@ -1267,70 +1254,6 @@ I830DRIMoveBuffers(WindowPtr pParent, DD
  * allocate and free 3d-specific memory on demand.
  */
 
-
-
-
-
-/* Use the miext/shadow module to maintain a list of dirty rectangles.
- * These are blitted to the back buffer to keep both buffers clean
- * during page-flipping when the 3d application isn't fullscreen.
- *
- * Unlike most use of the shadow code, both buffers are in video
- * memory.
- *
- * An alternative to this would be to organize for all on-screen
- * drawing operations to be duplicated for the two buffers.  That
- * might be faster, but seems like a lot more work...
- */
-
-
-#if 0
-/* This should be done *before* XAA syncs,
- * Otherwise will have to sync again???
- */
-static void
-I830DRIShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   RegionPtr damage = &pBuf->damage;
-   int i, num =  REGION_NUM_RECTS(damage);
-   BoxPtr pbox = REGION_RECTS(damage);
-   drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScreen);
-   int cmd, br13;
-
-   /* Don't want to do this when no 3d is active and pages are
-    * right-way-round :
-    */
-   if (!pSAREAPriv->pf_active && pSAREAPriv->pf_current_page == 0)
-      return;
-
-   br13 = (pScrn->displayWidth * pI830->cpp) | (0xcc << 16);
-
-   if (pScrn->bitsPerPixel == 32) {
-      cmd = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
-	     XY_SRC_COPY_BLT_WRITE_RGB);
-      br13 |= 3 << 24;
-   } else {
-      cmd = (XY_SRC_COPY_BLT_CMD);
-      br13 |= 1 << 24;
-   }
-
-   for (i = 0 ; i < num ; i++, pbox++) {
-      BEGIN_LP_RING(8);
-      OUT_RING(cmd);
-      OUT_RING(br13);
-      OUT_RING((pbox->y1 << 16) | pbox->x1);
-      OUT_RING((pbox->y2 << 16) | pbox->x2);
-      OUT_RING(pI830->back_buffer->offset);
-      OUT_RING((pbox->y1 << 16) | pbox->x1);
-      OUT_RING(br13 & 0xffff);
-      OUT_RING(pI830->front_buffer->offset);
-      ADVANCE_LP_RING();
-   }
-}
-#endif
-
 static void
 I830EnablePageFlip(ScreenPtr pScreen)
 {
diff --git a/src/i830_driver.c b/src/i830_driver.c
index ada334b..30558ac 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1297,17 +1297,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
    I830SetupOutputs(pScrn);
 
    SaveHWState(pScrn);
-   /* Do an initial detection of the outputs while none are configured on yet.
-    * This will give us some likely legitimate response for later if both
-    * pipes are already allocated and we're asked to do a detect.
-    */
-   for (i = 0; i < xf86_config->num_output; i++) 
-   {
-      xf86OutputPtr	      output = xf86_config->output[i];
-
-      output->status = (*output->funcs->detect) (output);
-   }
-
    if (!xf86InitialConfiguration (pScrn, FALSE))
    {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
@@ -1414,13 +1403,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
       pI830->SWCursor = TRUE;
    }
 
-   if (!xf86RandR12PreInit (pScrn))
-   {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "RandR initialization failure\n");
-      PreInitCleanup(pScrn);
-      return FALSE;
-   }	
-
    if (pScrn->modes == NULL) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n");
       PreInitCleanup(pScrn);
@@ -1467,7 +1449,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
 
       memset(&req, 0, sizeof(req));
       req.majorversion = 2;
-      req.minorversion = 0;
+      req.minorversion = 1;
       if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, &req,
 		&errmaj, &errmin)) {
 	 LoaderErrorMsg(NULL, "exa", errmaj, errmin);
@@ -1511,29 +1493,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
    }
 #endif
 
-   /* rotation requires the newer libshadow */
-   if (I830IsPrimary(pScrn)) {
-      int errmaj, errmin;
-      pI830->shadowReq.majorversion = 1;
-      pI830->shadowReq.minorversion = 1;
-
-      if (!LoadSubModule(pScrn->module, "shadow", NULL, NULL, NULL,
-			       &pI830->shadowReq, &errmaj, &errmin)) {
-         pI830->shadowReq.minorversion = 0;
-         if (!LoadSubModule(pScrn->module, "shadow", NULL, NULL, NULL,
-			       &pI830->shadowReq, &errmaj, &errmin)) {
-            LoaderErrorMsg(NULL, "shadow", errmaj, errmin);
-	    return FALSE;
-         }
-      }
-   } else {
-      I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1);
-      pI830->shadowReq.majorversion = pI8301->shadowReq.majorversion;
-      pI830->shadowReq.minorversion = pI8301->shadowReq.minorversion;
-      pI830->shadowReq.patchlevel = pI8301->shadowReq.patchlevel;
-   }
-   xf86LoaderReqSymLists(I810shadowSymbols, NULL);
-
    pI830->preinit = FALSE;
 
    return TRUE;
@@ -1942,22 +1901,6 @@ I830PointerMoved(int index, int x, int y
 }
 
 static Bool
-I830CreateScreenResources (ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   pScreen->CreateScreenResources = pI830->CreateScreenResources;
-   if (!(*pScreen->CreateScreenResources)(pScreen))
-      return FALSE;
-
-   if (!xf86RandR12CreateScreenResources (pScreen))
-      return FALSE;
-
-   return TRUE;
-}
-
-static Bool
 I830InitFBManager(
     ScreenPtr pScreen,  
     BoxPtr FullBox
@@ -2685,38 +2628,12 @@ I830ScreenInit(int scrnIndex, ScreenPtr 
    pI830->CloseScreen = pScreen->CloseScreen;
    pScreen->CloseScreen = I830CloseScreen;
 
-   if (pI830->shadowReq.minorversion >= 1) {
-      /* Rotation */
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO, "RandR enabled, ignore the following RandR disabled message.\n");
-      xf86DisableRandR(); /* Disable built-in RandR extension */
-      shadowSetup(pScreen);
-      /* support all rotations */
-      xf86RandR12Init (pScreen);
-      if (pI830->useEXA) {
-#ifdef I830_USE_EXA
-	 if (pI830->EXADriverPtr->exa_minor >= 1) {
-	    xf86RandR12SetRotations (pScreen, RR_Rotate_0 | RR_Rotate_90 |
-				     RR_Rotate_180 | RR_Rotate_270);
-	 } else {
-	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		       "EXA version %d.%d too old to support rotation\n",
-		       pI830->EXADriverPtr->exa_major,
-		       pI830->EXADriverPtr->exa_minor);
-	    xf86RandR12SetRotations (pScreen, RR_Rotate_0);
-	 }
-#endif /* I830_USE_EXA */
-      } else {
-	 xf86RandR12SetRotations (pScreen, RR_Rotate_0 | RR_Rotate_90 |
-				  RR_Rotate_180 | RR_Rotate_270);
-      }
-      pI830->PointerMoved = pScrn->PointerMoved;
-      pScrn->PointerMoved = I830PointerMoved;
-      pI830->CreateScreenResources = pScreen->CreateScreenResources;
-      pScreen->CreateScreenResources = I830CreateScreenResources;
-   } else {
-      /* Rotation */
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO, "libshadow is version %d.%d.%d, required 1.1.0 or greater for rotation.\n",pI830->shadowReq.majorversion,pI830->shadowReq.minorversion,pI830->shadowReq.patchlevel);
-   }
+   if (!xf86CrtcScreenInit (pScreen))
+       return FALSE;
+       
+   /* Wrap pointer motion to flip touch screen around */
+   pI830->PointerMoved = pScrn->PointerMoved;
+   pScrn->PointerMoved = I830PointerMoved;
 
    if (serverGeneration == 1)
       xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
diff-tree 04f50961e2f1610c39e7e4b45811f2a6b517cad6 (from b07dfbba5df7728232b38211c623185116dcea5c)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 6 14:23:06 2007 -0800

    Bug #9898: Fix a crash with NoAccel set.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index bc6e07c..ada334b 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -537,8 +537,10 @@ I830MapMem(ScrnInfoPtr pScrn)
    if (!pI830->FbBase)
       return FALSE;
 
-   if (I830IsPrimary(pScrn))
-   pI830->LpRing->virtual_start = pI830->FbBase + pI830->LpRing->mem->offset;
+   if (I830IsPrimary(pScrn) && pI830->LpRing->mem != NULL) {
+      pI830->LpRing->virtual_start =
+	 pI830->FbBase + pI830->LpRing->mem->offset;
+   }
 
    return TRUE;
 }
diff-tree b07dfbba5df7728232b38211c623185116dcea5c (from 94c37f35872487c04136fb659526bffefd9c46ad)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 6 13:59:14 2007 -0800

    Remove leftover code that was disabling tiling after we set it up.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 1aa06b9..bc6e07c 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1913,18 +1913,6 @@ RestoreHWState(ScrnInfoPtr pScrn)
 }
 
 static void
-InitRegisterRec(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   int i;
-
-   if (!I830IsPrimary(pScrn)) return;
-
-   for (i = 0; i < 8; i++)
-      pI830->fence[i] = 0;
-}
-
-static void
 I830PointerMoved(int index, int x, int y)
 {
    ScrnInfoPtr pScrn = xf86Screens[index];
@@ -2505,8 +2493,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr 
    }
 #endif
 
-   InitRegisterRec(pScrn);
-
 #ifdef XF86DRI
    /*
     * pI830->directRenderingDisabled is set once in PreInit.  Reinitialise
diff-tree 94c37f35872487c04136fb659526bffefd9c46ad (from 30bb719ca0abc2599ffb89e59f297fa9a0a00c3c)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 6 13:57:04 2007 -0800

    Make the depth buffer X tiled instead of Y, and fix a Y tiling nit on 945.
    
    The previous code claimed to set the depth buffer up as Y tiled, but due to
    lack of implementation in SetFence, it ended up being X tiled.  Actually
    setting the Y tiling flag in the new version broke the depth buffer, so just
    switch the depth buffer to X tiling, which appears to work fine.

diff --git a/src/i830_memory.c b/src/i830_memory.c
index ea6b90d..f0b50aa 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1121,8 +1121,8 @@ i830_allocate_depthbuffer(ScrnInfoPtr pS
 	pI830->depth_buffer =
 	    i830_allocate_memory_tiled(pScrn, "depth buffer", size, pitch,
 				       GTT_PAGE_SIZE, ALIGN_BOTH_ENDS,
-				       TILING_YMAJOR);
-	pI830->depth_tiled = FENCE_YMAJOR;
+				       TILING_XMAJOR);
+	pI830->depth_tiled = FENCE_XMAJOR;
     }
 
     /* Otherwise, allocate it linear. */
@@ -1369,7 +1369,9 @@ i830_set_fence(ScrnInfoPtr pScrn, int nr
    	}
     }
 
-    if (IS_I9XX(pI830))
+    if ((IS_I945G(pI830) || IS_I945GM(pI830)) && tile_format == TILING_YMAJOR)
+	fence_pitch = pitch / 128;
+    else if (IS_I9XX(pI830))
 	fence_pitch = pitch / 512;
     else
 	fence_pitch = pitch / 128;
diff-tree 30bb719ca0abc2599ffb89e59f297fa9a0a00c3c (from 1e1b45fa6ed1683cba4ae73ac98933e74c3ab9d6)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 6 12:23:43 2007 -0800

    Continue to allocate the legacy texture pool by default.
    
    This is a partial revert of 7358642e64ab6d13bc1dc1a44703ee66d715ff61
    
    If we don't allocate it now, when the DRM version is too low there won't be any
    memory allocated and DRI will fail.  Instead, waste the memory in the i915tex
    case for now, and leave fixing it right (check DRM version up front and decide
    which memory manager to set up) to later.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index a27d805..1aa06b9 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1234,14 +1234,13 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
       pI830->mmModeFlags = 0;
 
       if (!pI830->directRenderingDisabled) {
+	 pI830->mmModeFlags = I830_KERNEL_TEX;
 #ifdef XF86DRI_MM
 	 Bool tmp = FALSE;
 
 	 if (!IS_I965G(pI830))
 	    pI830->mmModeFlags |= I830_KERNEL_MM;
-	 else
 #endif
-	    pI830->mmModeFlags |= I830_KERNEL_TEX;
 
 	 from = X_PROBED;
 
diff-tree 1e1b45fa6ed1683cba4ae73ac98933e74c3ab9d6 (from 4042b27f01fdb94e7fc0d4e991e054fff88479ea)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Tue Mar 6 10:28:41 2007 +0100

    Fix reduced DRI memory manager size.
    
    pI830->mmSize is in kB.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 0977511..a27d805 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2346,7 +2346,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr 
 	    /* For this allocation, switch to a smaller DRI memory manager
 	     * size.
 	     */
-	    pI830->mmSize = I830_MM_MINPAGES * GTT_PAGE_SIZE;
+	    pI830->mmSize = I830_MM_MINPAGES * GTT_PAGE_SIZE / KB(1);
 	 } else {
 	    pI830->mmSize = savedMMSize;
 	 }



More information about the xorg-commit mailing list