From patchwork Mon Jan 27 08:18:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chia-I Wu X-Patchwork-Id: 3541491 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 6CA89C02DC for ; Mon, 27 Jan 2014 08:18:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9925320123 for ; Mon, 27 Jan 2014 08:18:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2333920122 for ; Mon, 27 Jan 2014 08:18:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0CA6FC0DF; Mon, 27 Jan 2014 00:18:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A363FC0DF for ; Mon, 27 Jan 2014 00:18:47 -0800 (PST) Received: by mail-ie0-f177.google.com with SMTP id at1so5214509iec.8 for ; Mon, 27 Jan 2014 00:18:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=EtlKgzgnCDPqzQorcH5QMcoDcYrwUQdhK2NN9myiumc=; b=cjlBduo6SDLStGoB4lpFzuOIJfNSYRLNShl7ioZYENsZZeNQfihCV15bcdTP2UFgEW EGkHQgeKiYcfRXXTHAZidC6EXjlIrJDgw3pKBP6sLVAeveq6AuevprfOLIgAQvlfKCG5 /os3k1bmkLbd3Y2mCIgF8JzV7uuf1OtGMva/5td/AVBVc/VUV9mD6q9a3iJdvHTa/lto zmC3vEvcvV6wmgVXp4McJwP/k03ta1hiUTYSFJw2clY6tSHppCouyh42d+FNtVpc2BPs 240RW3XY+mo3GPFeq47hGVU9EZQlOC9KAiQgcMsTWv7K5Q1Rqr8gTayXnJjOqsGuI8ya f39g== X-Received: by 10.43.0.202 with SMTP id nn10mr98662icb.54.1390810726555; Mon, 27 Jan 2014 00:18:46 -0800 (PST) Received: from holycrap.mydomain (122-116-175-74.HINET-IP.hinet.net. [122.116.175.74]) by mx.google.com with ESMTPSA id d18sm42178913igz.0.2014.01.27.00.18.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jan 2014 00:18:45 -0800 (PST) From: Chia-I Wu To: intel-gfx@lists.freedesktop.org Date: Mon, 27 Jan 2014 16:18:36 +0800 Message-Id: <1390810716-13510-1-git-send-email-olvaffe@gmail.com> X-Mailer: git-send-email 1.8.5.3 Subject: [Intel-gfx] [PATCH] drm/i915: enable HiZ Raw Stall Optimization X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Chia-I Wu The optimization is available on Ivy Bridge and later, and is disabled by default. Enabling it helps certain workloads such as GLBenchmark TRex test. Signed-off-by: Chia-I Wu Cc: Ian Romanick Cc: Chad Versace --- drivers/gpu/drm/i915/i915_reg.h | 2 ++ drivers/gpu/drm/i915/i915_suspend.c | 9 +++++++-- drivers/gpu/drm/i915/intel_pm.c | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index ee27421..bd90ef3 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -930,6 +930,8 @@ #define ECO_GATING_CX_ONLY (1<<3) #define ECO_FLIP_DONE (1<<0) +#define CACHE_MODE_0_GEN7 0x7000 /* IVB+ */ +#define HIZ_RAW_STALL_OPT_DISABLE (1<<2) #define CACHE_MODE_1 0x7004 /* IVB+ */ #define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1<<6) diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 98790c7..13fefbd 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -398,7 +398,9 @@ int i915_save_state(struct drm_device *dev) intel_disable_gt_powersave(dev); /* Cache mode state */ - if (INTEL_INFO(dev)->gen < 7) + if (INTEL_INFO(dev)->gen >= 7) + dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0_GEN7); + else dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); /* Memory Arbitration state */ @@ -448,7 +450,10 @@ int i915_restore_state(struct drm_device *dev) } /* Cache mode state */ - if (INTEL_INFO(dev)->gen < 7) + if (INTEL_INFO(dev)->gen >= 7) + I915_WRITE(CACHE_MODE_0_GEN7, dev_priv->regfile.saveCACHE_MODE_0 | + 0xffff0000); + else I915_WRITE(CACHE_MODE_0, dev_priv->regfile.saveCACHE_MODE_0 | 0xffff0000); diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 26c29c1..d6ddc39 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -5355,6 +5355,10 @@ static void haswell_init_clock_gating(struct drm_device *dev) /* WaVSRefCountFullforceMissDisable:hsw */ gen7_setup_fixed_func_scheduler(dev_priv); + /* enable HiZ Raw Stall Optimization */ + I915_WRITE(CACHE_MODE_0_GEN7, + _MASKED_BIT_DISABLE(HIZ_RAW_STALL_OPT_DISABLE)); + /* WaDisable4x2SubspanOptimization:hsw */ I915_WRITE(CACHE_MODE_1, _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE)); @@ -5445,6 +5449,10 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) /* WaVSRefCountFullforceMissDisable:ivb */ gen7_setup_fixed_func_scheduler(dev_priv); + /* enable HiZ Raw Stall Optimization */ + I915_WRITE(CACHE_MODE_0_GEN7, + _MASKED_BIT_DISABLE(HIZ_RAW_STALL_OPT_DISABLE)); + /* WaDisable4x2SubspanOptimization:ivb */ I915_WRITE(CACHE_MODE_1, _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));