sna: Short-circuit repeated calls to force-to-gpu

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-21 10:55:46 +00:00
parent f2aafb9802
commit 580ae520ca
1 changed files with 5 additions and 0 deletions

View File

@ -2013,6 +2013,11 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap, unsigned flags)
if (priv == NULL)
return NULL;
if (DAMAGE_IS_ALL(priv->gpu_damage)) {
DBG(("%s: GPU all-damaged\n", __FUNCTION__));
return priv;
}
/* Unlike move-to-gpu, we ignore wedged and always create the GPU bo */
if (priv->gpu_bo == NULL) {
struct sna *sna = to_sna_from_pixmap(pixmap);