From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 7/7] drm/i915/chv: Add non claimed mmio checking
Date: Tue, 15 Dec 2015 16:44:25 +0200 [thread overview]
Message-ID: <20151215144425.GH4437@intel.com> (raw)
In-Reply-To: <1450189512-30360-7-git-send-email-mika.kuoppala@intel.com>
On Tue, Dec 15, 2015 at 04:25:12PM +0200, Mika Kuoppala wrote:
> Imre mentioned that chv might also have capability to
> track unclaimed mmio accesses. And it has, so take it
> into use.
VLV too.
My old patch:
http://lists.freedesktop.org/archives/intel-gfx/2013-May/027599.html
>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_reg.h | 4 ++++
> drivers/gpu/drm/i915/intel_uncore.c | 34 ++++++++++++++++++++++++++++++----
> 2 files changed, 34 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 007ae83..24686ab 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -1711,6 +1711,10 @@ enum skl_disp_power_wells {
> #define FPGA_DBG _MMIO(0x42300)
> #define FPGA_DBG_RM_NOCLAIM (1<<31)
>
> +#define CLAIM_ER _MMIO(0x182028)
> +#define CLAIM_ER_CLR (1<<31)
Looks like you forgot the overflow bit.
> +#define CLAIM_ER_CTR_MASK (0xffff)
Needless parens.
> +
> #define DERRMR _MMIO(0x44050)
> /* Note that HBLANK events are reserved on bdw+ */
> #define DERRMR_PIPEA_SCANLINE (1<<0)
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 02bad32..ea8fcd4 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -335,13 +335,10 @@ static void intel_uncore_ellc_detect(struct drm_device *dev)
> }
>
> static bool
> -check_for_unclaimed_mmio(struct drm_i915_private *dev_priv)
> +fpga_check_for_unclaimed_mmio(struct drm_i915_private *dev_priv)
> {
> u32 dbg;
>
> - if (!HAS_FPGA_DBG_UNCLAIMED(dev_priv))
> - return false;
> -
> dbg = __raw_i915_read32(dev_priv, FPGA_DBG);
> if (likely(!(dbg & FPGA_DBG_RM_NOCLAIM)))
> return false;
> @@ -354,6 +351,35 @@ check_for_unclaimed_mmio(struct drm_i915_private *dev_priv)
> return true;
> }
>
> +static bool
> +chv_check_for_unclaimed_mmio(struct drm_i915_private *dev_priv)
> +{
> + u32 cer;
> +
> + cer = __raw_i915_read32(dev_priv, CLAIM_ER);
> + if (likely(!(cer & CLAIM_ER_CTR_MASK)))
> + return false;
> +
> + __raw_i915_write32(dev_priv, CLAIM_ER, CLAIM_ER_CLR);
> +
> + /* We want to clear it asap, so post */
> + __raw_i915_read32(dev_priv, CLAIM_ER);
__raw_posting_read()
But not sure why we'd want to do this read really. Seems like pointless
overhead.
The other thing is that this only detect unclaimed RM cycles, so display
registers only. Might be nice to only do the checks when accessing
display registers so that we don't add overhead to the GT stuff.
I think the same holds for HSW+ actually.
> +
> + return true;
> +}
> +
> +static bool
> +check_for_unclaimed_mmio(struct drm_i915_private *dev_priv)
> +{
> + if (HAS_FPGA_DBG_UNCLAIMED(dev_priv))
> + return fpga_check_for_unclaimed_mmio(dev_priv);
> +
> + if (IS_CHERRYVIEW(dev_priv))
> + return chv_check_for_unclaimed_mmio(dev_priv);
> +
> + return false;
> +}
> +
> static void __intel_uncore_early_sanitize(struct drm_device *dev,
> bool restore_forcewake)
> {
> --
> 2.5.0
--
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-12-15 14:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 14:25 [PATCH 1/7] drm/i915: Consolidate unclaimed mmio detection Mika Kuoppala
2015-12-15 14:25 ` [PATCH 2/7] drm/i915: Introduce intel_uncore_unclaimed_mmio Mika Kuoppala
2015-12-15 14:46 ` Ville Syrjälä
2015-12-15 15:02 ` Mika Kuoppala
2015-12-15 14:25 ` [PATCH 3/7] drm/i915: Detect and clear unclaimed access on resume Mika Kuoppala
2015-12-15 14:25 ` [PATCH 4/7] drm/i915: Do one shot unclaimed mmio detection less frequently Mika Kuoppala
2015-12-15 14:49 ` Chris Wilson
2015-12-15 14:50 ` Ville Syrjälä
2015-12-16 7:26 ` Mika Kuoppala
2015-12-15 14:25 ` [PATCH 5/7] drm/i915: Streamline unclaimed reg debug trace Mika Kuoppala
2015-12-15 14:25 ` [PATCH 6/7] drm/i915: Add unclaimed mmio check to runtime pm get/put Mika Kuoppala
2015-12-15 14:33 ` Chris Wilson
2015-12-15 14:25 ` [PATCH 7/7] drm/i915/chv: Add non claimed mmio checking Mika Kuoppala
2015-12-15 14:44 ` Ville Syrjälä [this message]
2015-12-15 14:56 ` Ville Syrjälä
2015-12-15 14:59 ` Mika Kuoppala
2015-12-15 17:45 ` [PATCH 7/7] drm/i915: Add non claimed mmio checking for vlv/chv Mika Kuoppala
2015-12-15 17:55 ` Ville Syrjälä
2016-01-08 14:59 ` Mika Kuoppala
2015-12-15 14:38 ` [PATCH 1/7] drm/i915: Consolidate unclaimed mmio detection Chris Wilson
2015-12-15 14:40 ` Mika Kuoppala
2016-01-08 14:58 ` Mika Kuoppala
2015-12-15 17:24 ` Mika Kuoppala
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=20151215144425.GH4437@intel.com \
--to=ville.syrjala@linux.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;
as well as URLs for NNTP newsgroup(s).