From 591981a36c333cdf08a91f28fb9670a62b95d31a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 27 Jun 2013 10:02:28 +0100 Subject: sna: Refactor freeing gpu_bo in manual tiled upload Use the common function so that we correctly check for pinned GPU bo, and adjust the hints afterwards. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 14097796..04128639 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2017,7 +2017,7 @@ skip_inplace_map: pixmap->drawable.height); sna_pixmap_free_gpu(sna, priv); assert(priv->gpu_damage == NULL); - priv->clear = false; + assert(priv->clear == false); } if (priv->gpu_damage) { @@ -3962,9 +3962,9 @@ try_upload_tiled_x(PixmapPtr pixmap, RegionRec *region, if (priv->gpu_bo && (replaces || priv->gpu_bo->proxy)) { DBG(("%s: discarding cached upload proxy\n", __FUNCTION__)); - sna_damage_destroy(&priv->gpu_damage); - kgem_bo_destroy(&sna->kgem, priv->gpu_bo); - priv->gpu_bo = NULL; + if (priv->cow) + sna_pixmap_undo_cow(sna, priv, 0); + sna_pixmap_free_gpu(sna, priv); } if (priv->gpu_bo == NULL && -- cgit v1.2.3