summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-08 00:20:11 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-08 01:08:47 +0000
commite52f0204939924181480feec6d1511259169c8f1 (patch)
tree7748a9b2f6df5afa2a0b1bf98721588f7ffe4bef
parentc05e90aa99c093431a74a94ceba27d7dce49d05b (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c4
1 files changed, 4 insertions, 0 deletions
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;