summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-04 13:01:10 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-04 13:55:26 +0000
commitb424b10e771b1d3d041efdd2b77f576251364744 (patch)
tree334406948c3e846756f07c0cf9410129a4fa7229
parent46c7df803881fa0e733c0d0fdd37567ebdccd6ac (diff)
sna: use tight pitches for a8
As we never use these with a depth nor attach them to scanout, we can safely relax the multiple-of-64 byte pitch restriction. In the unlikely event that we do need A8 surfaces with depthbuffers, this is broken... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index ef0b9d08..efe1c352 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -448,13 +448,13 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
tile_width = 512;
tile_height = 16;
} else {
- tile_width = 64;
+ tile_width = bpp > 8 ? 64 : 4;
tile_height = 2;
}
} else switch (tiling) {
default:
case I915_TILING_NONE:
- tile_width = 64;
+ tile_width = bpp > 8 ? 64 : 4;
tile_height = 2;
break;
case I915_TILING_X:
@@ -1516,7 +1516,7 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
if (flags & CREATE_INACTIVE)
goto skip_active_search;
- untiled_pitch = ALIGN(width * bpp / 8, 64);
+ untiled_pitch = ALIGN(width * bpp / 8, bpp > 8 ? 64 : 4);
for (i = 0; i <= I915_TILING_Y; i++)
tiled_height[i] = kgem_aligned_height(kgem, height, i);