From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: deepak.s@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915: Disable/Enable PM Intrrupts based on the current freq.
Date: Mon, 9 Dec 2013 12:11:48 +0200 [thread overview]
Message-ID: <20131209101148.GH10036@intel.com> (raw)
In-Reply-To: <1386492406-24716-4-git-send-email-deepak.s@intel.com>
On Sun, Dec 08, 2013 at 02:16:45PM +0530, deepak.s@intel.com wrote:
> From: Deepak S <deepak.s@intel.com>
>
> When current delay is already at max delay, Let's disable the PM UP
> THRESHOLD INTRRUPTS, so that we will not get further interrupts until
> current delay is less than max delay, Also request for the PM DOWN
> THRESHOLD INTRRUPTS to indicate the decrease in clock freq. and
> viceversa for PM DOWN THRESHOLD INTRRUPTS.
Are we actually getting these interrupts when we shouldn't? On non-VLV I
think GEN6_RP_INTERRUPT_LIMITS should prevent it, but I don't really
know about VLV.
>
> Signed-off-by: Deepak S <deepak.s@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 3 +++
> drivers/gpu/drm/i915/i915_irq.c | 31 +++++++++++++++++++++++++++++--
> drivers/gpu/drm/i915/intel_pm.c | 3 +++
> 3 files changed, 35 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index a62ac0c..d52a2db 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -915,6 +915,9 @@ struct intel_gen6_power_mgmt {
> u8 rp0_delay;
> u8 hw_max;
>
> + u8 rp_up_masked;
> + u8 rp_down_masked;
> +
> int last_adj;
> enum { LOW_POWER, BETWEEN, HIGH_POWER } power;
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 4bde03a..cd82fdd 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -996,7 +996,20 @@ static void gen6_pm_rps_work(struct work_struct *work)
> adj *= 2;
> else
> adj = 1;
> - new_delay = dev_priv->rps.cur_delay + adj;
> +
> + if (dev_priv->rps.cur_delay >= dev_priv->rps.max_delay) {
> + I915_WRITE(GEN6_PMINTRMSK,
> + I915_READ(GEN6_PMINTRMSK) | 1 << 5);
> + dev_priv->rps.rp_up_masked = 1;
> + new_delay = dev_priv->rps.cur_delay;
> + } else
> + new_delay = dev_priv->rps.cur_delay + adj;
> +
> + if (dev_priv->rps.rp_down_masked) {
> + I915_WRITE(GEN6_PMINTRMSK,
> + I915_READ(GEN6_PMINTRMSK) | ~(1 << 4));
> + dev_priv->rps.rp_down_masked = 0;
> + }
>
> /*
> * For better performance, jump directly
> @@ -1015,7 +1028,21 @@ static void gen6_pm_rps_work(struct work_struct *work)
> adj *= 2;
> else
> adj = -1;
> - new_delay = dev_priv->rps.cur_delay + adj;
> +
> + if (dev_priv->rps.cur_delay <= dev_priv->rps.max_delay) {
> + I915_WRITE(GEN6_PMINTRMSK,
> + I915_READ(GEN6_PMINTRMSK) | 1 << 4);
> + dev_priv->rps.rp_down_masked = 1;
> + new_delay = dev_priv->rps.cur_delay;
> + } else
> + new_delay = dev_priv->rps.cur_delay + adj;
> +
> + if (dev_priv->rps.rp_up_masked) {
> + I915_WRITE(GEN6_PMINTRMSK,
> + I915_READ(GEN6_PMINTRMSK) | ~(1 << 5));
> + dev_priv->rps.rp_up_masked = 0;
> + }
> +
> } else { /* unknown event */
> new_delay = dev_priv->rps.cur_delay;
> }
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 716ca24..6b80ec4 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4186,6 +4186,9 @@ static void valleyview_enable_rps(struct drm_device *dev)
> vlv_gpu_freq(dev_priv, dev_priv->rps.rpe_delay),
> dev_priv->rps.rpe_delay);
>
> + dev_priv->rps.rp_up_masked = 0;
> + dev_priv->rps.rp_down_masked = 0;
> +
> valleyview_set_rps(dev_priv->dev, dev_priv->rps.rpe_delay);
>
> gen6_enable_rps_interrupts(dev);
> --
> 1.8.4.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2013-12-09 10:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-08 8:46 [PATCH 0/4] Fixes for vlv turbo deepak.s
2013-12-08 8:46 ` [PATCH 1/4] drm/i915: update current freq properly before requesting new freq deepak.s
2013-12-09 10:03 ` Ville Syrjälä
2013-12-09 14:22 ` S, Deepak
2013-12-08 8:46 ` [PATCH 2/4] drm/i915: set min delay to rpe delay (Efficient frequency) for better performace deepak.s
2013-12-08 16:07 ` Chris Wilson
2013-12-09 13:58 ` S, Deepak
2013-12-08 8:46 ` [PATCH 3/4] drm/i915: Disable/Enable PM Intrrupts based on the current freq deepak.s
2013-12-09 8:11 ` Daniel Vetter
2013-12-09 10:11 ` Ville Syrjälä [this message]
2013-12-10 9:44 ` S, Deepak
2013-12-08 8:46 ` [PATCH 4/4] drm/i915: WA to fix Voltage is not getting dropped to Vmin when Gfx is power gated deepak.s
2013-12-09 8:35 ` Daniel Vetter
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=20131209101148.GH10036@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=deepak.s@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.