sna: Only destroy the old GPU after successfully replacing it
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Nov 2013 11:12:30 +0000 (11:12 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Nov 2013 11:12:30 +0000 (11:12 +0000)
Along the sna_replace__xor path we destroyed the priv->gpu_bo twice upon
successfully replacing it.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70527
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_io.c

index bad6052..75d9fe1 100644 (file)
@@ -1304,7 +1304,6 @@ bool sna_write_boxes__xor(struct sna *sna, PixmapPtr dst,
        if (wedged(sna))
                return false;
 
-
        can_blt = kgem_bo_can_blt(kgem, dst_bo) &&
                (box[0].x2 - box[0].x1) * dst->drawable.bitsPerPixel < 8 * (MAXSHORT - 4);
        extents = box[0];
@@ -1897,10 +1896,8 @@ sna_replace__xor(struct sna *sna, PixmapPtr pixmap,
                                        pixmap->drawable.bitsPerPixel,
                                        bo->tiling,
                                        CREATE_GTT_MAP | CREATE_INACTIVE);
-               if (new_bo) {
-                       kgem_bo_destroy(&sna->kgem, bo);
+               if (new_bo)
                        bo = new_bo;
-               }
        }
 
        if (kgem_bo_can_map(&sna->kgem, bo) &&