public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Paulo Zanoni <paulo.r.zanoni@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: restrict unclaimed register	checking
Date: Fri, 04 Sep 2015 09:53:34 +0300	[thread overview]
Message-ID: <87io7qad5d.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1441309905-2744-3-git-send-email-paulo.r.zanoni@intel.com>

Paulo Zanoni <paulo.r.zanoni@intel.com> writes:

> The unclaimed register bit is only triggered when someone touches the
> specified register range.
>

I got the impression that we get the unclaimed access also
for other ranges, if they are powered down during access?

-Mika

> For the normal use case (with i915.mmio_debug=0), this commit will
> avoid the extra __raw_i915_read32() call for every register outside
> the specified range, at the expense of a few additional "if"
> statements.
>
> v2: Put the register range checking earlier (Chris).
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 10c61a6..65e0ea8 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -595,6 +595,8 @@ void assert_forcewakes_inactive(struct drm_i915_private *dev_priv)
>  	 !FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET(reg) && \
>  	 !FORCEWAKE_GEN9_COMMON_RANGE_OFFSET(reg))
>  
> +#define UNCLAIMED_CHECK_RANGE(reg) REG_RANGE(reg, 0x40000, 0xC0000)
> +
>  static void
>  ilk_dummy_write(struct drm_i915_private *dev_priv)
>  {
> @@ -611,6 +613,9 @@ hsw_unclaimed_reg_debug(struct drm_i915_private *dev_priv, u32 reg, bool read,
>  	const char *op = read ? "reading" : "writing to";
>  	const char *when = before ? "before" : "after";
>  
> +	if (!UNCLAIMED_CHECK_RANGE(reg))
> +		return;
> +
>  	if (!i915.mmio_debug)
>  		return;
>  
> @@ -623,10 +628,13 @@ hsw_unclaimed_reg_debug(struct drm_i915_private *dev_priv, u32 reg, bool read,
>  }
>  
>  static void
> -hsw_unclaimed_reg_detect(struct drm_i915_private *dev_priv)
> +hsw_unclaimed_reg_detect(struct drm_i915_private *dev_priv, u32 reg)
>  {
>  	static bool mmio_debug_once = true;
>  
> +	if (!UNCLAIMED_CHECK_RANGE(reg))
> +		return;
> +
>  	if (i915.mmio_debug || !mmio_debug_once)
>  		return;
>  
> @@ -892,7 +900,7 @@ hsw_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace)
>  		gen6_gt_check_fifodbg(dev_priv); \
>  	} \
>  	hsw_unclaimed_reg_debug(dev_priv, reg, false, false); \
> -	hsw_unclaimed_reg_detect(dev_priv); \
> +	hsw_unclaimed_reg_detect(dev_priv, reg); \
>  	GEN6_WRITE_FOOTER; \
>  }
>  
> @@ -934,7 +942,7 @@ gen8_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace
>  		__force_wake_get(dev_priv, FORCEWAKE_RENDER); \
>  	__raw_i915_write##x(dev_priv, reg, val); \
>  	hsw_unclaimed_reg_debug(dev_priv, reg, false, false); \
> -	hsw_unclaimed_reg_detect(dev_priv); \
> +	hsw_unclaimed_reg_detect(dev_priv, reg); \
>  	GEN6_WRITE_FOOTER; \
>  }
>  
> @@ -1000,7 +1008,7 @@ gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \
>  		__force_wake_get(dev_priv, fw_engine); \
>  	__raw_i915_write##x(dev_priv, reg, val); \
>  	hsw_unclaimed_reg_debug(dev_priv, reg, false, false); \
> -	hsw_unclaimed_reg_detect(dev_priv); \
> +	hsw_unclaimed_reg_detect(dev_priv, reg); \
>  	GEN6_WRITE_FOOTER; \
>  }
>  
> -- 
> 2.5.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-09-04  6:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 19:51 [PATCH 0/4] Unclaimed register improvements Paulo Zanoni
2015-09-03 19:51 ` [PATCH 1/4] drm/i915: make unclaimed registers be errors again Paulo Zanoni
2015-09-03 19:51 ` [PATCH 2/4] drm/i915: restrict unclaimed register checking Paulo Zanoni
2015-09-04  6:53   ` Mika Kuoppala [this message]
2015-09-04 13:38     ` Zanoni, Paulo R
2015-09-04 13:54       ` Ville Syrjälä
2015-09-03 19:51 ` [PATCH 3/4] drm/i915: remove intel_uncore_check_errors() Paulo Zanoni
2015-09-04 11:47   ` Mika Kuoppala
2015-09-03 19:51 ` [PATCH 4/4] drm/i915: Reduce frequency of unspecific HSW reg debugging Paulo Zanoni
2015-09-04  7:02   ` Mika Kuoppala
2015-09-04 13:39     ` Zanoni, Paulo R
2015-09-04  8:27   ` Daniel Vetter
2015-09-04  8:40     ` Mika Kuoppala
2015-09-04  8:59       ` Daniel Vetter
2015-09-04 11:45         ` Mika Kuoppala
2015-09-04 12:18           ` Mika Kuoppala
2015-09-04 14:53             ` Daniel Vetter
2015-09-04 15:16               ` Ville Syrjälä
2015-09-04 15:20                 ` Ville Syrjälä
2015-09-04 15:23                 ` Daniel Vetter
2015-09-04 13:46       ` Zanoni, Paulo R
2015-09-04 13:57         ` Mika Kuoppala
2015-09-04 14:08           ` Paulo Zanoni

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=87io7qad5d.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@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