sna: Clear sna_pixmap->cpu when destroying the CPU damage

So that we keep the assertion checks that without CPU damage we can not
be on the cpu.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-10-03 22:53:57 +01:00
parent 0d42872d1e
commit b71af5dc62
1 changed files with 4 additions and 1 deletions

View File

@ -3012,8 +3012,10 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
priv->gpu_bo = NULL;
}
if ((flags & MOVE_READ) == 0)
if ((flags & MOVE_READ) == 0) {
sna_damage_destroy(&priv->cpu_damage);
priv->cpu = false;
}
sna_damage_reduce(&priv->cpu_damage);
assert_pixmap_damage(pixmap);
@ -3065,6 +3067,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
pixmap->drawable.height);
DBG(("%s: marking as all-damaged for GPU\n",
__FUNCTION__));
assert(priv->cpu == false);
goto active;
}
}