From f5d7e974cee28e536c86192b5c9707314cced4e5 Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Tue, 14 Oct 2014 18:26:39 +0300 Subject: [PATCH] sna/kgem: Gen8 needs blt destination aligned with 32 If the proxy offset for destination relocation is not aligned with 32, the XY_SRC_COPY_BLT fail to copy properly and will write in to the same cacheline as destination, possibly corrupting memory before it. The exact reason is unknown but broken hw is suspect. v2: do align check in more proper place (Chris Wilson) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79053 Signed-off-by: Mika Kuoppala --- src/sna/kgem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 548ea38..1104cb8 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -6100,6 +6100,10 @@ struct kgem_bo *kgem_create_map(struct kgem *kgem, first_page = (uintptr_t)ptr; last_page = first_page + size + PAGE_SIZE - 1; + /* Gen8 blt dst alignment needs to be 32, hw buggy? */ + if (kgem->gen >= 0100 && first_page & 0x1f) + return NULL; + first_page &= ~(PAGE_SIZE-1); last_page &= ~(PAGE_SIZE-1); assert(last_page > first_page); -- 1.9.1