From patchwork Wed Nov 19 13:10:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 5337231 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3B228C11AC for ; Wed, 19 Nov 2014 13:06:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AFA7201E4 for ; Wed, 19 Nov 2014 13:06:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4B5A8201CD for ; Wed, 19 Nov 2014 13:06:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B0A316EE13; Wed, 19 Nov 2014 05:06:51 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 87BED6EE13 for ; Wed, 19 Nov 2014 05:06:50 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 19 Nov 2014 05:06:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,416,1413270000"; d="scan'208";a="634488878" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.83]) by fmsmga002.fm.intel.com with ESMTP; 19 Nov 2014 05:06:49 -0800 Received: by rosetta (Postfix, from userid 1000) id 43D1F80052; Wed, 19 Nov 2014 15:10:08 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 19 Nov 2014 15:10:05 +0200 Message-Id: <1416402605-6257-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH] sna/kgem: Gen8 blt broken when dest base offset has bit 4 set X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With bit 4 set in destination base address, the Gen8 blitter fails and blits errorneously into area before destination (dest - 16 bytes), corrupting memory. Broken hw is suspect. v2: Update the destination base offset pattern as revealed by igt/tests/gem_userptr_blits/destination-bo-align Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79053 Cc: Chris Wilson Tested-by: xunx.fang@intel.com 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) {