cpufreq: interactive: new_freq will be hispeed_freq if the cpu load is >= 50%.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: time for some performance boosts. Touch boost freq is bumped to 1512MHz. This makes an hell of a difference for smoothness and I've yet seen a battery life hit. Also adding two more performance boosts, one adds a new if condition that checks if the CPU load is >= 50% and if it is the frequency goes bumped to hispeed_freq. And if the load is < 50% instead of calculating the new_freq by dividing with 100, we now divide with up_threshold (85% by default) to get a bit more homogeneous frequency scaling amongst all the available frequencies. This is give a little bit of a performance boost if the load of the CPU barely justifies bigger freqs.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: don't check for cpu_online on GOV_START, cpufreq is doing that by itself now. Also rework the new_freq calculations to make sure it scales properly.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: add tunable to control the touch boost duration.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: simplify some calls and remove a call that calculated load_since_change.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: re-add memory barriers. Lack of these was causing some hw_resets.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: decrease input boost freq from max to 1242MHz for a extra bit of battery during prolonged use of the device.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: push this governor to Google's latest code which has the boostpulse interface from where we benefit from the previous commit.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: change a few tunables for better user experience.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fix input_boost_freq behavior. Also change the defaults boost value down to 1GHz and duration to 1s. Also remove that boost entry, it does nothing useful.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: 1GHz is too low because it uses a lower bus frequency, thus some lags are noticeable. Using 1134MHz is notoriously better due to the usage of the max bus frequency. Power usage should be bigger, but I'd rather have the device smoother.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: decrease hispeed_freq and target_loads thresholds now that target_loads is properly set up.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: add thread migration cpu boost functionality.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: instead of using choose_freq() to calculate the new_freq lets try a more ondemand approach by using the actual load scaling to make it more consistent, specially when gaming.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fix a bug where the thread_migration notifier was wrongly pushing the cpu to use higher freqs a lot more than it should.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fallback to previous new_freq calculation as it is much more conservative. Also fix the new_freq logic, specially if boosted is true.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: Add a sampling_down_factor for max frequencies

Change min_sample_time to 100ms when running at max

Change-Id: Ia7e35b0625bedf20e7ef3a1f52e5828ffbfed93e
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: qqueue input boost to a high priority workqueue instead of having it go through the kthread speedchange path. This saves us spinlocks/unlocks everytime there's a touch and it saves us a couple ms to wait until the kthread is woken, then going through its code path, then the calculations, then finally calling the cpufreq target function. I measured a couple ms improvements in terms of responsiveness after touching the display and having cpufreq boosting the online cpus.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: Attempt to fix a Kernel Panic introduced on r18 which was caused by a cpu core going offline while a queued work was being processed in that cpu. Fix is easy, the work is now being queued to cpu0 and its bound to that cpu until its finished.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: remove input_wq high priority flag.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>