sna/accel: If the data is already on the GPU, use it for the source

Fixes regression from 1ec6a0e277 (sna: Move the source to the GPU
if it is reused).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-10-11 13:28:45 +01:00
parent 15a4410cec
commit 721cf30e9e
1 changed files with 4 additions and 1 deletions

View File

@ -1143,12 +1143,15 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth,
RegionUninit(&region);
}
static Bool
static bool
move_to_gpu(PixmapPtr pixmap, struct sna_pixmap *priv, const BoxRec *box)
{
int w = box->x2 - box->x1;
int h = box->y2 - box->y1;
if (priv->gpu_bo)
return TRUE;
return ++priv->source_count * w*h >= 2 * pixmap->drawable.width * pixmap->drawable.height;
}