xf86-video-intel: 2 commits - src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Jul 20 05:31:21 PDT 2013


 src/sna/sna_accel.c |   91 +++++++++++++++++++++++++---------------------------
 1 file changed, 45 insertions(+), 46 deletions(-)

New commits:
commit 3f52a89046999c02ed778777eff8e2eb62662d90
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jul 20 12:16:23 2013 +0100

    sna: Fix application of composite offsets along PutImage fallback path
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0e6a552..96cd73e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4473,8 +4473,6 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth,
 	if (w == 0 || h == 0)
 		return;
 
-	get_drawable_deltas(drawable, pixmap, &dx, &dy);
-
 	region.extents.x1 = x + drawable->x;
 	region.extents.y1 = y + drawable->y;
 	region.extents.x2 = region.extents.x1 + w;
@@ -4491,14 +4489,15 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth,
 			return;
 	}
 
+	if (get_drawable_deltas(drawable, pixmap, &dx, &dy))
+		RegionTranslate(&region, dx, dy);
+
 	if (priv == NULL) {
 		DBG(("%s: fallback -- unattached(%d, %d, %d, %d)\n",
 		     __FUNCTION__, x, y, w, h));
 		goto fallback;
 	}
 
-	RegionTranslate(&region, dx, dy);
-
 	if (FORCE_FALLBACK)
 		goto fallback;
 
commit a998a8a34961ccdcec14369486ae3332009a1276
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jul 20 02:01:25 2013 +0100

    sna: Tidy fast source clip processing for sna_do_copy
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 5859523..0e6a552 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -5469,6 +5469,11 @@ typedef void (*sna_copy_func)(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 			      RegionPtr region, int dx, int dy,
 			      Pixel bitPlane, void *closure);
 
+static inline bool box_equal(const BoxRec *a, const BoxRec *b)
+{
+	return *(uint64_t *)a == *(uint64_t *)b;
+}
+
 static RegionPtr
 sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 	    int sx, int sy,
@@ -5479,6 +5484,7 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 	RegionPtr clip;
 	RegionRec region;
 	BoxRec src_extents;
+	bool expose;
 
 	DBG(("%s: src=(%d, %d), dst=(%d, %d), size=(%dx%d)\n",
 	     __FUNCTION__, sx, sy, dx, dy, width, height));
@@ -5521,58 +5527,52 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 	region.extents.y2 = clamp(region.extents.y2, sy - dy);
 
 	src_extents = region.extents;
+	expose = gc->fExpose;
 
-	/* Compute source clip region */
-	clip = NULL;
-	if (src == dst && gc->clientClipType == CT_NONE) {
-		DBG(("%s: using gc clip for src\n", __FUNCTION__));
-		clip = gc->pCompositeClip;
-	} else if (src->type == DRAWABLE_PIXMAP) {
-		DBG(("%s: pixmap -- no source clipping\n", __FUNCTION__));
-	} else if (gc->subWindowMode == IncludeInferiors) {
-		WindowPtr w = (WindowPtr)src;
-
-		DBG(("%s: include inferiors (is-clipped? %d)\n",
-		     __FUNCTION__, w->parent || RegionNil(&w->borderClip)));
+	if (region.extents.x1 < src->x)
+		region.extents.x1 = src->x;
+	if (region.extents.y1 < src->y)
+		region.extents.y1 = src->y;
+	if (region.extents.x2 > src->x + (int) src->width)
+		region.extents.x2 = src->x + (int) src->width;
+	if (region.extents.y2 > src->y + (int) src->height)
+		region.extents.y2 = src->y + (int) src->height;
 
-		/*
-		 * XFree86 DDX empties the border clip when the
-		 * VT is inactive, make sure the region isn't empty
-		 */
-		assert(!w->winSize.data);
-		box_intersect(&region.extents, &w->winSize.extents);
-		if (w->borderClip.data == NULL)
-			box_intersect(&region.extents, &w->borderClip.extents);
-		else
-			clip = &w->borderClip;
+	/* Compute source clip region */
+	if (src->type == DRAWABLE_PIXMAP) {
+		if (src == dst && gc->clientClipType == CT_NONE) {
+			DBG(("%s: pixmap -- using gc clip\n", __FUNCTION__));
+			clip = gc->pCompositeClip;
+		} else {
+			DBG(("%s: pixmap -- no source clipping\n", __FUNCTION__));
+			expose = false;
+			clip = NULL;
+		}
 	} else {
 		WindowPtr w = (WindowPtr)src;
+		if (gc->subWindowMode == IncludeInferiors) {
+			DBG(("%s: window -- include inferiors\n", __FUNCTION__));
 
-		DBG(("%s: window clip\n", __FUNCTION__));
-		if (w->clipList.data == NULL)
-			box_intersect(&region.extents, &w->clipList.extents);
-		else
+			assert(!w->winSize.data);
+			box_intersect(&region.extents, &w->winSize.extents);
+			clip = &w->borderClip;
+		} else {
+			DBG(("%s: window -- clip by children\n", __FUNCTION__));
 			clip = &w->clipList;
+		}
+	}
+	if (clip != NULL) {
+		if (clip->data == NULL) {
+			box_intersect(&region.extents, &clip->extents);
+			if (box_equal(&src_extents, &region.extents))
+				expose = false;
+		} else
+			RegionIntersect(&region, &region, clip);
 	}
-	if (clip == NULL) {
-		DBG(("%s: fast source clip against extents\n", __FUNCTION__));
-		if (region.extents.x1 < src->x)
-			region.extents.x1 = src->x;
-		if (region.extents.y1 < src->y)
-			region.extents.y1 = src->y;
-		if (region.extents.x2 > src->x + (int) src->width)
-			region.extents.x2 = src->x + (int) src->width;
-		if (region.extents.y2 > src->y + (int) src->height)
-			region.extents.y2 = src->y + (int) src->height;
-	} else
-		RegionIntersect(&region, &region, clip);
 	DBG(("%s: src extents (%d, %d), (%d, %d) x %ld\n", __FUNCTION__,
 	     region.extents.x1, region.extents.y1,
 	     region.extents.x2, region.extents.y2,
 	     (long)RegionNumRects(&region)));
-	if ((clip == NULL || clip->data == NULL) &&
-	    *(uint64_t *)&src_extents == *(uint64_t *)&region.extents)
-		*(uint64_t *)&src_extents = 0;
 
 	RegionTranslate(&region, dx-sx, dy-sy);
 	if (gc->pCompositeClip->data)
@@ -5588,7 +5588,7 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 
 	/* Pixmap sources generate a NoExposed (we return NULL to do this) */
 	clip = NULL;
-	if (gc->fExpose && *(uint64_t *)&src_extents != 0)
+	if (expose)
 		clip = miHandleExposures(src, dst, gc,
 					 sx - src->x, sy - src->y,
 					 width, height,


More information about the xorg-commit mailing list