From patchwork Fri Aug 8 09:54:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: arun.siluvery@linux.intel.com X-Patchwork-Id: 4694881 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC9729F377 for ; Fri, 8 Aug 2014 09:55:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5C97201C0 for ; Fri, 8 Aug 2014 09:55:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DB36120173 for ; Fri, 8 Aug 2014 09:55:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64B9A6E833; Fri, 8 Aug 2014 02:55:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id B5C4E6E82F for ; Fri, 8 Aug 2014 02:55:11 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 08 Aug 2014 02:55:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,824,1400050800"; d="scan'208";a="466429185" Received: from asiluver-linux.isw.intel.com ([10.102.226.49]) by azsmga001.ch.intel.com with ESMTP; 08 Aug 2014 02:55:10 -0700 From: arun.siluvery@linux.intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Aug 2014 10:54:55 +0100 Message-Id: <1407491696-31727-2-git-send-email-arun.siluvery@linux.intel.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407491696-31727-1-git-send-email-arun.siluvery@linux.intel.com> References: <1407491696-31727-1-git-send-email-arun.siluvery@linux.intel.com> Subject: [Intel-gfx] [RFC 1/2] tools/null_state_render: Add BDW workarounds to golden render state X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Arun Siluvery Some workaround registers are part of register state context and they are restored with every context switch so initializing them in golden render state ensures that they are applied even when we start with an uninitialized context or during hw initialization followed by a reset. Signed-off-by: Arun Siluvery --- lib/intel_reg.h | 22 ++++++++++++++++ tools/null_state_gen/intel_renderstate_gen8.c | 37 +++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/lib/intel_reg.h b/lib/intel_reg.h index 4afec45..86175bb 100644 --- a/lib/intel_reg.h +++ b/lib/intel_reg.h @@ -3606,4 +3606,26 @@ typedef enum { #define GEN7_ROW_CHICKEN2_GT2 0xf4f4 #define DOP_CLOCK_GATING_DISABLE (1<<0) +#define HALF_SLICE_CHICKEN3 0xe184 +#define GEN8_CENTROID_PIXEL_OPT_DIS (1<<8) +#define GEN8_SAMPLER_POWER_BYPASS_DIS (1<<1) + +#define GEN7_HALF_SLICE_CHICKEN1 0xe100 +#define GEN7_SINGLE_SUBSCAN_DISPATCH_ENABLE (1<<10) + +#define COMMON_SLICE_CHICKEN2 0x7014 +# define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE (1<<0) + +/* GEN8 chicken */ +#define HDC_CHICKEN0 0x7300 +#define HDC_FORCE_NON_COHERENT (1<<4) + +#define GEN7_CACHE_MODE_1 0x7004 /* IVB+ */ +#define GEN8_4x4_STC_OPTIMIZATION_DISABLE (1<<6) + +#define GEN7_GT_MODE 0x7008 +#define GEN6_WIZ_HASHING(hi, lo) (((hi) << 9) | ((lo) << 7)) +#define GEN6_WIZ_HASHING_16x4 GEN6_WIZ_HASHING(1, 0) +#define GEN6_WIZ_HASHING_MASK (GEN6_WIZ_HASHING(1, 1) << 16) + #endif /* _I810_REG_H */ diff --git a/tools/null_state_gen/intel_renderstate_gen8.c b/tools/null_state_gen/intel_renderstate_gen8.c index 14690d2..a8143db 100644 --- a/tools/null_state_gen/intel_renderstate_gen8.c +++ b/tools/null_state_gen/intel_renderstate_gen8.c @@ -703,6 +703,43 @@ static void gen8_emit_workarounds(struct intel_batchbuffer *batch) /* WaDisableDopClockGating:bdw May not be needed for production */ gen8_emit_write(batch, GEN7_ROW_CHICKEN2, _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE)); + + /* + * This GEN8_CENTROID_PIXEL_OPT_DIS W/A is only needed for + * pre-production hardware + */ + gen8_emit_write(batch, HALF_SLICE_CHICKEN3, + _MASKED_BIT_ENABLE(GEN8_CENTROID_PIXEL_OPT_DIS + | GEN8_SAMPLER_POWER_BYPASS_DIS)); + + gen8_emit_write(batch, GEN7_HALF_SLICE_CHICKEN1, + _MASKED_BIT_ENABLE(GEN7_SINGLE_SUBSCAN_DISPATCH_ENABLE)); + + gen8_emit_write(batch, COMMON_SLICE_CHICKEN2, + _MASKED_BIT_ENABLE(GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE)); + + /* Use Force Non-Coherent whenever executing a 3D context. This is a + * workaround for for a possible hang in the unlikely event a TLB + * invalidation occurs during a PSD flush. + */ + gen8_emit_write(batch, HDC_CHICKEN0, + _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT)); + + /* Wa4x4STCOptimizationDisable:bdw */ + gen8_emit_write(batch, GEN7_CACHE_MODE_1, + _MASKED_BIT_ENABLE(GEN8_4x4_STC_OPTIMIZATION_DISABLE)); + + /* + * BSpec recommends 8x4 when MSAA is used, + * however in practice 16x4 seems fastest. + * + * Note that PS/WM thread counts depend on the WIZ hashing + * disable bit, which we don't touch here, but it's good + * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM). + */ + gen8_emit_write(batch, GEN7_GT_MODE, + GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4); + } int gen8_setup_null_render_state(struct intel_batchbuffer *batch)