From e52f0204939924181480feec6d1511259169c8f1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 8 Jan 2012 00:20:11 +0000 Subject: sna: Do not move-to-gpu for sna_copy_boxes if we have a cpu bo We trade-off the extra copy in the hope that as we haven't used the GPU bo before then, we won't need it again. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 5bf13951..f7ed3cd0 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2429,6 +2429,10 @@ move_to_gpu(PixmapPtr pixmap, struct sna_pixmap *priv, if (priv->gpu_bo) return TRUE; + if (priv->cpu_bo) + return (priv->source_count++-SOURCE_BIAS) * w*h >= + (int)pixmap->drawable.width * pixmap->drawable.height; + if (alu != GXcopy) return TRUE; -- cgit v1.2.3