diff options
author | Tim Murray <timmurray@google.com> | 2015-09-23 14:53:59 -0700 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2015-09-23 16:02:25 -0700 |
commit | 223194870cd47b55afdbe2a7efdf928db2608291 (patch) | |
tree | 887cd32f9dfe624bf3dde6965c7509e6278aac58 | |
parent | ec882f7b8fb5cafd96fe25286582db14d45f28f5 (diff) | |
download | bullhead-223194870cd47b55afdbe2a7efdf928db2608291.tar.gz |
Fix rate limiting for flings.
We were incorrectly limiting sched_upmigrate on a fling. Instead, allow
a fling to use the lowest sched_upmigrate.
bug 24332559
bug 24328959
Change-Id: Ic090b12093fdefbefd04773337148560a97bdf3a
-rw-r--r-- | power/power.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/power/power.c b/power/power.c index 937d180..da8e9ed 100644 --- a/power/power.c +++ b/power/power.c @@ -258,22 +258,25 @@ static void power_hint(struct power_module *module, power_hint_t hint, // 20: upmigrate for sporadic touch // 750ms: a completely arbitrary threshold for last touch int upmigrate_value = 95 - (int)(75. * ((elapsed_time*elapsed_time) / (750000.*750000.))); + + // keep sched_upmigrate high when flinging + if (duration_hint >= 750) + upmigrate_value = 20; + previous_boost_time = cur_boost_time; resources_upmigrate[0] = resources_upmigrate[0] | upmigrate_value; resources_downmigrate[0] = resources_downmigrate[0] | (upmigrate_value / 2); - if (data) { - // modify downmigrate duration based on interaction data hint - // 1000 <= duration_downmigrate <= 5000 - // extend little core freq bump past downmigrate to soften downmigrates - if (duration_hint > 1000) { - if (duration_hint < 5000) { - duration_downmigrate = duration_hint; - duration = duration_hint + 750; - } else { - duration_downmigrate = 5000; - duration = 5750; - } + // modify downmigrate duration based on interaction data hint + // 1000 <= duration_downmigrate <= 5000 + // extend little core freq bump past downmigrate to soften downmigrates + if (duration_hint > 1000) { + if (duration_hint < 5000) { + duration_downmigrate = duration_hint; + duration = duration_hint + 750; + } else { + duration_downmigrate = 5000; + duration = 5750; } } |