public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chia-I Wu <olvaffe@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: enable HiZ Raw Stall Optimization
Date: Mon, 27 Jan 2014 15:07:45 +0200	[thread overview]
Message-ID: <20140127130745.GR9454@intel.com> (raw)
In-Reply-To: <1390810716-13510-1-git-send-email-olvaffe@gmail.com>

On Mon, Jan 27, 2014 at 04:18:36PM +0800, Chia-I Wu wrote:
> From: Chia-I Wu <olv@lunarg.com>
> 
> The optimization is available on Ivy Bridge and later, and is disabled by
> default.  Enabling it helps certain workloads such as GLBenchmark TRex test.

Actually BSpec even goes as far as saying that this optimization must
be enabled on HSW+.

So it seems you should enable it for BDW as well. I'm not sure about VLV.
The description of the bit says nothing about VLV, even though the
documented default value is specified to have it set for VLV as well. I
guess someone should just try it and see what happens.

Might make sense to split the patch into per-platforms patches. That way
we could more easily revert eg. just the IVB part if it causes problems.

> 
> Signed-off-by: Chia-I Wu <olv@lunarg.com>
> Cc: Ian Romanick <ian.d.romanick@intel.com>
> Cc: Chad Versace <chad.versace@linux.intel.com>
> 
> ---
>  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);

These hunks are material for a separate patch.

>  
> 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));
> -- 
> 1.8.5.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

  parent reply	other threads:[~2014-01-27 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27  8:18 [PATCH] drm/i915: enable HiZ Raw Stall Optimization Chia-I Wu
2014-01-27  8:33 ` Chia-I Wu
2014-01-27  9:04   ` Daniel Vetter
2014-01-27 13:07 ` Ville Syrjälä [this message]
2014-01-27 16:22   ` Daniel Vetter
2014-01-28  4:40   ` Chia-I Wu
2014-01-28  5:29 ` [PATCH 1/2] drm/i915: enable HiZ Raw Stall Optimization on HSW Chia-I Wu
2014-01-28  5:29   ` [PATCH 2/2] drm/i915: enable HiZ Raw Stall Optimization on IVB Chia-I Wu
2014-01-29 17:56   ` [PATCH 1/2] drm/i915: enable HiZ Raw Stall Optimization on HSW Daniel Vetter
2014-01-30  2:23     ` Matt Turner
2014-01-30 12:10       ` Daniel Vetter
2014-01-30 12:40         ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140127130745.GR9454@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=olvaffe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox