From 721cf30e9eeb0102c77f337332ad8259463b7fef Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 11 Oct 2011 13:28:45 +0100 Subject: [PATCH] sna/accel: If the data is already on the GPU, use it for the source Fixes regression from 1ec6a0e2775 (sna: Move the source to the GPU if it is reused). Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 1edd3a3c..dab396e6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1143,12 +1143,15 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth, RegionUninit(®ion); } -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; }