diff mbox

[1/4] drm/i915: Early exit from rps worker if GPU is idle

Message ID 1463493186-10582-1-git-send-email-michal.winiarski@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

MichaƂ Winiarski May 17, 2016, 1:53 p.m. UTC
This allows us to avoid the situation where worker is increasing the GPU
frequency after we've switched to idle.

References: https://bugs.freedesktop.org/show_bug.cgi?id=89728
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Micha? Winiarski <michal.winiarski@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter May 17, 2016, 2:05 p.m. UTC | #1
On Tue, May 17, 2016 at 03:53:03PM +0200, Micha? Winiarski wrote:
> This allows us to avoid the situation where worker is increasing the GPU
> frequency after we've switched to idle.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=89728
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Micha? Winiarski <michal.winiarski@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index f0d9414..bb5b557 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1091,7 +1091,7 @@ static void gen6_pm_rps_work(struct work_struct *work)
>  
>  	spin_lock_irq(&dev_priv->irq_lock);
>  	/* Speed up work cancelation during disabling rps interrupts. */
> -	if (!dev_priv->rps.interrupts_enabled) {
> +	if (!dev_priv->rps.interrupts_enabled || !dev_priv->mm.busy) {

And ->mm.busy is really protected by ->irq_lock? You're sure?
-Daniel

>  		spin_unlock_irq(&dev_priv->irq_lock);
>  		return;
>  	}
> -- 
> 2.8.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index f0d9414..bb5b557 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1091,7 +1091,7 @@  static void gen6_pm_rps_work(struct work_struct *work)
 
 	spin_lock_irq(&dev_priv->irq_lock);
 	/* Speed up work cancelation during disabling rps interrupts. */
-	if (!dev_priv->rps.interrupts_enabled) {
+	if (!dev_priv->rps.interrupts_enabled || !dev_priv->mm.busy) {
 		spin_unlock_irq(&dev_priv->irq_lock);
 		return;
 	}