sna/dri2: Don't decouple front buffer tracking for invalid SwapBuffer calls
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 20 Jun 2014 06:28:02 +0000 (07:28 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 20 Jun 2014 09:57:22 +0000 (10:57 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_dri2.c

index cfe65f4..e9d06ae 100644 (file)
@@ -2658,6 +2658,14 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
        assert(get_private(front)->bo->refcnt);
        assert(get_private(back)->bo->refcnt);
 
+       if (get_private(front)->pixmap != get_drawable_pixmap(draw))
+               goto skip;
+
+       if (get_private(back)->stale)
+               goto skip;
+
+       assert(sna_pixmap_from_drawable(draw)->flush);
+
        if (draw->type != DRAWABLE_PIXMAP) {
                struct dri2_window *priv = dri2_window((WindowPtr)draw);
                if (priv->front) {
@@ -2668,14 +2676,6 @@ sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
                }
        }
 
-       if (get_private(front)->pixmap != get_drawable_pixmap(draw))
-               goto skip;
-
-       if (get_private(back)->stale)
-               goto skip;
-
-       assert(sna_pixmap_from_drawable(draw)->flush);
-
        /* Drawable not displayed... just complete the swap */
        if ((sna->flags & SNA_NO_WAIT) == 0)
                crtc = sna_dri2_get_crtc(draw);