[CPUFREQ] ondemand: Refactor frequency increase code
Make simpler to read and call. *** v3 - Always call when powersave_bias is enabled. Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Mike Chan <mike@android.com> Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
parent
298decfbc4
commit
00e299fff3
|
@ -459,6 +459,17 @@ static struct attribute_group dbs_attr_group_old = {
|
||||||
|
|
||||||
/************************** sysfs end ************************/
|
/************************** sysfs end ************************/
|
||||||
|
|
||||||
|
static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq)
|
||||||
|
{
|
||||||
|
if (dbs_tuners_ins.powersave_bias)
|
||||||
|
freq = powersave_bias_target(p, freq, CPUFREQ_RELATION_H);
|
||||||
|
else if (p->cur == p->max)
|
||||||
|
return;
|
||||||
|
|
||||||
|
__cpufreq_driver_target(p, freq, dbs_tuners_ins.powersave_bias ?
|
||||||
|
CPUFREQ_RELATION_L : CPUFREQ_RELATION_H);
|
||||||
|
}
|
||||||
|
|
||||||
static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
|
static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
|
||||||
{
|
{
|
||||||
unsigned int max_load_freq;
|
unsigned int max_load_freq;
|
||||||
|
@ -551,19 +562,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
|
||||||
|
|
||||||
/* Check for frequency increase */
|
/* Check for frequency increase */
|
||||||
if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) {
|
if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) {
|
||||||
/* if we are already at full speed then break out early */
|
dbs_freq_increase(policy, policy->max);
|
||||||
if (!dbs_tuners_ins.powersave_bias) {
|
|
||||||
if (policy->cur == policy->max)
|
|
||||||
return;
|
|
||||||
|
|
||||||
__cpufreq_driver_target(policy, policy->max,
|
|
||||||
CPUFREQ_RELATION_H);
|
|
||||||
} else {
|
|
||||||
int freq = powersave_bias_target(policy, policy->max,
|
|
||||||
CPUFREQ_RELATION_H);
|
|
||||||
__cpufreq_driver_target(policy, freq,
|
|
||||||
CPUFREQ_RELATION_L);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue