cpufreq: interactive: add boost pulse interface

Change-Id: Icf1e86d2065cc8f0816ba9c6b065eb056d4e8249
Signed-off-by: Todd Poynor <toddpoynor@google.com>
This commit is contained in:
Todd Poynor 2012-05-03 00:16:55 -07:00
parent aadf030d84
commit 2e739a0791
3 changed files with 44 additions and 17 deletions

View file

@ -241,8 +241,13 @@ not idle. Default is 20000 uS.
input_boost: If non-zero, boost speed of all CPUs to hispeed_freq on input_boost: If non-zero, boost speed of all CPUs to hispeed_freq on
touchscreen activity. Default is 0. touchscreen activity. Default is 0.
boost: If non-zero, immediately boost speed of all CPUs to boost: If non-zero, immediately boost speed of all CPUs to at least
hispeed_freq. If zero, allow CPU speeds to drop below hispeed_freq. hispeed_freq until zero is written to this attribute. If zero, allow
CPU speeds to drop below hispeed_freq according to load as usual.
boostpulse: Immediately boost speed of all CPUs to hispeed_freq for
min_sample_time, after which speeds are allowed to drop below
hispeed_freq according to load as usual.
3. The Governor Interface in the CPUfreq Core 3. The Governor Interface in the CPUfreq Core

View file

@ -494,7 +494,6 @@ static void cpufreq_interactive_boost(void)
unsigned long flags; unsigned long flags;
struct cpufreq_interactive_cpuinfo *pcpu; struct cpufreq_interactive_cpuinfo *pcpu;
trace_cpufreq_interactive_boost(hispeed_freq);
spin_lock_irqsave(&up_cpumask_lock, flags); spin_lock_irqsave(&up_cpumask_lock, flags);
for_each_online_cpu(i) { for_each_online_cpu(i) {
@ -533,8 +532,10 @@ static void cpufreq_interactive_input_event(struct input_handle *handle,
unsigned int type, unsigned int type,
unsigned int code, int value) unsigned int code, int value)
{ {
if (input_boost_val && type == EV_SYN && code == SYN_REPORT) if (input_boost_val && type == EV_SYN && code == SYN_REPORT) {
trace_cpufreq_interactive_boost("input");
cpufreq_interactive_boost(); cpufreq_interactive_boost();
}
} }
static void cpufreq_interactive_input_open(struct work_struct *w) static void cpufreq_interactive_input_open(struct work_struct *w)
@ -762,16 +763,36 @@ static ssize_t store_boost(struct kobject *kobj, struct attribute *attr,
boost_val = val; boost_val = val;
if (boost_val) if (boost_val) {
trace_cpufreq_interactive_boost("on");
cpufreq_interactive_boost(); cpufreq_interactive_boost();
else } else {
trace_cpufreq_interactive_unboost(hispeed_freq); trace_cpufreq_interactive_unboost("off");
}
return count; return count;
} }
define_one_global_rw(boost); define_one_global_rw(boost);
static ssize_t store_boostpulse(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int ret;
unsigned long val;
ret = kstrtoul(buf, 0, &val);
if (ret < 0)
return ret;
trace_cpufreq_interactive_boost("pulse");
cpufreq_interactive_boost();
return count;
}
static struct global_attr boostpulse =
__ATTR(boostpulse, 0200, NULL, store_boostpulse);
static struct attribute *interactive_attributes[] = { static struct attribute *interactive_attributes[] = {
&hispeed_freq_attr.attr, &hispeed_freq_attr.attr,
&go_hispeed_load_attr.attr, &go_hispeed_load_attr.attr,
@ -780,6 +801,7 @@ static struct attribute *interactive_attributes[] = {
&timer_rate_attr.attr, &timer_rate_attr.attr,
&input_boost.attr, &input_boost.attr,
&boost.attr, &boost.attr,
&boostpulse.attr,
NULL, NULL,
}; };

View file

@ -83,27 +83,27 @@ DEFINE_EVENT(loadeval, cpufreq_interactive_notyet,
); );
TRACE_EVENT(cpufreq_interactive_boost, TRACE_EVENT(cpufreq_interactive_boost,
TP_PROTO(unsigned long freq), TP_PROTO(char *s),
TP_ARGS(freq), TP_ARGS(s),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned long, freq) __field(char *, s)
), ),
TP_fast_assign( TP_fast_assign(
__entry->freq = freq; __entry->s = s;
), ),
TP_printk("freq=%lu", __entry->freq) TP_printk("%s", __entry->s)
); );
TRACE_EVENT(cpufreq_interactive_unboost, TRACE_EVENT(cpufreq_interactive_unboost,
TP_PROTO(unsigned long freq), TP_PROTO(char *s),
TP_ARGS(freq), TP_ARGS(s),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned long, freq) __field(char *, s)
), ),
TP_fast_assign( TP_fast_assign(
__entry->freq = freq; __entry->s = s;
), ),
TP_printk("freq=%lu", __entry->freq) TP_printk("%s", __entry->s)
); );
#endif /* _TRACE_CPUFREQ_INTERACTIVE_H */ #endif /* _TRACE_CPUFREQ_INTERACTIVE_H */