summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-30 11:38:36 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-30 12:05:48 +0000
commit488937edb67a60389380b405f8f8a548f51e64c7 (patch)
tree2ba2cc457a36bce192a9e459f0eaf0614bb63faa
parentca252e5b51d7b2f5a7b2c2e0d8fdb024b08096db (diff)
sna: Base prefer-gpu hint on default tiling choice
As on gen4+, tiling increases the maximum usable pitch we can accommodate wider pixmaps on the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 7019638a..64f729ba 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2211,6 +2211,10 @@ bool kgem_can_create_cpu(struct kgem *kgem,
size = kgem_surface_size(kgem, false, false,
width, height, bpp,
I915_TILING_NONE, &pitch);
+ DBG(("%s? %d, cpu size %d, max %d\n",
+ __FUNCTION__,
+ size > 0 && size <= kgem->max_cpu_size,
+ size, kgem->max_cpu_size));
return size > 0 && size <= kgem->max_cpu_size;
}
@@ -2223,8 +2227,15 @@ static bool _kgem_can_create_gpu(struct kgem *kgem,
return false;
size = kgem_surface_size(kgem, false, false,
- width, height, bpp, I915_TILING_NONE,
+ width, height, bpp,
+ kgem_choose_tiling(kgem,
+ I915_TILING_X,
+ width, height, bpp),
&pitch);
+ DBG(("%s? %d, gpu size %d, max %d\n",
+ __FUNCTION__,
+ size > 0 && size < kgem->max_gpu_size,
+ size, kgem->max_gpu_size));
return size > 0 && size < kgem->max_gpu_size;
}