From: Carlos Santa <carlos.santa@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
"Paneri, Praveen" <praveen.paneri@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Zhe Wang <zhe1.wang@intel.com>,
Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Subject: Re: [PATCH v2] drm/i915/bxt: Broxton decoupled MMIO
Date: Mon, 10 Oct 2016 10:03:38 -0700 [thread overview]
Message-ID: <1476119018.11124.6.camel@intel.com> (raw)
In-Reply-To: <8cbd4709-2b8c-2b33-8671-46afa45f5a99@linux.intel.com>
On Mon, 2016-09-26 at 21:23 +0100, Tvrtko Ursulin wrote:
> On 26/09/2016 12:08, Paneri, Praveen wrote:
> >
> >
> > On 9/23/2016 3:19 PM, Tvrtko Ursulin wrote:
> > >
> > >
> > > Hi,
> > >
> > > On 19/09/2016 18:15, Praveen Paneri wrote:
> > >
> [snip]
>
> >
> > >
> > >
> > > >
> > > > +
> > > > enum forcewake_domains
> > > > intel_uncore_forcewake_for_reg(struct drm_i915_private
> > > > *dev_priv,
> > > > i915_reg_t reg, unsigned int op);
> > > > @@ -2854,6 +2864,7 @@ struct drm_i915_cmd_table {
> > > > #define GT_FREQUENCY_MULTIPLIER 50
> > > > #define GEN9_FREQ_SCALER 3
> > > > +#define HAS_DECOUPLED_MMIO(dev_priv) (IS_BROXTON(dev_priv)
> > > > &&
> > > > IS_BXT_REVID(dev_priv, BXT_REVID_C0, REVID_FOREVER))
> > > There is a recent patch series from Carlos Santa which moved all
> > > these
> > > type of things to device info. So I think you have to make this
> > > compliant with that new style.
> > I looked into it. Could you suggest where can I add the check for
> > BXT
> > C0 revision?
> > Will this be okay
> > #define HAS_DECOUPLED_MMIO(dev) (INTEL_INFO(dev)-
> > >has_decoupled_mmio
> > && IS_BXT_REVID(to_i915(dev), BXT_REVID_C0, REVID_FOREVER))
> Good point. I suggest a quick chat with Carlos then to see what was
> the
> plan for situation like this one.
>
> [snip]
This looks good to me, the main point was to do some clean-up for the
legacy features already there but also to move to a single approach
(device info) when adding new features. I don't see any other way to
specifically check for that version of BXT and this MMIO feature, so
that looks good too.
Carlos
>
> >
> > >
> > >
> > > >
> > > > +
> > > > + ctrl_reg_data |= reg;
> > > > + ctrl_reg_data |= (operation << GEN9_DECOUPLED_OP_SHIFT);
> > > > + ctrl_reg_data |= (pd_engine << GEN9_DECOUPLED_PD_SHIFT);
> > > > + __raw_i915_write32(dev_priv, GEN9_DECOUPLED_REG0_DW1,
> > > > ctrl_reg_data);
> > > > +
> > > > + ctrl_reg_data |= GEN9_DECOUPLED_DW1_GO;
> > > > + __raw_i915_write32(dev_priv, GEN9_DECOUPLED_REG0_DW1,
> > > > ctrl_reg_data);
> > > > +
> > > > + if (wait_for_atomic((__raw_i915_read32(dev_priv,
> > > > + GEN9_DECOUPLED_REG0_DW1) & GEN9_DECOUPLED_DW1_GO)
> > > > == 0,
> > > > + FORCEWAKE_ACK_TIMEOUT_MS))
> > > > + DRM_ERROR("Decoupled MMIO wait timed out\n");
> > > > +
> > > Is FORCEWAKE_ACK_TIMEOUT_MS correct/relevant for decoupled MMIO?
> > > It is
> > > potentially quite a long atomic wait.
> > This is max wait time. We might not wait for that long but I can
> > still
> > check on it.
> Cool, I do think we need to know and document this in the commit
> and/or
> code comments where a brief explanation of decoupled mmio will be.
>
> >
> > >
> > >
> > > Would it be worth returning some fixed value in the case of a
> > > timeout?
> > > Might be better than random stuff? (applies in the 64-bit read
> > > case)
> > This is same as forcewake implementation. If we change it, what
> > would
> > be the appropriate fixed value to be returned?
> Another good point. In that case I suppose it doesn't matter so can
> leave it like it was. It can only theoretically affect 64-bit reads,
> yes?
>
> >
> > >
> > >
> > > >
> > > > + if (operation == GEN9_DECOUPLED_OP_READ)
> > > > + *ptr_data = __raw_i915_read32(dev_priv,
> > > > + GEN9_DECOUPLED_REG0_DW0);
> > > > +}
> > > > +
> > > > #define GEN2_READ_HEADER(x) \
> > > > u##x val = 0; \
> > > > assert_rpm_wakelock_held(dev_priv);
> > > > @@ -892,6 +928,20 @@ static inline void
> > > > __force_wake_auto(struct
> > > > drm_i915_private *dev_priv,
> > > > dev_priv->uncore.funcs.force_wake_get(dev_priv,
> > > > fw_domains);
> > > > }
> > > > +static inline bool __is_forcewake_active(struct
> > > > drm_i915_private
> > > > *dev_priv,
> > > > + enum forcewake_domains fw_domains)
> > > > +{
> > > > + struct intel_uncore_forcewake_domain *domain;
> > > > +
> > > > + /* Ideally GCC would be constant-fold and eliminate this
> > > > loop */
> > > > + for_each_fw_domain_masked(domain, fw_domains, dev_priv) {
> > > > + if (domain->wake_count)
> > > > + fw_domains &= ~domain->mask;
> > > > + }
> > > > +
> > > > + return fw_domains ? 0 : 1;
> > > > +}
> > > > +
> > > > #define __gen6_read(x) \
> > > > static u##x \
> > > > gen6_read##x(struct drm_i915_private *dev_priv, i915_reg_t
> > > > reg, bool
> > > > trace) { \
> > > > @@ -940,6 +990,37 @@ gen9_read##x(struct drm_i915_private
> > > > *dev_priv,
> > > > i915_reg_t reg, bool trace) { \
> > > > GEN6_READ_FOOTER; \
> > > > }
> > > > +#define __gen9_decoupled_read(x) \
> > > > +static u##x \
> > > > +gen9_decoupled_read##x(struct drm_i915_private *dev_priv,
> > > > i915_reg_t
> > > > reg, bool trace) { \
> > > > + enum forcewake_domains fw_engine; \
> > > fw_engines
> > >
> > > >
> > > > + GEN6_READ_HEADER(x); \
> > > > + fw_engine = __gen9_reg_read_fw_domains(offset); \
> > > > + if (fw_engine && x%32 == 0) { \
> > > > + if (__is_forcewake_active(dev_priv, fw_engine)) \
> > > > + __raw_i915_write##x(dev_priv, reg, val); \
> > > Write in the read macro, I don't understand!?
> > typo, I will fix it.
> > >
> > >
> > > Also, would a single mmio read call be possible, something like
> > > below?
> > >
> > > if (x % 32 || !fw_engines || __is_forcewake_active()) {
> > > if (fw_engines)
> > > __force_wake_auto
> > > __raw_i915_read
> > > } else {
> > > ... decoupled mmio loop ...
> > > }
> > >
> > > I might have made an oversight, no guarantees that I haven't. :)
> > Looks fine. Will test this
> Cool, the only thing which would still bug me here is the verboseness
> of
> __is_forcewake_active but I have no smart ideas for that at the
> moment.
> Perhaps keeping a bitmask of active domains in the core? Could be
> worth
> it if for nothing for elegance.
>
> Regards,
>
> Tvrtko
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-10-10 17:03 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 5:24 [PATCH] drm/i915/bxt: Broxton decoupled MMIO Praveen Paneri
2016-09-06 5:51 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-09-06 6:36 ` [PATCH] " Chris Wilson
2016-09-19 17:05 ` Praveen Paneri
2016-09-19 17:15 ` [PATCH v2] " Praveen Paneri
2016-09-23 9:49 ` Tvrtko Ursulin
2016-09-26 11:08 ` Paneri, Praveen
2016-09-26 20:23 ` Tvrtko Ursulin
2016-10-04 15:46 ` [PATCH v3] " Praveen Paneri
2016-10-04 17:43 ` Vivi, Rodrigo
2016-10-04 19:56 ` Chris Wilson
2016-10-05 3:17 ` Praveen Paneri
2016-10-05 6:24 ` Praveen Paneri
2016-11-15 6:40 ` [PATCH v4] " Praveen Paneri
2016-11-15 9:36 ` Tvrtko Ursulin
2016-11-15 10:07 ` Chris Wilson
2016-11-15 13:17 ` Praveen Paneri
2016-11-15 14:44 ` Tvrtko Ursulin
2016-11-15 17:19 ` [PATCH v5] " Praveen Paneri
2016-11-16 8:25 ` Tvrtko Ursulin
2016-11-16 9:03 ` Praveen Paneri
2016-11-16 9:08 ` Tvrtko Ursulin
2016-11-16 9:18 ` Chris Wilson
2016-11-15 10:56 ` [PATCH v4] " Praveen Paneri
2016-11-15 10:59 ` Tvrtko Ursulin
2016-10-05 13:50 ` [PATCH v3] " Tvrtko Ursulin
2016-10-10 17:03 ` Carlos Santa [this message]
2016-09-19 17:55 ` ✗ Fi.CI.BAT: warning for drm/i915/bxt: Broxton decoupled MMIO (rev2) Patchwork
2016-10-04 16:19 ` ✗ Fi.CI.BAT: warning for drm/i915/bxt: Broxton decoupled MMIO (rev3) Patchwork
2016-11-15 7:16 ` ✓ Fi.CI.BAT: success for drm/i915/bxt: Broxton decoupled MMIO (rev4) Patchwork
2016-11-15 18:15 ` ✓ Fi.CI.BAT: success for drm/i915/bxt: Broxton decoupled MMIO (rev5) Patchwork
2016-11-16 9:38 ` Tvrtko Ursulin
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=1476119018.11124.6.camel@intel.com \
--to=carlos.santa@intel.com \
--cc=ankitprasad.r.sharma@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=praveen.paneri@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=zhe1.wang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.