xf86-video-intel: src/intel_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Oct 6 04:45:57 PDT 2010


 src/intel_dri.c |   42 +++++++++++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 17 deletions(-)

New commits:
commit 1444ea35706992a1f094fe029e6a7d9eec0f93c6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Oct 6 12:36:30 2010 +0100

    dri+shadow: Only tweak the acceleration of CopyRegion if using shadow.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index bc4dc50..8c7a707 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -409,7 +409,6 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 	DrawablePtr dst = (dstPrivate->attachment == DRI2BufferFrontLeft)
 		? drawable : &dstPrivate->pixmap->drawable;
 	RegionPtr pCopyClip;
-	struct intel_pixmap *src_pixmap, *dst_pixmap;
 	GCPtr gc;
 
 	gc = GetScratchGC(dst->depth, screen);
@@ -507,23 +506,32 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 	 * again. */
 
 	/* Re-enable 2D acceleration... */
-	src_pixmap = intel_get_pixmap_private(get_drawable_pixmap(src));
-	src_pixmap->offscreen = 1;
-	src_pixmap->busy = 1;
-
-	dst_pixmap = intel_get_pixmap_private(get_drawable_pixmap(dst));
-	dst_pixmap->offscreen = 1;
-	dst_pixmap->busy = 1;
-
-	gc->ops->CopyArea(src, dst, gc,
-			  0, 0,
-			  drawable->width, drawable->height,
-			  0, 0);
-	FreeScratchGC(gc);
+	if (intel->use_shadow) {
+		struct intel_pixmap *src_pixmap, *dst_pixmap;
+
+		src_pixmap = intel_get_pixmap_private(get_drawable_pixmap(src));
+		src_pixmap->offscreen = 1;
+		src_pixmap->busy = 1;
+
+		dst_pixmap = intel_get_pixmap_private(get_drawable_pixmap(dst));
+		dst_pixmap->offscreen = 1;
+		dst_pixmap->busy = 1;
+
+		gc->ops->CopyArea(src, dst, gc,
+				  0, 0,
+				  drawable->width, drawable->height,
+				  0, 0);
 
-	/* and restore 2D/3D coherency */
-	src_pixmap->offscreen = 0;
-	dst_pixmap->offscreen = 0;
+		/* and restore 2D/3D coherency */
+		src_pixmap->offscreen = 0;
+		dst_pixmap->offscreen = 0;
+	} else {
+		gc->ops->CopyArea(src, dst, gc,
+				  0, 0,
+				  drawable->width, drawable->height,
+				  0, 0);
+	}
+	FreeScratchGC(gc);
 }
 
 #if DRI2INFOREC_VERSION >= 4


More information about the xorg-commit mailing list