diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-20 19:38:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-20 22:00:54 +0100 |
commit | c52d265b83b033fb2a275fcc9a8a8d146e3afdf6 (patch) | |
tree | 76d44acc512b9515a4c6f6f92a3b3c7fff19dbef | |
parent | f92a64dd9162731210b14368b6ee408356d7fefc (diff) |
sna: Tweak CPU bo promotion rules for CopyArea
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 19 |
1 files 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; } } |