From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Zanoni, Paulo R" <paulo.r.zanoni@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"Runyan, Arthur J" <arthur.j.runyan@intel.com>
Subject: Re: [PATCH 2/4] drm/i915: restrict unclaimed register checking
Date: Fri, 4 Sep 2015 16:54:25 +0300 [thread overview]
Message-ID: <20150904135425.GO29811@intel.com> (raw)
In-Reply-To: <1441373885.5282.3.camel@intel.com>
On Fri, Sep 04, 2015 at 01:38:07PM +0000, Zanoni, Paulo R wrote:
> 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 .
The "RM" in the name already suggest to me that it's just related to
display regiters.
That's also how the VLV/CHV unclaimed register detection more or less
works. IIRC I did a similar experiment on VLV/CHV and found a few
different ranges where it triggers, but I don't think I did it quite
as thoroughly as your test application. I suppose I should do that
and then dig up my old VLV/CHV patch and rebase it on top of whatever
is the new way of doing things.
>
> >
> > -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
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-09-04 13:54 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
2015-09-04 13:54 ` Ville Syrjälä [this message]
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=20150904135425.GO29811@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=arthur.j.runyan@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