public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/i915: Add NEEDS_FORCEWAKE() checks for vlv/chv
Date: Thu, 22 Oct 2015 15:44:24 +0200	[thread overview]
Message-ID: <20151022134424.GC16848@phenom.ffwll.local> (raw)
In-Reply-To: <1445517300-28173-6-git-send-email-ville.syrjala@linux.intel.com>

On Thu, Oct 22, 2015 at 03:35:00PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Include an early NEEDS_FORCEWAKE() check for vlv and chv.
> Hopefully that will avoid doing so many range checks in for many
> register accesses (at least for all display registers).
> 
> Note that vlv already had the check in the write path since it shares
> the gen6+ code for that.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

I double-checked that all ranges are below the NEEDS_FORCEWAKE limit.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index f38e88b..f0f97b2 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -726,7 +726,9 @@ static u##x \
>  vlv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \
>  	enum forcewake_domains fw_engine = 0; \
>  	GEN6_READ_HEADER(x); \
> -	if (FORCEWAKE_VLV_RENDER_RANGE_OFFSET(reg)) \
> +	if (!NEEDS_FORCE_WAKE(reg)) \
> +		fw_engine = 0; \
> +	else if (FORCEWAKE_VLV_RENDER_RANGE_OFFSET(reg)) \
>  		fw_engine = FORCEWAKE_RENDER; \
>  	else if (FORCEWAKE_VLV_MEDIA_RANGE_OFFSET(reg)) \
>  		fw_engine = FORCEWAKE_MEDIA; \
> @@ -741,7 +743,9 @@ static u##x \
>  chv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \
>  	enum forcewake_domains fw_engine = 0; \
>  	GEN6_READ_HEADER(x); \
> -	if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \
> +	if (!NEEDS_FORCE_WAKE(reg)) \
> +		fw_engine = 0; \
> +	else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \
>  		fw_engine = FORCEWAKE_RENDER; \
>  	else if (FORCEWAKE_CHV_MEDIA_RANGE_OFFSET(reg)) \
>  		fw_engine = FORCEWAKE_MEDIA; \
> @@ -935,7 +939,8 @@ static void \
>  chv_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \
>  	enum forcewake_domains fw_engine = 0; \
>  	GEN6_WRITE_HEADER; \
> -	if (is_gen8_shadowed(dev_priv, reg)) \
> +	if (!NEEDS_FORCE_WAKE(reg) || \
> +	    is_gen8_shadowed(dev_priv, reg)) \
>  		fw_engine = 0; \
>  	else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(reg)) \
>  		fw_engine = FORCEWAKE_RENDER; \
> -- 
> 2.4.9
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-10-22 13:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 12:34 [PATCH 0/5] drm/i915: Expose __raw_i915_read() & co. to the outside, and a few forcewake things ville.syrjala
2015-10-22 12:34 ` [PATCH 1/5] drm/i915: Turn __raw_i915_read8() & co. in to inline functions ville.syrjala
2015-10-22 13:32   ` Daniel Vetter
2015-10-22 13:49     ` Ville Syrjälä
2015-10-22 12:34 ` [PATCH 2/5] drm/i915: Read FORCEWAKE registers with I915_READ_FW() ville.syrjala
2015-10-22 13:37   ` Daniel Vetter
2015-10-22 13:50     ` Ville Syrjälä
2015-10-22 12:34 ` [PATCH 3/5] drm/i915: Minor style nits in intel_uncore.c ville.syrjala
2015-10-22 13:38   ` Daniel Vetter
2015-10-22 12:34 ` [PATCH 4/5] drm/i915: Respin vlv/chv reagister access to look more like SKL ville.syrjala
2015-10-22 13:42   ` Daniel Vetter
2015-10-22 12:35 ` [PATCH 5/5] drm/i915: Add NEEDS_FORCEWAKE() checks for vlv/chv ville.syrjala
2015-10-22 13:44   ` Daniel Vetter [this message]
2015-10-22 13:41 ` [PATCH 0/5] drm/i915: Expose __raw_i915_read() & co. to the outside, and a few forcewake things Chris Wilson
2015-10-26 14:46   ` 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=20151022134424.GC16848@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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