From f837b9bcc7d384aeb37c2e9ebdac95571deaedc6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 20 Dec 2011 20:06:25 +0000 Subject: [PATCH] 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 --- src/sna/sna_render.c | 7 ++++--- 1 file 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,