summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-19 08:57:47 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-19 08:57:47 +0000
commit1e2fd66ade6bdbf1e6011f3d59e423fada3f12f6 (patch)
tree5c13ee996e7623eaf0653e2c0bc47c99880f4c48
parentd90a123db7ac99cf017167bf89df31c635df7e1e (diff)
sna: Assert that the GPU damage is NULL before destroy a proxy
If the GPU bo is a proxy, then it really is a pointer into a upload buffer for CPU data. In these cases, there should never be any GPU damage lying around. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c1
-rw-r--r--src/sna/sna_composite.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0f9a725a..a577af6a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11783,6 +11783,7 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
if (region_subsumes_damage(&region, priv->cpu_damage)) {
DBG(("%s: discarding existing CPU damage\n", __FUNCTION__));
if (priv->gpu_bo && priv->gpu_bo->proxy) {
+ assert(priv->gpu_damage == NULL);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = NULL;
}
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index a4b85fe5..e0677998 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -921,6 +921,7 @@ sna_composite_rectangles(CARD8 op,
region_subsumes_damage(&region, priv->cpu_damage)) {
DBG(("%s: discarding existing CPU damage\n", __FUNCTION__));
if (priv->gpu_bo && priv->gpu_bo->proxy) {
+ assert(priv->gpu_damage == NULL);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = NULL;
}