summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-20 20:06:25 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-20 20:06:25 +0000
commitf837b9bcc7d384aeb37c2e9ebdac95571deaedc6 (patch)
tree9eae81d8089c4080e9a3b3a5fbddcd89a628f593
parentdfafe76a57655784c313bc2078d0b28a7ac2675b (diff)
sna/render: If the pixmap already has a GPU bo, use it for the source
The usage hint not to create a GPU bo is obviously superceded if we already have a GPU bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_render.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 40318aad..3face435 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -269,9 +269,6 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box)
return NULL;
}
- if (pixmap->usage_hint)
- goto done;
-
if (priv->gpu_bo) {
if (priv->gpu_bo != I915_TILING_NONE &&
priv->cpu_bo->pitch >= 4096) {
@@ -282,6 +279,10 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box)
} else {
int w = box->x2 - box->x1;
int h = box->y2 - box->y1;
+
+ if (pixmap->usage_hint)
+ goto done;
+
if (priv->source_count*w*h >= pixmap->drawable.width * pixmap->drawable.height &&
I915_TILING_NONE != kgem_choose_tiling(&sna->kgem, I915_TILING_X,
pixmap->drawable.width,