Skip to content

Commit

Permalink
drm/i915/gt: Limit frequency drop to RPe on parking
Browse files Browse the repository at this point in the history
We treat idling the GT (intel_rps_park) as a downclock event, and reduce
the frequency we intend to restart the GT with. Since the two workloads
are likely related (e.g. a compositor rendering every 16ms), we want to
carry the frequency and load information from across the idling.
However, we do also need to update the frequencies so that workloads
that run for less than 1ms are autotuned by RPS (otherwise we leave
compositors running at max clocks, draining excess power). Conversely,
if we try to run too slowly, the next workload has to run longer. Since
there is a hysteresis in the power graph, below a certain frequency
running a short workload for longer consumes more energy than running it
slightly higher for less time. The exact balance point is unknown
beforehand, but measurements with 30fps media playback indicate that RPe
is a better choice.

Reported-by: Edward Baker <[email protected]>
Tested-by: Edward Baker <[email protected]>
Fixes: 043cd2d ("drm/i915/gt: Leave rps->cur_freq on unpark")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Edward Baker <[email protected]>
Cc: Andi Shyti <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: <[email protected]> # v5.8+
Reviewed-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit f7ed83c)
Signed-off-by: Rodrigo Vivi <[email protected]>
  • Loading branch information
ickle authored and rodrigovivi committed Dec 3, 2020
1 parent 78b2eb8 commit aff76ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_rps.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ void intel_rps_park(struct intel_rps *rps)
adj = -2;
rps->last_adj = adj;
rps->cur_freq = max_t(int, rps->cur_freq + adj, rps->min_freq);
if (rps->cur_freq < rps->efficient_freq) {
rps->cur_freq = rps->efficient_freq;
rps->last_adj = 0;
}

GT_TRACE(rps_to_gt(rps), "park:%x\n", rps->cur_freq);
}
Expand Down

0 comments on commit aff76ab

Please sign in to comment.