sna: Discard the gpu-bo is the entire pixmap is written to by the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-11-26 16:47:04 +00:00
parent df68b20a17
commit ccee730e45
1 changed files with 6 additions and 0 deletions

View File

@ -741,6 +741,12 @@ done:
DBG(("%s: applying cpu damage\n", __FUNCTION__));
assert_pixmap_contains_box(pixmap, RegionExtents(region));
sna_damage_add(&priv->cpu_damage, region);
if (sna_damage_is_all(&priv->cpu_damage,
pixmap->drawable.width,
pixmap->drawable.height)) {
DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
sna_pixmap_destroy_gpu_bo(sna, priv);
}
if (priv->flush)
list_move(&priv->list, &sna->dirty_pixmaps);
}