From 48ab72754d0069a3247c5fee8c353a6b593eaed9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 12 Jan 2012 21:07:15 +0000 Subject: sna: Use the GPU bo if it is all damaged By marking the scratch upload pixmap as damaged in both domains, we confused the texture upload path and made it upload the pixmap a second time. If either bo is all-damaged, use it! Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 9052d687..142c1aa9 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -477,13 +477,14 @@ sna_render_pixmap_bo(struct sna *sna, priv = sna_pixmap(pixmap); if (priv) { - if (priv->gpu_bo && priv->cpu_damage == NULL) { + if (priv->gpu_bo && + (DAMAGE_IS_ALL(priv->gpu_damage) || !priv->cpu_damage)) { channel->bo = kgem_bo_reference(priv->gpu_bo); return 1; } if (priv->cpu_bo && - DAMAGE_IS_ALL(priv->cpu_damage) && + (DAMAGE_IS_ALL(priv->cpu_damage) || !priv->gpu_damage) && priv->cpu_bo->pitch < 4096) { channel->bo = kgem_bo_reference(priv->cpu_bo); return 1; -- cgit v1.2.3