public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Zanoni, Paulo R" <paulo.r.zanoni@intel.com>
To: "mika.kuoppala@linux.intel.com" <mika.kuoppala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Runyan, Arthur J" <arthur.j.runyan@intel.com>
Subject: Re: [PATCH 2/4] drm/i915: restrict unclaimed register	checking
Date: Fri, 4 Sep 2015 13:38:07 +0000	[thread overview]
Message-ID: <1441373885.5282.3.camel@intel.com> (raw)
In-Reply-To: <87io7qad5d.fsf@gaia.fi.intel.com>

Em Sex, 2015-09-04 às 09:53 +0300, Mika Kuoppala escreveu:
> 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?

The range is a conclusion after a discussion I had with Arthur (CCd) a
few months ago. Unfortunately I can't find the emails in my archive
here, so maybe he can comment.

But basically what I did was: put the machine in runtime suspend, open
debugfs/i915_forcewake_user (because if we don't grab forcewake we will
freeze the machine when reading some regs), then run this: 
http://people.freedesktop.org/~pzanoni/fpga_dbg_range.c .

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

  reply	other threads:[~2015-09-04 13:38 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
2015-09-04 13:38     ` Zanoni, Paulo R [this message]
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=1441373885.5282.3.camel@intel.com \
    --to=paulo.r.zanoni@intel.com \
    --cc=arthur.j.runyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@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