]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gt: Leave rps->cur_freq on unpark
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 22 Mar 2020 16:32:25 +0000 (16:32 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 22 Mar 2020 23:03:08 +0000 (23:03 +0000)
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 <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200322163225.28791-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_rps.c

index 2d906db2da577f72eba5361423f5bef32dd3ab40..86110458e2a7ec71098430001cd3759b0f88bf65 100644 (file)
@@ -187,10 +187,8 @@ static void gen5_rps_init(struct intel_rps *rps)
                fmax, fmin, fstart);
 
        rps->min_freq = fmax;
+       rps->efficient_freq = fstart;
        rps->max_freq = fmin;
-
-       rps->idle_freq = rps->min_freq;
-       rps->cur_freq = rps->idle_freq;
 }
 
 static unsigned long
@@ -713,8 +711,6 @@ static int rps_set(struct intel_rps *rps, u8 val, bool update)
 
 void intel_rps_unpark(struct intel_rps *rps)
 {
-       u8 freq;
-
        if (!rps->enabled)
                return;
 
@@ -726,9 +722,10 @@ void intel_rps_unpark(struct intel_rps *rps)
 
        WRITE_ONCE(rps->active, true);
 
-       freq = max(rps->cur_freq, rps->efficient_freq),
-       freq = clamp(freq, rps->min_freq_softlimit, rps->max_freq_softlimit);
-       intel_rps_set(rps, freq);
+       intel_rps_set(rps,
+                     clamp(rps->cur_freq,
+                           rps->min_freq_softlimit,
+                           rps->max_freq_softlimit));
 
        rps->last_adj = 0;
 
@@ -1672,7 +1669,9 @@ void intel_rps_init(struct intel_rps *rps)
        /* Finally allow us to boost to max by default */
        rps->boost_freq = rps->max_freq;
        rps->idle_freq = rps->min_freq;
-       rps->cur_freq = rps->idle_freq;
+
+       /* Start in the middle, from here we will autotune based on workload */
+       rps->cur_freq = rps->efficient_freq;
 
        rps->pm_intrmsk_mbz = 0;