diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-30 09:16:00 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-31 15:36:17 +0000 |
commit | e82b3d8069629ae5776e039d6ea1f3c901a3a094 (patch) | |
tree | 2f06a36af8a02a835deea2907a7c473c23a12296 | |
parent | 72624b0b5ba6549cb8d96f992d2656a28ec6078c (diff) |
sna: Defer the initial source upload if the GPU bo will be untiled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_render.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index e7c3df44..aa9c160d 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -317,7 +317,12 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) if (w == pixmap->drawable.width && h == pixmap->drawable.height) { bool upload = true; - if (pixmap->devKind * pixmap->drawable.height <= 4096) { + if (pixmap->devKind * pixmap->drawable.height <= 4096 || + kgem_choose_tiling(&to_sna_from_pixmap(pixmap)->kgem, + I915_TILING_X, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->drawable.bitsPerPixel) == I915_TILING_NONE) { priv = sna_pixmap(pixmap); upload = priv && priv->source_count++ > SOURCE_BIAS; } @@ -339,6 +344,12 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) if (priv) count = priv->source_count++; + if (kgem_choose_tiling(&to_sna_from_pixmap(pixmap)->kgem, I915_TILING_X, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->drawable.bitsPerPixel) == I915_TILING_NONE) + count -= SOURCE_BIAS; + DBG(("%s: migrate box (%d, %d), (%d, %d)? source count=%d, fraction=%d/%d [%d]\n", __FUNCTION__, box->x1, box->y1, box->x2, box->y2, |