acpuclock: minor tuning

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
Revert "i prefere interactive over ondemand :D"

This reverts commit b32500096781c2b83af63cbb13f8d0c6c36f040c.
SQUASH simple and tiered gpu gov from DKP

KGSL: Add a simple GPU governor for Adreno xxx GPU series

initial coding for a Simple GPU governor based on my own work 2 years ago
from Sensation GB kernel commit: c1ea8f64167270d67915b4d4fb00910b1c0f513f

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:

	drivers/gpu/msm/kgsl_pwrscale_trustzone.c

(cherry picked from commit d87b1b6795f312a237b48fcf2d84a8c4e4ed9200)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

KGSL: make simple govenor a selectable option, co-exist with ondemand

also removed some hardcoded values

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
(cherry picked from commit 67ccc0f235f832a227b586d4a55e593b94c120ba)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/gpu/msm/kgsl_pwrscale_trustzone.c

KGSL: simple governor: expose tunables to sysfs interface via module_param

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
(cherry picked from commit 1aeaafe901246c9ee73193c2443f852f0baaa134)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

KGSL: Simple Governor: fix minor logic issue

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
(cherry picked from commit 180fb331c37f715408c3336a40549d37662e7577)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

KGSL: Simple Governor: some styling changes, early returns instead of assigning a val and returning in the end of the function call and change the copyright/author from the middle of the file to the header.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
(cherry picked from commit 7688bec305e1a6b9bd757a8d76c280208504f4e2)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: cleanups for simple governor

(cherry picked from commit 8be94d7ff1ff42c827d58ea6544b80b74d1366a0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

gpu: use explicit braces in simple governor

(cherry picked from commit 90fffadbd0934fe734946050ca4f19d2c62412cf)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: reduce simple governor's aggressiveness

 - Run less frequently
 - Don't scale up if the GPU was just idle

(cherry picked from commit a0f4e02d2432be24255aeef0cad4c944387983cc)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: fix governor backoff for GPU OC

(cherry picked from commit a93366630f860864db38f81b7c5c2f99c30b5364)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: scale governor idle stats to 16ms

Both simple and ondemand respond well to this.  GPU frequency is reduced
more aggressively and more frequently.

(cherry picked from commit 8c365bddaceecad5d4d5b22b8a6cbc2cd5ac7a43)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: small modifications for simple governor

(cherry picked from commit 7349386475fdd4595025e8b3e5a5894ff43b79d0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: rework simple governor

(cherry picked from commit 977fa495dca6fe22c3a6279753d1671aec3b30bc)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: add tiered GPU governor

Masquerades as "interactive" since there's no API to get available
governors.

(cherry picked from commit 302c36cb0d0d1506315aa36ce4ba2e01a5673f1c)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/gpu/msm/kgsl_pwrscale_trustzone.c

kgsl: track frequency limit in performance gov

This is the "wrong" way to do this, but it's easier.

(cherry picked from commit ba1a47d6115071453f48af554edf1176da045a03)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: modify GPU idle reporting

 - Accumulate (and then actually use) idle stats over the entire period
 - Gradually back off governor call frequency if frequency is stable
 - Scale idle stat to a configurable period (1/60 sec default)

The end result is simple and ondemand using lower frequencies where
appropriate.  Scaling the idle stat may not be correct for ondemand, but
works nicely.

(cherry picked from commit 7afdca12ae31d62bd9650a0061e7b572142c2adf)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: fix pwrlevel change with performance governor

(cherry picked from commit ec1a915aad257730e654308179adf4ba656c48ba)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: modify simple governor logic

(cherry picked from commit afe463adbcf20664657f861e0df15a22f3cb12f1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: modify trustzone governor backoff

(cherry picked from commit f0b298d1253b3ebdd167c5079d8f8b72a4d25f8d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: WIP tiered governor overhaul

(cherry picked from commit fa075820e5cea1959c422f2475764cb264f23ca3)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

kgsl: fix performance governor for apps too

(cherry picked from commit 3d4bcc9458f84186b7da8aa27b28bb27c0837ef0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>