From 29e11e2e6f80f6485ed69ea72e09e8d9b31fd8e8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Jan 2014 22:40:11 +0000 Subject: [PATCH] sna: Restore gc->serialNumber correctly after falling back Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73856 Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 4a2b614..b1744ae 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -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 = { -- 1.8.5.3