sna: Check the composite-rectangles will be on the GPU before forcibly attaching

If we think that the operation is better performed on the CPU, avoid the
overhead of manipulating our privates.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-05 10:27:37 +00:00
parent 6ffd360564
commit 5ddae8bf21
1 changed files with 5 additions and 5 deletions

View File

@ -735,6 +735,11 @@ sna_composite_rectangles(CARD8 op,
boxes = pixman_region_rectangles(&region, &num_boxes);
if (too_small(dst->pDrawable)) {
DBG(("%s: fallback, dst is too small\n", __FUNCTION__));
goto fallback;
}
/* If we going to be overwriting any CPU damage with a subsequent
* operation, then we may as well delete it without moving it
* first to the GPU.
@ -745,11 +750,6 @@ sna_composite_rectangles(CARD8 op,
sna_damage_subtract(&priv->cpu_damage, &region);
}
if (too_small(dst->pDrawable)) {
DBG(("%s: fallback, dst is too small\n", __FUNCTION__));
goto fallback;
}
priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_WRITE);
if (priv == NULL) {
DBG(("%s: fallback due to no GPU bo\n", __FUNCTION__));