ion: Port from Team-SennyC2 kernel (CAF KitKat msm-kk_2.7_rb1.X)

*Ported dma shared buffer system
*Patched for support with 3.0 kernels

Signed-off-by: Sultanxda <sultanxda@gmail.com>

Conflicts:

	arch/arm/mach-msm/board-shooter_u.c
	arch/arm/mach-msm/include/mach/memory.h
	arch/arm/mach-msm/include/mach/msm_memtypes.h
	arch/arm/mach-msm/memory.c
	drivers/gpu/ion/ion.c
	drivers/gpu/ion/ion_cp_heap.c
	include/linux/msm_ion.h
shooter: Refresh defconfig
ion: Add support for MEMTYPE_SMI_ION

Signed-off-by: Sultanxda <sultanxda@gmail.com>
fix merge derps
arm: Enable ARM_HAS_SG_CHAIN
Add Force fast charge

taken from: https://bitbucket.org/bigwillyg/buttered_toast_shooter/commits/bf120286a01d9fb5122e3b71f462b2d2ba987bff
Increase Sound Buffer

credit: Cl3Kener
sched/nohz: Rewrite, fix and add more accurate load-avg computation

Part 1)

After patch 453494c3d4 (sched: Fix nohz load accounting -- again!), we can fold
the idle into calc_load_tasks_idle between the last cpu load calculating and
calc_global_load calling. However problem still exits between the first cpu
load calculating and the last cpu load calculating. Every time when we do load
calculating, calc_load_tasks_idle will be added into calc_load_tasks, even if
the idle load is caused by calculated cpus. Consider following case:
5HZ+1
| cpu0_load     cpu1    cpu2    cpu3    calc_load_tasks    tasks_idle
|    1           1       1       1
|  -->calc_load                             1                  0
|    1           1       1       1
|                    -->calc_load           2                  0
|    0           0       1       0
|                    -->calc_load           2+1-3=0            -3
|    1           1       0       1
|                            -->calc_load   1-1=0              -1
V
5HZ+11     -->calc_global_load              0                  0

actually the load should be around 3, but shows nearly 0.

This can be found in our work load. The average running processes number
is about 15, but the load only shows about 4.

We provides a solution, by taking those load not calculated cpus' idle out from
global idle as calc_unmask_cpu_load_idle. Then when calc_load execute on every
cpu, we only fold calc_unmask_cpu_load_idle. After this patch, case above
should be as follow:
5HZ+1
| cpu0_load     cpu1    cpu2    cpu3   calc_load_tasks tasks_idle  unmask_idle
|    1           1       1       1
|  -->calc_load                             1              0           0
|    1           1       1       1
|              -->calc_load                 2              0           0
|    0           0       1       0
|                    -->calc_load           2+1-1=2        -3          -1
|    1           1       0       1
|                            -->calc_load   2+1=3          -2-1=-3     0
V
5HZ+11     -->calc_global_load              3              -3          0

CC: Peter Zijlstra <peterz@infradead.org>
CC: Doug Smythies <dsmythies@telus.net>
CC: Ingo Molnar <mingo@redhat.com>
CC: Tao Ma <tm@tao.ma>
CC: Sha Zhengju <handai.szj@gmail.com>
Reported-by: Sha Zhengju <handai.szj@gmail.com>
Signed-off-by: Charles Wang <muming.wq@taobao.com>

Part 2)

Thanks to Charles Wang for spotting the defects in the current code:

 - If we go idle during the sample window -- after sampling, we get a
   negative bias because we can negate our own sample.

 - If we wake up during the sample window we get a positive bias
   because we push the sample to a known active period.

So rewrite the entire nohz load-avg muck once again, now adding
copious documentation to the code.

Reported-and-tested-by: Doug Smythies <dsmythies@telus.net>
Reported-and-tested-by: Charles Wang <muming.wq@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
Link: http://lkml.kernel.org/r/1340373782.18025.74.camel@twins
[ minor edits ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
Sched Tweaks to improve performance

Credit to Andrew Vagin <avagin@openvz.org>
scheduler: compute time-average nr_running per run-queue

Compute the time-average number of running tasks per run-queue for a
trailing window of a fixed time period. The detla add/sub to the
average value is weighted by the amount of time per nr_running value
relative to the total measurement period.

Change-Id: I076e24ff4ed65bed3b8dd8d2b279a503318071ff
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Remove plugs -- Attempt to speed up IO
shooter: Use a shared region for PMEM & ION SMI memory

*Don't cache PMEM smipool memory
*Rearranged and resized almost all of the heaps for more efficient memory allocation
*Userspace now has 860MB of RAM (an increase of 85MB)

Signed-off-by: Sultanxda <sultanxda@gmail.com>
driver: pmem: add PMEM_FLUSH

credit: agrabren
clock-8x60: Remove MDP clock freqs not used in original panel driver

In the original 3.0.16 panel driver, HTC specified a set of MDP clocks to use for scaling: 59MHz, 128MHz, 160MHz, and 200MHz.

Signed-off-by: Sultanxda <sultanxda@gmail.com>

Conflicts:

	arch/arm/mach-msm/clock-8x60.c
shooter: display: Use old framerate params

credit: sultanxda
Bluetooth: Fix possible wakelock

credit: Talustus
shooter: audio: fix acoustic tables

credit: Giulio Cervera
vidc: Correct start and stop sequence.

Video core stop should be called only if start is successful.

Original commit: https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/drivers/video/msm/vidc/common/enc/venc.c?h=jb_vanilla&id=204d123b3b46fcd5d491d95525b42b61e783309c
Revert "Input: Use accessor for MT values"

This reverts commit a99ec87b4ddfc81121189606411183d50c364de7.
Revert "Input: Send events one packet at a time"

This reverts commit f9e31088f2189d69a5951b36fa1b1ff2fb198de0.