summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-27 10:02:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-27 10:02:28 +0100
commit591981a36c333cdf08a91f28fb9670a62b95d31a (patch)
tree7ff19d7bd972ea5f16833746553cc35eee3d0849
parent8f6dcc15c8d6ea726a10ef5df18536f8c769291e (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c8
1 files 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 &&