Intel-GFX Archive on 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
Subject: Re: [PATCH v3 3/3] drm/i915: Defer unmasking RPS interrupts until after making adjustments
Date: Fri, 10 Mar 2017 16:13:54 +0200	[thread overview]
Message-ID: <87bmt92p99.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170309211232.28878-3-chris@chris-wilson.co.uk>

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

> To make our adjustments to RPS requires taking a mutex and potentially
> sleeping for an unknown duration - until we have completed our
> adjustments further RPS interrupts are immaterial (they are based on
> stale thresholds) and we can safely ignore them.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/i915/i915_irq.c | 28 +++++++++++++---------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index e8f4c78c4bdc..ab55a3ddafb3 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1149,30 +1149,21 @@ static void gen6_pm_rps_work(struct work_struct *work)
>  {
>  	struct drm_i915_private *dev_priv =
>  		container_of(work, struct drm_i915_private, rps.work);
> -	bool client_boost;
> +	bool client_boost = false;
>  	int new_delay, adj, min, max;
> -	u32 pm_iir;
> +	u32 pm_iir = 0;
>  
>  	spin_lock_irq(&dev_priv->irq_lock);
> -	/* Speed up work cancelation during disabling rps interrupts. */
> -	if (!dev_priv->rps.interrupts_enabled) {
> -		spin_unlock_irq(&dev_priv->irq_lock);
> -		return;
> +	if (dev_priv->rps.interrupts_enabled) {
> +		pm_iir = fetch_and_zero(&dev_priv->rps.pm_iir);
> +		client_boost = fetch_and_zero(&dev_priv->rps.client_boost);
>  	}
> -
> -	pm_iir = dev_priv->rps.pm_iir;
> -	dev_priv->rps.pm_iir = 0;
> -	/* Make sure not to corrupt PMIMR state used by ringbuffer on GEN6 */
> -	gen6_unmask_pm_irq(dev_priv, dev_priv->pm_rps_events);
> -	client_boost = dev_priv->rps.client_boost;
> -	dev_priv->rps.client_boost = false;
>  	spin_unlock_irq(&dev_priv->irq_lock);
>  
>  	/* Make sure we didn't queue anything we're not going to process. */
>  	WARN_ON(pm_iir & ~dev_priv->pm_rps_events);
> -
>  	if ((pm_iir & dev_priv->pm_rps_events) == 0 && !client_boost)
> -		return;
> +		goto out;
>  
>  	mutex_lock(&dev_priv->rps.hw_lock);
>  
> @@ -1229,6 +1220,13 @@ static void gen6_pm_rps_work(struct work_struct *work)
>  	}
>  
>  	mutex_unlock(&dev_priv->rps.hw_lock);
> +
> +out:
> +	/* Make sure not to corrupt PMIMR state used by ringbuffer on GEN6 */
> +	spin_lock_irq(&dev_priv->irq_lock);
> +	if (dev_priv->rps.interrupts_enabled)
> +		gen6_unmask_pm_irq(dev_priv, dev_priv->pm_rps_events);
> +	spin_unlock_irq(&dev_priv->irq_lock);
>  }
>  
>  
> -- 
> 2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-10 14:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 21:12 [PATCH v3 1/3] drm/i915: Stop using RP_DOWN_EI on Baytrail Chris Wilson
2017-03-09 21:12 ` [PATCH v3 2/3] drm/i915: Use max(render, media) for Baytrail busyness calculation Chris Wilson
2017-03-09 21:12 ` [PATCH v3 3/3] drm/i915: Defer unmasking RPS interrupts until after making adjustments Chris Wilson
2017-03-10 14:13   ` Mika Kuoppala [this message]
2017-03-10  9:04 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/3] drm/i915: Stop using RP_DOWN_EI on Baytrail Patchwork
2017-03-10 14:10 ` [PATCH v3 1/3] " Mika Kuoppala
2017-03-10 14:22   ` Chris Wilson
2017-03-10 15:07   ` Chris Wilson

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=87bmt92p99.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox