sna: Add a couple more asserts to track a potential NULL gc->pCompositeClip
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Nov 2013 11:38:46 +0000 (11:38 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Nov 2013 11:39:34 +0000 (11:39 +0000)
References: https://bugs.freedesktop.org/show_bug.cgi?id=71415
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_accel.c

index b1dc2f7..9cff1de 100644 (file)
@@ -3942,6 +3942,8 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
        long changes = sgc->changes;
 
        DBG(("%s, changes=%lx\n", __FUNCTION__, changes));
+       assert(drawable);
+       assert(region);
 
        assert(gc->ops == (GCOps *)&sna_gc_ops);
        gc->ops = (GCOps *)&sna_gc_ops__cpu;
@@ -3949,6 +3951,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
        sgc->old_funcs = gc->funcs;
        gc->funcs = (GCFuncs *)&sna_gc_funcs__cpu;
 
+       assert(gc->pCompositeClip);
        sgc->priv = gc->pCompositeClip;
        gc->pCompositeClip = region;
 
@@ -3983,7 +3986,6 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
 
                fbValidateGC(gc, changes, drawable);
 
-               gc->serialNumber = drawable->serialNumber;
                sgc->serial = drawable->serialNumber;
        }
        sgc->changes = 0;
@@ -4009,6 +4011,7 @@ static void sna_gc_move_to_gpu(GCPtr gc)
        gc->ops = (GCOps *)&sna_gc_ops;
        gc->funcs = sna_gc(gc)->old_funcs;
        gc->pCompositeClip = sna_gc(gc)->priv;
+       assert(gc->pCompositeClip);
 }
 
 static inline bool clip_box(BoxPtr box, GCPtr gc)
@@ -4016,6 +4019,7 @@ static inline bool clip_box(BoxPtr box, GCPtr gc)
        const BoxRec *clip;
        bool clipped;
 
+       assert(gc->pCompositeClip);
        clip = &gc->pCompositeClip->extents;
 
        clipped = !region_is_singular(gc->pCompositeClip);