Skip to content

Commit

Permalink
adreno_idler: fix *freq allocations
Browse files Browse the repository at this point in the history
 - freq_table is more flexible than min_freq
 - fix freq_table usage; freq_table[0] has the max frequency

Signed-off-by: arter97 <qkrwngud825@gmail.com
  • Loading branch information
arter97 authored and javilonas committed Jun 13, 2015
1 parent 60ee8aa commit 72daafb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/devfreq/adreno_idler.c
Expand Up @@ -73,22 +73,22 @@ int adreno_idler(struct devfreq_dev_status stats, struct devfreq *devfreq,
/* busy_time >= idleworkload should be considered as a non-idle workload. */
if (!idle_lasttime)
idle_lasttime = get_time_inms();
if (*freq == devfreq->min_freq) {
if (*freq == devfreq->profile->freq_table[devfreq->profile->max_state]) {
/* frequency is already at its lowest.
No need to calculate things, so bail out. */
return 1;
}
if (idle_lasttime + idlewaitms <= get_time_inms() &&
stats.busy_time * 100 < stats.total_time * downdifferenctial) {
/* We are idle for idlewaitms! Ramp down the frequency now. */
*freq = devfreq->min_freq;
*freq = devfreq->profile->freq_table[devfreq->profile->max_state];
return 1;
}
} else {
/* This is the case where msm-adreno-tz don't use the lowest frequency.
Mimic this behavior by bumping up the frequency. */
idle_lasttime = 0;
*freq = devfreq->profile->freq_table[1];
*freq = devfreq->profile->freq_table[devfreq->profile->max_state - 1];
/* Do not return 1 here and allow rest of the algorithm to
figure out the appropriate frequency for current workload.
It can even set it back to lowest frequency. */
Expand Down

0 comments on commit 72daafb

Please sign in to comment.