sna: Tweak CPU bo promotion rules for CopyArea

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-07-20 19:38:38 +01:00
parent f92a64dd91
commit c52d265b83
1 changed files with 12 additions and 7 deletions

View File

@ -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;
}
}