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

Chris Wilson ickle at kemper.freedesktop.org
Wed Oct 29 09:57:05 PDT 2014


 src/sna/sna_accel.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 61436c2fabe117b85404eecb06158ba0a63a7741
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Oct 29 16:52:44 2014 +0000

    sna: Fix build for GC API changes in Xorg-1.16.99.901
    
    The GC struct was changed in
    
    commit 73e2383b7350723256894c5076d0c731aec5cd1f
    Author: Adam Jackson <ajax at redhat.com>
    Date:   Fri Jun 20 13:31:20 2014 -0400
    
        dix: Always store GC client clip as a region (v2)
    
    update to match.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85581
    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 176a612..b2fe6d4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4395,6 +4395,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
 	sgc->priv = gc->pCompositeClip;
 	gc->pCompositeClip = region;
 
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
 	if (gc->clientClipType == CT_PIXMAP) {
 		PixmapPtr clip = gc->clientClip;
 		gc->clientClip = region_from_bitmap(gc->pScreen, clip);
@@ -4403,6 +4404,9 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
 		changes |= GCClipMask;
 	} else
 		changes &= ~GCClipMask;
+#else
+	changes &= ~GCClipMask;
+#endif
 
 	if (changes || drawable->serialNumber != (sgc->serial & DRAWABLE_SERIAL_BITS)) {
 		long tmp = gc->serialNumber;
@@ -6862,6 +6866,15 @@ static inline bool box_equal(const BoxRec *a, const BoxRec *b)
 	return *(const uint64_t *)a == *(const uint64_t *)b;
 }
 
+static inline bool has_clip(GCPtr gc)
+{
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+	return gc->clientClipType != CT_NONE;
+#else
+	return gc->clientClip != NULL;
+#endif
+}
+
 static RegionPtr
 sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 	    int sx, int sy,
@@ -6948,7 +6961,7 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 
 	/* Compute source clip region */
 	if (src->type == DRAWABLE_PIXMAP) {
-		if (src == dst && gc->clientClipType == CT_NONE) {
+		if (src == dst && !has_clip(gc)) {
 			DBG(("%s: pixmap -- using gc clip\n", __FUNCTION__));
 			clip = gc->pCompositeClip;
 		} else {
@@ -16622,7 +16635,7 @@ sna_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
 
 	if (changes & (GCClipMask|GCSubwindowMode) ||
 	    drawable->serialNumber != (gc->serialNumber & DRAWABLE_SERIAL_BITS) ||
-	    (gc->clientClipType != CT_NONE && (changes & (GCClipXOrigin | GCClipYOrigin)))) {
+	    (has_clip(gc) && (changes & (GCClipXOrigin | GCClipYOrigin)))) {
 		DBG(("%s: recomputing clip\n", __FUNCTION__));
 		miComputeCompositeClip(gc, drawable);
 		DBG(("%s: composite clip=%dx[(%d, %d), (%d, %d)] [%p]\n",


More information about the xorg-commit mailing list