sna: Discard a no-longer-used GPU bo after moving to the CPU domain

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-08-22 00:38:17 +01:00
parent 8be15c37df
commit 31e398c9db
1 changed files with 6 additions and 0 deletions

View File

@ -1426,6 +1426,12 @@ done:
if (flags & MOVE_WRITE) {
priv->source_count = SOURCE_BIAS;
assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL);
if (priv->gpu_bo && priv->gpu_bo->domain != DOMAIN_GPU) {
DBG(("%s: discarding inactive GPU bo\n", __FUNCTION__));
assert(DAMAGE_IS_ALL(priv->cpu_damage));
sna_pixmap_free_gpu(sna, priv);
priv->undamaged = false;
}
}
if (priv->cpu_bo) {