sna: Mark fresh GPU only bo as being all damaged

Presume that we will not fallback and so treat a GPU only bo (one that
is initially created on the GPU) as being all-damaged. This makes future
operations cheaper as the damage tracking overhead is much reduced, and
the cost of the first readback will mainly be in the synchronisation
overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-22 15:04:22 +00:00
parent 1f2cd536bc
commit f68a99a55e
1 changed files with 12 additions and 0 deletions

View File

@ -1347,6 +1347,18 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap)
assert(list_is_empty(&priv->list));
return NULL;
}
if (priv->cpu_damage == NULL) {
/* Presume that we will only ever write to the GPU
* bo. Readbacks are expensive but fairly constant
* in cost for all sizes i.e. it is the act of
* synchronisation that takes the most time. This is
* mitigated by avoiding fallbacks in the first place.
*/
sna_damage_all(&priv->gpu_damage,
pixmap->drawable.width,
pixmap->drawable.height);
}
}
if (priv->cpu_damage == NULL)