]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Only set the down rps limit when at the loweset frequency
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Jul 2012 09:16:14 +0000 (11:16 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Jul 2012 11:29:30 +0000 (13:29 +0200)
commit9d5d133ac73f8c5329b1aa9b14f229fbf7cda368
tree1b5aa011ce1cb8d64437660c14a3057b99b92bcd
parent8b9ff7c20d2e72ad147901b1869a977bab7b462c
drm/i915: Only set the down rps limit when at the loweset frequency

The power docs say that when the gt leaves rc6, it is in the lowest
frequency and only about 25 usec later will switch to the frequency
selected in GEN6_RPNSWREQ. If the downclock limit expires in that
window and the down limit is set to the lowest possible frequency, the
hw will not send the down interrupt. Which leads to a too high gpu
clock and wasted power.

Chris Wilson already worked on this with

commit bce4dd04700839371b2edd8bcabb3579220b4ab5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Apr 28 08:56:39 2012 +0100

    drm/i915: Always update RPS interrupts thresholds along with
    frequency

but got the logic inverted: The current code set the down limit as
long as we haven't reached it. Instead of only once with reached the
lowest frequency.

Note that we can't always set the downclock limit to 0, because
otherwise the hw will keep on bugging us with downclock request irqs
once the lowest level is reached.

For similar reasons also always set the upclock limit, otherwise the
hw might poke us again with interrupts.

v2: Chris Wilson noticed that the limit reg is also computed in
sanitize_pm. To avoid duplication, extract the code into a common
function.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_pm.c