[PATCH 2/3] drm/i915: WARN if RPS adjustment is more than range

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 13 10:56:30 UTC 2017


On Fri, Jan 13, 2017 at 04:12:18PM +0530, Kamble, Sagar A wrote:
> 
> 
> On 1/13/2017 3:55 PM, Chris Wilson wrote:
> >On Fri, Jan 13, 2017 at 03:46:11PM +0530, Sagar Arun Kamble wrote:
> >>Cc: Chris Wilson <chris at chris-wilson.co.uk>
> >>Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
> >>---
> >>  drivers/gpu/drm/i915/i915_irq.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >>diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> >>index ce5663d..b85bef9 100644
> >>--- a/drivers/gpu/drm/i915/i915_irq.c
> >>+++ b/drivers/gpu/drm/i915/i915_irq.c
> >>@@ -1195,6 +1195,8 @@ static void gen6_pm_rps_work(struct work_struct *work)
> >>  		adj = 0;
> >>  	}
> >>+	WARN_ON(abs(adj) > (max-min));
> >Do we actually care? The adjustment is just an exponential function that
> >will be clamped (and then when it is finally clamped will become zero).
> >Before it is clamped, it is quite permissible that the last adj will be
> >larger than the entire range.
> >-Chris
> Oh. right. I coded this incorrectly. Will it be okay if we WARN on
> -ve adjustment for Up interrupts and +ve for Down interrupts.

The code has to assume that the pm_iir may contain multiple interrupts
(i.e. both up, down, timeout) because we coalesce the hw interrupt into
the worker. I fear you will just end up repeating the if-else chain, at
which point you could just review the code above.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx-trybot mailing list