All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 7/7] drm/i915: Stop RPS as we adjust thresholds
Date: Mon, 20 Feb 2017 16:41:47 +0200	[thread overview]
Message-ID: <87r32sdivo.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170220094713.22874-7-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Disable RPS by setting RP_CONTROL to 0, remembering its earlier value.
> Then adjust the thresholds before re-enabling RP_CONTROL.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: stable@vger.kernel.org

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d37e95b3525d..e5cfa0377367 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4804,6 +4804,7 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
>  	int new_power;
>  	u32 threshold_up = 0, threshold_down = 0; /* in % */
>  	u32 ei_up = 0, ei_down = 0;
> +	u32 rp_control;
>  
>  	new_power = dev_priv->rps.power;
>  	switch (dev_priv->rps.power) {
> @@ -4872,6 +4873,12 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
>  	spin_lock_irq(&dev_priv->uncore.lock);
>  	intel_uncore_forcewake_get__locked(dev_priv, FORCEWAKE_ALL);
>  
> +	/* Stop RPS before changing thresholds */
> +	rp_control = I915_READ_FW(GEN6_RP_CONTROL);
> +	I915_WRITE_FW(GEN6_RP_CONTROL, 0);
> +	POSTING_READ_FW(GEN6_RP_CONTROL);
> +
> +	/* Update thresholds and evaluation intervals */
>  	I915_WRITE_FW(GEN6_RP_UP_EI,
>  		      GT_INTERVAL_FROM_US(dev_priv, ei_up));
>  	I915_WRITE_FW(GEN6_RP_UP_THRESHOLD,
> @@ -4885,8 +4892,7 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
>  					  ei_down * threshold_down / 100));
>  
>  	/* Restart RPS to reload the thresholds */
> -	I915_WRITE_FW(GEN6_RP_CONTROL,
> -		      I915_READ_FW(GEN6_RP_CONTROL) | GEN6_RP_ENABLE);
> +	I915_WRITE_FW(GEN6_RP_CONTROL, rp_control | GEN6_RP_ENABLE);
>  
>  	intel_uncore_forcewake_put__locked(dev_priv, FORCEWAKE_ALL);
>  	spin_unlock_irq(&dev_priv->uncore.lock);
> -- 
> 2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>, stable@vger.kernel.org
Subject: Re: [PATCH 7/7] drm/i915: Stop RPS as we adjust thresholds
Date: Mon, 20 Feb 2017 16:41:47 +0200	[thread overview]
Message-ID: <87r32sdivo.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170220094713.22874-7-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Disable RPS by setting RP_CONTROL to 0, remembering its earlier value.
> Then adjust the thresholds before re-enabling RP_CONTROL.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: stable@vger.kernel.org

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d37e95b3525d..e5cfa0377367 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4804,6 +4804,7 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
>  	int new_power;
>  	u32 threshold_up = 0, threshold_down = 0; /* in % */
>  	u32 ei_up = 0, ei_down = 0;
> +	u32 rp_control;
>  
>  	new_power = dev_priv->rps.power;
>  	switch (dev_priv->rps.power) {
> @@ -4872,6 +4873,12 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
>  	spin_lock_irq(&dev_priv->uncore.lock);
>  	intel_uncore_forcewake_get__locked(dev_priv, FORCEWAKE_ALL);
>  
> +	/* Stop RPS before changing thresholds */
> +	rp_control = I915_READ_FW(GEN6_RP_CONTROL);
> +	I915_WRITE_FW(GEN6_RP_CONTROL, 0);
> +	POSTING_READ_FW(GEN6_RP_CONTROL);
> +
> +	/* Update thresholds and evaluation intervals */
>  	I915_WRITE_FW(GEN6_RP_UP_EI,
>  		      GT_INTERVAL_FROM_US(dev_priv, ei_up));
>  	I915_WRITE_FW(GEN6_RP_UP_THRESHOLD,
> @@ -4885,8 +4892,7 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
>  					  ei_down * threshold_down / 100));
>  
>  	/* Restart RPS to reload the thresholds */
> -	I915_WRITE_FW(GEN6_RP_CONTROL,
> -		      I915_READ_FW(GEN6_RP_CONTROL) | GEN6_RP_ENABLE);
> +	I915_WRITE_FW(GEN6_RP_CONTROL, rp_control | GEN6_RP_ENABLE);
>  
>  	intel_uncore_forcewake_put__locked(dev_priv, FORCEWAKE_ALL);
>  	spin_unlock_irq(&dev_priv->uncore.lock);
> -- 
> 2.11.0

  parent reply	other threads:[~2017-02-20 14:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20  9:47 [PATCH 1/7] drm/i915: Move the common RPS warnings to intel_set_rps() Chris Wilson
2017-02-20  9:47 ` [PATCH 2/7] drm/i915: Store the requested frequency whilst RPS is disabled Chris Wilson
2017-02-20 12:36   ` Szwichtenberg, Radoslaw
2017-02-20  9:47 ` [PATCH 3/7] drm/i915: Remove unrequired POSTING_READ from gen6_set_rps() Chris Wilson
2017-02-20 11:15   ` Szwichtenberg, Radoslaw
2017-02-20 12:43     ` chris
2017-02-20  9:47 ` [PATCH 4/7] drm/i915: Use set_rps to enable RPS Chris Wilson
2017-02-20  9:47   ` Chris Wilson
2017-02-20 14:29   ` Mika Kuoppala
2017-02-20 14:29     ` Mika Kuoppala
2017-02-20 14:38     ` Chris Wilson
2017-02-20  9:47 ` [PATCH 5/7] drm/i915: Take forcewake for setting the RPS thresholds Chris Wilson
2017-02-20 14:34   ` Mika Kuoppala
2017-02-20 14:34     ` Mika Kuoppala
2017-02-20 14:45     ` Chris Wilson
2017-02-20  9:47 ` [PATCH 6/7] drm/i915: Restart RPS using the same RP_CONTROL as from initialisation Chris Wilson
2017-02-20 13:33   ` Szwichtenberg, Radoslaw
2017-02-20 13:33     ` [Intel-gfx] " Szwichtenberg, Radoslaw
2017-02-20 14:40   ` Mika Kuoppala
2017-02-20 14:40     ` Mika Kuoppala
2017-02-20 14:47     ` Chris Wilson
2017-02-20 14:59       ` Mika Kuoppala
2017-02-20  9:47 ` [PATCH 7/7] drm/i915: Stop RPS as we adjust thresholds Chris Wilson
2017-02-20  9:47   ` Chris Wilson
2017-02-20 12:35   ` Szwichtenberg, Radoslaw
2017-02-20 12:35     ` [Intel-gfx] " Szwichtenberg, Radoslaw
2017-02-20 14:41   ` Mika Kuoppala [this message]
2017-02-20 14:41     ` Mika Kuoppala
2017-02-20 10:51 ` ✗ Fi.CI.BAT: failure for series starting with [1/7] drm/i915: Move the common RPS warnings to intel_set_rps() Patchwork

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=87r32sdivo.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@vger.kernel.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.