From c52d265b83b033fb2a275fcc9a8a8d146e3afdf6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 20 Jul 2012 19:38:38 +0100 Subject: sna: Tweak CPU bo promotion rules for CopyArea Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 4ef52d7e..5466f388 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3733,35 +3733,40 @@ move_to_gpu(PixmapPtr pixmap, struct sna_pixmap *priv, { int w = box->x2 - box->x1; int h = box->y2 - box->y1; + int count; if (DAMAGE_IS_ALL(priv->gpu_damage)) return true; - if (DAMAGE_IS_ALL(priv->cpu_damage)) - return false; - if (priv->gpu_bo) { if (alu != GXcopy) return true; if (!priv->cpu) return true; + + if (priv->gpu_bo->tiling) + return true; } else { if ((priv->create & KGEM_CAN_CREATE_GPU) == 0) return false; } + count = priv->source_count++; if (priv->cpu_bo) { - if (sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING) == I915_TILING_NONE) + if (priv->cpu_bo->flush && count > SOURCE_BIAS) + return true; + + if (sna_pixmap_choose_tiling(pixmap, + DEFAULT_TILING) == I915_TILING_NONE) return false; if (priv->cpu) return false; - return (priv->source_count++-SOURCE_BIAS) * w*h >= - (int)pixmap->drawable.width * pixmap->drawable.height; + return count > SOURCE_BIAS; } else { - return ++priv->source_count * w*h >= (SOURCE_BIAS+2) * (int)pixmap->drawable.width * pixmap->drawable.height; + return count * w*h >= (SOURCE_BIAS+2) * (int)pixmap->drawable.width * pixmap->drawable.height; } } -- cgit v1.2.3