Skip to content

Commit 043cd2d

Browse files
committed
drm/i915/gt: Leave rps->cur_freq on unpark
Don't override our previous frequency we used after parking, and avoid continually spiking back to the efficient frequency for mostly idle workloads. Trust our ability to autotune across a workload switch. Signed-off-by: Chris Wilson <[email protected]> Cc: Andi Shyti <[email protected]> Cc: Lyude Paul <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 21abf0b commit 043cd2d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

drivers/gpu/drm/i915/gt/intel_rps.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ static void gen5_rps_init(struct intel_rps *rps)
187187
fmax, fmin, fstart);
188188

189189
rps->min_freq = fmax;
190+
rps->efficient_freq = fstart;
190191
rps->max_freq = fmin;
191-
192-
rps->idle_freq = rps->min_freq;
193-
rps->cur_freq = rps->idle_freq;
194192
}
195193

196194
static unsigned long
@@ -713,8 +711,6 @@ static int rps_set(struct intel_rps *rps, u8 val, bool update)
713711

714712
void intel_rps_unpark(struct intel_rps *rps)
715713
{
716-
u8 freq;
717-
718714
if (!rps->enabled)
719715
return;
720716

@@ -726,9 +722,10 @@ void intel_rps_unpark(struct intel_rps *rps)
726722

727723
WRITE_ONCE(rps->active, true);
728724

729-
freq = max(rps->cur_freq, rps->efficient_freq),
730-
freq = clamp(freq, rps->min_freq_softlimit, rps->max_freq_softlimit);
731-
intel_rps_set(rps, freq);
725+
intel_rps_set(rps,
726+
clamp(rps->cur_freq,
727+
rps->min_freq_softlimit,
728+
rps->max_freq_softlimit));
732729

733730
rps->last_adj = 0;
734731

@@ -1672,7 +1669,9 @@ void intel_rps_init(struct intel_rps *rps)
16721669
/* Finally allow us to boost to max by default */
16731670
rps->boost_freq = rps->max_freq;
16741671
rps->idle_freq = rps->min_freq;
1675-
rps->cur_freq = rps->idle_freq;
1672+
1673+
/* Start in the middle, from here we will autotune based on workload */
1674+
rps->cur_freq = rps->efficient_freq;
16761675

16771676
rps->pm_intrmsk_mbz = 0;
16781677

0 commit comments

Comments
 (0)