xf86-video-intel: Branch '2.6' - 3 commits - configure.ac src/i830.h src/i830_dri.c src/i830_driver.c src/i830_exa.c

Eric Anholt anholt at kemper.freedesktop.org
Mon Mar 2 12:17:45 PST 2009


 configure.ac      |    2 +-
 src/i830.h        |   11 +++++++++++
 src/i830_dri.c    |   25 +++++++++++--------------
 src/i830_driver.c |    4 ++++
 src/i830_exa.c    |   35 ++++++++++++++++++++++-------------
 5 files changed, 49 insertions(+), 28 deletions(-)

New commits:
commit f04552cdbcb110c876816dfda577803e6c92fb6a
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Mar 2 11:18:27 2009 -0800

    Bump version to 2.6.3.

diff --git a/configure.ac b/configure.ac
index 13d7468..be4a25f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-intel],
-        2.6.2,
+        2.6.3,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-intel)
 
commit c0d91bd3ffea329058b63e648d2eae05edd9ad8a
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Mar 2 11:17:27 2009 -0800

    Only allocate pixmaps aligned for tiling when requested by DRI2 GetBuffers.
    
    This saves massive quantities of memory on pre-965 since the DRI2 tiling
    enable caused the minimum size of any pixmap to be 1MB.
    (cherry picked from commit 5bfd73cd31ba197a62f549cdbad1a1270b571027)

diff --git a/src/i830.h b/src/i830.h
index 6a5b7ed..55b1681 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -1095,4 +1095,15 @@ extern const int I830CopyROP[16];
 #define QUIRK_IGNORE_CRT		0x00000080
 extern void i830_fixup_devices(ScrnInfoPtr);
 
+/**
+ * Hints to CreatePixmap to tell the driver how the pixmap is going to be
+ * used.
+ *
+ * Compare to CREATE_PIXMAP_USAGE_* in the server.
+ */
+enum {
+    INTEL_CREATE_PIXMAP_TILING_X = 0x10000000,
+    INTEL_CREATE_PIXMAP_TILING_Y,
+};
+
 #endif /* _I830_H_ */
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 0b15656..bc8d646 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1862,36 +1862,33 @@ I830DRI2CreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count)
 	    pPixmap = pDepthPixmap;
 	    pPixmap->refcnt++;
 	} else {
-	    uint32_t tiling = I915_TILING_NONE;
+	    unsigned int hint = 0;
 
-	    pPixmap = (*pScreen->CreatePixmap)(pScreen,
-					       pDraw->width,
-					       pDraw->height,
-					       pDraw->depth, 0);
 	    switch (attachments[i]) {
 	    case DRI2BufferDepth:
 		if (SUPPORTS_YTILING(pI830))
-		    tiling = I915_TILING_Y;
+		    hint = INTEL_CREATE_PIXMAP_TILING_Y;
 		else
-		    tiling = I915_TILING_X;
+		    hint = INTEL_CREATE_PIXMAP_TILING_X;
 		break;
 	    case DRI2BufferFakeFrontLeft:
 	    case DRI2BufferFakeFrontRight:
 	    case DRI2BufferBackLeft:
 	    case DRI2BufferBackRight:
-		    tiling = I915_TILING_X;
+		    hint = INTEL_CREATE_PIXMAP_TILING_X;
 		break;
 	    }
 
 	    if (!pI830->tiling ||
 		(!IS_I965G(pI830) && !pI830->kernel_exec_fencing))
-		tiling = I915_TILING_NONE;
+		hint = 0;
+
+	    pPixmap = (*pScreen->CreatePixmap)(pScreen,
+					       pDraw->width,
+					       pDraw->height,
+					       pDraw->depth,
+					       hint);
 
-	    if (tiling != I915_TILING_NONE) {
-		bo = i830_get_pixmap_bo(pPixmap);
-		drm_intel_bo_set_tiling(bo, &tiling,
-					intel_get_pixmap_pitch(pPixmap));
-	    }
 	}
 
 	if (attachments[i] == DRI2BufferDepth)
diff --git a/src/i830_exa.c b/src/i830_exa.c
index e61f661..85d884f 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -883,29 +883,38 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
     if (w && h)
     {
 	unsigned int size;
+	uint32_t tiling = I915_TILING_NONE;
 
 	stride = ROUND_TO((w * pixmap->drawable.bitsPerPixel + 7) / 8,
 			  i830->accel_pixmap_pitch_alignment);
 
-	/* Use the I915_FENCE_TILING_X even if it may end up being TILING_Y,
-	 * as it just results in larger alignment.  Really, we need to use the
-	 * usage hint to tell what the pixmap's going to be.
-	 */
-	stride = i830_get_fence_pitch(i830, stride, I915_TILING_X);
-	/* Round the object up to the size of the fence it will live in
-	 * if necessary.  We could potentially make the kernel allocate
-	 * a larger aperture space and just bind the subset of pages in,
-	 * but this is easier and also keeps us out of trouble (as much)
-	 * with drm_intel_bufmgr_check_aperture().
-	 */
-	size = i830_get_fence_size(i830, stride * h);
+	if (usage == INTEL_CREATE_PIXMAP_TILING_X)
+	    tiling = I915_TILING_X;
+	else if (usage == INTEL_CREATE_PIXMAP_TILING_Y)
+	    tiling = I915_TILING_Y;
+
+	if (tiling == I915_TILING_NONE) {
+	    size = stride * h;
+	} else {
+	    stride = i830_get_fence_pitch(i830, stride, tiling);
+	    /* Round the object up to the size of the fence it will live in
+	     * if necessary.  We could potentially make the kernel allocate
+	     * a larger aperture space and just bind the subset of pages in,
+	     * but this is easier and also keeps us out of trouble (as much)
+	     * with drm_intel_bufmgr_check_aperture().
+	     */
+	    size = i830_get_fence_size(i830, stride * h);
+	}
 
 	bo = drm_intel_bo_alloc_for_render(i830->bufmgr, "pixmap", size, 0);
 	if (!bo) {
 	    fbDestroyPixmap (pixmap);
 	    return NullPixmap;
 	}
-	
+
+	if (tiling != I915_TILING_NONE)
+	    drm_intel_bo_set_tiling(bo, &tiling, stride);
+
 	screen->ModifyPixmapHeader (pixmap, w, h, 0, 0, stride, NULL);
     
 	i830_uxa_set_pixmap_bo (pixmap, bo);
commit 5441be42649e4f969ac16c323de2fb5ed93b271a
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Feb 24 20:54:05 2009 -0800

    Disable fb resizing for DRI1-only server so that DRI1 can initialize.
    (cherry picked from commit 70e0261208654c6c875ad462da2734c6aa9eeb96)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5a31e82..fbe5934 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1694,6 +1694,10 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
     pI830->can_resize = FALSE;
     if (pI830->accel == ACCEL_UXA && pI830->directRenderingType != DRI_XF86DRI)
 	pI830->can_resize = TRUE;
+#if !defined(DRI2) && defined(XF86DRI)
+    /* Disable resizing so that DRI1 can initialize and give us GEM support. */
+    pI830->can_resize = FALSE;
+#endif
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "Resizable framebuffer: %s (%d %d)\n",


More information about the xorg-commit mailing list