msm: kgsl: forgot to add the header for the Simple Governor on the latest revert and re-add.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: kgsl: we don't need this routine anymore. We save CPU cycles not going through this small, now deleted, piece of code.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
kgsl: add a new governor algorithm. Ditch the older Simple Governor to make place for Interactive. This name is chosen just to differentiate from the others, but it doesn't behave like the CPU governor Interactive. This uses a completely different algorithm to decide when to increase or decrease the GPU frequency. Also the functions tz_wake and tz_sleep don't do anything, they were a bit useless at this point after some testing.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
kgsl: add back content to the sleep function for this tz routine. Also fix the length of the governor name for the sysfs entry.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
kgsl: merge changes added on flo to make the alrgorithm a bit smarter.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
KGSL: when the GPU load is high for a longer period online all offlined cores and block hotplug operations until the GPU load is down the threshold again.

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

Conflicts:
	arch/arm/kernel/mako_hotplug.c
	drivers/misc/mako_hotplug_control.c
	include/linux/hotplug.h
msm: kgsl: set active pwrlevel to init pwrlevel after power collapse

Between kgsl_open and kgsl_release calls active pwrlevel could be
set to anything based on the content. However after a power collapse
always power up the GPU and set the clock to init level.

Change-Id: Ic2858218afa9c1047864ab8551b3495b7d752952
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: gpu: merge algorithm improvements from hammerhead.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: kgsl: small calculation change.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: kgsl: no need to cast long because jiffies and window_time are already long.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: change the load calculation equation & fix a couple of bugs, one of 'em was keeping the GPU on 320MHz if the GPU was not sleeping.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: don't forcefully ramp down on sleep if there's still load higher than down_threshold.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: remove the sample_time_ms and let the governor run its idle_check freely like Qualcomm intends. I was seeing some frames being lost because the sample_time_ms was too big.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: remove obsolete code.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: msm_rq_stats: remove is_smp() API

is_smp() API is unavailable on few target codes.
Until this API is defined use CONFIG_SMP to know
whether target supports SPM are not.

CRs-fixed: 579034
Change-Id: I5bd5c208b18aae27d7f36e77e9d5b38639c2c00e
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
msm: rq_stats: Use cpufreq API to get the current frequency

Since the acpuclock APIs are deprecated, use the cpufreq to
get the current frequency of CPUs to calculate the cpu
normalized load value.

Change-Id: I6e381d584d6725ef964bad86c835d44f3046e9c3
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
msm: rq_stats: Fix wrong usage of cpufreq_quick_get()

cpufreq_quick_get() returns frequency in KHz, which is exactly what
cur_freq expect. Remove the wrong multiplication.

CRs-fixed: 645518
Change-Id: Ia8b080a188023964f5eee77c8586828097d11ad4
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>