summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-05 21:37:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-05 21:05:08 +0100
commitf749ed618e21b56a36a2feb9b4333ec797ec2ae5 (patch)
treef9b4493f5b471de9e5a88ed2201e20fe9e6598ae
parentb9de6a98d33db660ffad3f186c2b0ab2aea71ac0 (diff)
sna: Reduce tiling if pitch is less than a tile_width/height only on pre-G33
(Note this only applies to 2D pixmaps.) The rationale, borne out by experimentation with cairo-perf-trace, is that on the pre-G33 devices we always need a fence region region for tiled surfaces, i.e. at least .5/1MiB in size, and that combined with the smaller GTT on those devices, we loose the benefit of tiling to the excessive GTT thrashing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 9509dbe3..87acb49b 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1172,26 +1172,32 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
return -tiling;
}
- if (tiling == I915_TILING_Y && height < 16) {
- DBG(("%s: too short [%d] for TILING_Y\n",
- __FUNCTION__,height));
- tiling = I915_TILING_X;
- }
- if (tiling == I915_TILING_X && height < 4) {
- DBG(("%s: too short [%d] for TILING_X\n",
- __FUNCTION__, height));
- tiling = I915_TILING_NONE;
- }
+ /* Before the G33, we only have a small GTT to play with and tiled
+ * surfaces always require full fence regions and so cause excessive
+ * aperture thrashing.
+ */
+ if (kgem->gen < 33) {
+ if (tiling == I915_TILING_Y && height < 16) {
+ DBG(("%s: too short [%d] for TILING_Y\n",
+ __FUNCTION__,height));
+ tiling = I915_TILING_X;
+ }
+ if (tiling == I915_TILING_X && height < 4) {
+ DBG(("%s: too short [%d] for TILING_X\n",
+ __FUNCTION__, height));
+ tiling = I915_TILING_NONE;
+ }
- if (tiling == I915_TILING_X && width * bpp < 512/2) {
- DBG(("%s: too thin [%d] for TILING_X\n",
- __FUNCTION__, width));
- tiling = I915_TILING_NONE;
- }
- if (tiling == I915_TILING_Y && width * bpp < 32/2) {
- DBG(("%s: too thin [%d] for TILING_Y\n",
- __FUNCTION__, width));
- tiling = I915_TILING_NONE;
+ if (tiling == I915_TILING_X && width * bpp < 8*512/2) {
+ DBG(("%s: too thin [%d] for TILING_X\n",
+ __FUNCTION__, width));
+ tiling = I915_TILING_NONE;
+ }
+ if (tiling == I915_TILING_Y && width * bpp < 8*32/2) {
+ DBG(("%s: too thin [%d] for TILING_Y\n",
+ __FUNCTION__, width));
+ tiling = I915_TILING_NONE;
+ }
}
DBG(("%s: %dx%d -> %d\n", __FUNCTION__, width, height, tiling));