From 6a0f0435223a9ea4973e7b47a58a9ae138dfdf52 Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Tue, 14 Oct 2014 18:26:39 +0300 Subject: [PATCH] sna/kgem: Gen8 blt broken when dest base offset has bit 4 set Otherwise it will blt errorneously into (destination - 12) bytes, corrupting memory. v2: Update the destination base offset pattern as revealed by igt/tests/gem_userptr_blits/destination-bo-align The exact reason is unknown but broken hw is suspect. Signed-off-by: Mika Kuoppala --- src/sna/kgem.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 6adae3b..344dcea 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -551,6 +551,11 @@ static inline bool kgem_bo_blt_pitch_is_ok(struct kgem *kgem, struct kgem_bo *bo) { int pitch = bo->pitch; + + /* bdw is broken with blit dst align */ + if (kgem->gen >= 0100 && pitch & (1 << 4)) + return false; + if (kgem->gen >= 040 && bo->tiling) pitch /= 4; if (pitch > MAXSHORT) { -- 1.9.1