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>
This commit is contained in:
Chris Wilson 2013-02-19 08:57:47 +00:00
parent d90a123db7
commit 1e2fd66ade
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}