sna: Restore gc->serialNumber correctly after falling back
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 21 Jan 2014 22:40:11 +0000 (22:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 21 Jan 2014 22:40:11 +0000 (22:40 +0000)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73856
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_accel.c

index 4a2b614..b1744ae 100644 (file)
@@ -4021,7 +4021,8 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
        } else
                changes &= ~GCClipMask;
 
-       if (changes || drawable->serialNumber != sgc->serial) {
+       if (changes || drawable->serialNumber != (sgc->serial & DRAWABLE_SERIAL_BITS)) {
+               long tmp = gc->serialNumber;
                gc->serialNumber = sgc->serial;
 
                if (fb_gc(gc)->bpp != drawable->bitsPerPixel) {
@@ -4042,8 +4043,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
                }
 
                fbValidateGC(gc, changes, drawable);
-
-               sgc->serial = drawable->serialNumber;
+               gc->serialNumber = tmp;
        }
        sgc->changes = 0;
 
@@ -15733,6 +15733,7 @@ sna_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
        assert(RegionNil(gc->pCompositeClip) || gc->pCompositeClip->extents.y2 - drawable->y <= drawable->height);
 
        sna_gc(gc)->changes |= changes;
+       sna_gc(gc)->serial = gc->serialNumber;
 }
 
 static const GCFuncs sna_gc_funcs = {