From a90cc3b3889fafbd91c11c42d068a9d6474e218b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 18 Nov 2014 08:37:25 +0000 Subject: [PATCH] sna: Tweak alignment constraints on gen8 to allow BLT The previous commits prevent us from using the BLT if the destination address is misaligned. Honour that restriction when creating buffers as well, so that they are always usuable by the BLT. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index fe225d2d..72ffb049 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1797,6 +1797,8 @@ inline static uint32_t kgem_pitch_alignment(struct kgem *kgem, unsigned flags) return 256; if (flags & CREATE_SCANOUT) return 64; + if (kgem->gen >= 0100) + return 32; return 8; } @@ -7234,7 +7236,7 @@ struct kgem_bo *kgem_create_buffer_2d(struct kgem *kgem, assert(width > 0 && height > 0); assert(ret != NULL); stride = ALIGN(width, 2) * bpp >> 3; - stride = ALIGN(stride, 4); + stride = ALIGN(stride, kgem->gen >= 0100 ? 32 : 4); DBG(("%s: %dx%d, %d bpp, stride=%d\n", __FUNCTION__, width, height, bpp, stride));