Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ec61e4c authored by dianlujitao's avatar dianlujitao Committed by ssizon
Browse files

power: Ignore interaction boost sequence in a short period

 * When slowly, but continuously scrolling, a sequence of zero duration
   boosts are fired by the framework. They quickly fill up the internal
   limitation of MPCTL, as a result all incoming boosts get ignored.
 * Fixing the following logspam:
    ANDR-PERF-MPCTL: Active req limit reached, No optimizations performed
 * This restores cm-14.1 behavior.

Change-Id: I977e844935539a4598a749c77f4c0934ca93a2b7
parent fe78e26a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -320,8 +320,10 @@ static int process_interaction_hint(void *data)
    }
    clock_gettime(CLOCK_MONOTONIC, &cur_boost_timespec);
    elapsed_time = calc_timespan_us(s_previous_boost_timespec, cur_boost_timespec);
    // don't hint if previous hint's duration covers this hint's duration
    if ((s_previous_duration * 1000) > (elapsed_time + duration * 1000)) {
    // don't hint if it's been less than 250ms since last boost
    // also detect if we're doing anything resembling a fling
    // support additional boosting in case of flings
    if (elapsed_time < 250000 && duration <= 750) {
        return HINT_HANDLED;
    }
    s_previous_boost_timespec = cur_boost_timespec;