msm: dcvs: set gpu frequency floor when multiple CPUs online

Performance is enhanced if the GPU frequency is floored at its
maximum nominal frequency when multiple CPUs are online.

Change-Id: Ib6bfd5007d660064844876b06f552f4d8c84865c
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 749f301c94312d2ec827c67cecb858e02383c8ab)

Conflicts:
	arch/arm/mach-msm/include/mach/msm_dcvs.h
	arch/arm/mach-msm/msm_dcvs.c
msm: dcvs: set algo params according to number of online CPUs

It is desirable for performance reasons to be able to run dcvs
with different algorithm parameters depending on the number of
CPUs that are online. The algorithm parameters are already replicated
per-CPU, but all CPUs operate in DCVS with the same parameters at
any given time.

These per-CPU parameters now correspond to the total number of CPUs
online. For example, if 2 CPUs are online, the algorithm parameters
for CPU2 are used.

Change-Id: If308a2fa949ac669823e759e0fd8e2cdbf6e4c03
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit c48381e2336125410549d7df1425dc8009c0c495)

Conflicts:
	arch/arm/mach-msm/msm_dcvs.c
msm: mpdecision: make runqueue divisor configurable via sysfs

The runqueue divisor controls how sensitive mpdecision is to
changes in runqueue depth - if the runqueue divisor is increased,
updates to TZ are made less frequently. It is desirable to be able
to easily change this parameter from userspace.

(cherry picked from commit f5d5d54a8c64337115a44d9d9292c677042c9fc1)

Change-Id: Ibfadc7fba413ae08467ded737e192fd918e97755
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
mach-msm: Add msm_mpdecision

This currently only does the following thing:
Screen on -> CPU1 online
Screen off -> CPU1 offline

More to come.

Signed-off-by: showp1984 <showp1984@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_mpdecision.c

Conflicts:
	arch/arm/mach-msm/msm_mpdecision.c
mach-msm: mpdecision: small cleanup

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: add load based decision making

This now works like the mpdecision binary from QCOM.
CPU hotplugging/unplugging based on system load.

A sysfs interface will be built in with a later commit.

Signed-off-by: showp1984 <showp1984@gmail.com>

Conflicts:
	arch/arm/mach-msm/msm_rq_stats.c
mach-msm: mpdecision: restructure locks, add delay

The new delay allows the CPU to come up before any other action is taken.
This prevents fast plugging and also ensures the CPU hotplug process
is really done, before trying to unplug it again (or plug it).

The new locks are more efficient, and only used if necessary.

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: pause if CPU is unplugged outside of mpdecision

This fixes cpu wars if something else tries to control the cpus.
default delay: 10000ms

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: change early_suspend_level to blank_screen

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: don't start immediately

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: show cpumask after up/down

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: always set the suspend var

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: remove up/down delay, our default delay is large enough

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: add email to (c)

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: fix foreign hotplug/unplug detection

Signed-off-by: showp1984 <showp1984@gmail.com>

Conflicts:

	arch/arm/mach-msm/msm_mpdecision.c
mach-msm: mpdecision: show how long the cpu was online

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: rename msm_mpdec_suspend to msm_mpdec_cpudata

Since this is being used for more than suspend stuff the old name
just isn't accurate anymore.

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: add sysfs interface

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: remove debug output

Signed-off-by: showp1984 <showp1984@gmail.com>
mach-msm: mpdecision: increase startdelay for sense

Surprise! Sense needs a lot longer to boot up than aosp...

Signed-off-by: showp1984 <showp1984@gmail.com>