summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-22 11:17:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-02 08:32:11 +0100
commit0fbe8995d51b4643f1cf06c07da8b4b5ac5ae7c3 (patch)
treeec287c30e46507e4596e2d60696973c8ddcae18f /src/sna
parent67b37332bd45dd4cea297107bfdc9df21984fdcd (diff)
sna: Relax tiling height restrictions
Only force the even-tile-row alignment if we have an old GPU with an old kernel that doesn't perform conservative alignment for us (as required). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/kgem.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 1a525572..17b5b1ac 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1584,16 +1584,16 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
if (tiling) {
if (kgem->gen < 030) {
tile_width = 128;
- tile_height = 32;
+ tile_height = 16;
} else {
tile_width = 512;
- tile_height = 16;
+ tile_height = 8;
}
} else {
tile_width = 2 * bpp >> 3;
tile_width = ALIGN(tile_width,
kgem_pitch_alignment(kgem, flags));
- tile_height = 2;
+ tile_height = 1;
}
} else switch (tiling) {
default:
@@ -1601,19 +1601,21 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
tile_width = 2 * bpp >> 3;
tile_width = ALIGN(tile_width,
kgem_pitch_alignment(kgem, flags));
- tile_height = 2;
+ tile_height = 1;
break;
- /* XXX align to an even tile row */
case I915_TILING_X:
tile_width = 512;
- tile_height = 16;
+ tile_height = 8;
break;
case I915_TILING_Y:
tile_width = 128;
- tile_height = 64;
+ tile_height = 32;
break;
}
+ /* XXX align to an even tile row */
+ if (!kgem->has_relaxed_fencing)
+ tile_height *= 2;
*pitch = ALIGN(width * bpp / 8, tile_width);
height = ALIGN(height, tile_height);
@@ -1653,7 +1655,7 @@ static uint32_t kgem_aligned_height(struct kgem *kgem,
uint32_t tile_height;
if (kgem->gen <= 030) {
- tile_height = tiling ? kgem->gen < 030 ? 32 : 16 : 1;
+ tile_height = tiling ? kgem->gen < 030 ? 16 : 8 : 1;
} else switch (tiling) {
/* XXX align to an even tile row */
default:
@@ -1661,13 +1663,17 @@ static uint32_t kgem_aligned_height(struct kgem *kgem,
tile_height = 1;
break;
case I915_TILING_X:
- tile_height = 16;
+ tile_height = 8;
break;
case I915_TILING_Y:
- tile_height = 64;
+ tile_height = 32;
break;
}
+ /* XXX align to an even tile row */
+ if (!kgem->has_relaxed_fencing)
+ tile_height *= 2;
+
return ALIGN(height, tile_height);
}