auto_hotplug: make enable_load configurable
Revert : kthermal: Add option to disable/enable kthermal so user has a choice between this and Samsung thermald

Change-Id: Iabba0e7f041447537b4e5800bfbae07adbce233f (reverted from commit 9e338b2292352a41b56a88962437b202924bb193)
Revert : kthermal (reverted from commit 6135e0970d55f73fd302d776dde88b6300bdb716)
intelli/msm_thermal (faux123)

 intelli/msm_thermal: initial coding for Qualcomm Snapdragon 800 devices

an intelligent MSM thermal throttling kernel driver designed to replace the
closed sourced thermald(aemon) from Qualcomm.

The current driver can throttle the SOC via core frequency scaling or via
core hotplug with user configurable sysfs entries to adjust the throttling
temperature thresholds for each.

Derived from Qualcomm's Open source repo.

Signed-off-by: Paul Reioux <reioux@gmail.com>

Intelli_thermal: Note 3 KK kernel fix up (CAF update fixup as well)

Signed-off-by: Paul Reioux <reioux@gmail.com>

 intelli-thermal: use its own dedicated workqueue

this should reduce the load on the shared global workqueue for other
processes and also give its own unique variable name for cpu limit

Signed-off-by: Paul Reioux <reioux@gmail.com>

 intelli-thermal: increase sampling time to reduce sampling overhead

Signed-off-by: Paul Reioux <reioux@gmail.com>

Adapted for hlte CM11 by Jean-Pierre Rasquin <yank555-lu@gmail.com>
intelli-thermal v2: initial adaptation (Thanks Faux123)

Intellithermal 2.0 is based on the latest Qualcomm thermal driver adapted for
in-kernel use and control.  Newer MSM8974+ chipsets should use this driver
going forward

Signed-off-by: Paul Reioux <reioux@gmail.com>
fixed intelli thermal v2 compiled error (Thanks temasek)
enabled intelli thermal v2 and build zion mainline v2.6 Exp3
tspdrv: Move vibrator sysfs node

Change-Id: Ia5ab68694b6829d88ff7be5c2729c2e0396495b9
Revert "Revert "msm: vidc: Free OCMEM during power collapse" Thanks Temasek for all the hard work to"

This reverts commit 35431ed6f39730cf473a4d2047d546dc5c1b80f0.
msm: mdss: Perform bandwidth check before applying any fudge

Earlier the bandwidth check is done after applying an ib_fudge.
This causes some valid use cases to fall back to GPU. Perform
bandwidth check against the actual value without considering
any fudges.

Change-Id: I09d10724c473c76ade8cf2a2b8d1bda9862816a2
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: mdss: MDP clock optimization for single layer video playback

MDP core clock bumping is not required for single layer video
playback in 8x26 targets. Hence add revision check to avoid fudge
factor.

Change-Id: I1b0ccb4ef50514f705845b0218fa6ca0d28c1779
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: Fix mdp clock rate assignment when apply fudge is false

When apply fudge is false, currently mdp clock rate can take
garbage values, hence assign the calculated clock rate without
applying any fudge factors.

Change-Id: I7c9d34024ab94b05160b50560ab136c0c8b7781d
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: add real time debug log

To analyze issues like underruns and other timing issues
add xlogs. Add debugfs entry for xlog to enable or disable
logging and register dumping at run time.

Enable xlog: echo 1 > <debugfs>/mdp/xlog/enable

Enable register dump:
echo 1 > <debugfs>/mdp/xlog/reg_dump

Enable panic on error:
echo 1 > <debugfs>/mdp/xlog/panic

Get xlogs and register dump
cat <debugfs>/mdp/xlog/dump

Change-Id: I10c2993d9dde6ef16a37256928fff1239e6370ff
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
msm: mdss: protect command mode BW votes by tracking HW/SW states

Track two states where the BW is needed for the command mode panels
and prevent the BW vote to be released during any of those two states:
1. SW Commit State: This state is the time when the SW has requested
a BW vote, and it will be processing it; it starts at the beginning of
Commit and finish once the kickoff is issued.
2. HW MDP State: This state is the time when the HW is busy
doing the actual transaction, so bandwidth must be kept until
HW finishes; it starts at the beginning of the kickoff and finishes
once the ping pong done interrupt is received.

Change-Id: I2e56128be3ab25a1b065692ae76387a3cd383df3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
msm: mdss: add property to set from device tree the overlap BW fudge factor

Current calculations apply one fudge factor to the final bandwidth
regardless if this is a result from the overlap or prefill calculation.
With this change the final bandwidth can be tuned up to apply a different
fudge factor when the bandwidth depends on the overlap calculation.

CRs-Fixed: 635005
Change-Id: Iaa9718bda3264a47bf70a2facba0d23e4b2414f3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
msm: mdss: ensure retire fences are signaled during panel off

When turning off command mode panel, if retire fences are still active
and suspend sequence goes through some fences may remain active.
If fences remain active command panel off sequence would stop signaling
vsyncs and would throw off the timeline. To fix this clear the retire
timeline when turning panel off.

Change-Id: I32a5fe0f81b16fa2ef959c7f05e484fb9f9f8598
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: Prevent modification to image roi when scaling

If pixel extension is enabled by scaler, and layer content is
deinterlaced, the modifications to the layers region of interest
to be used by mdp hw has already been modified. We should not
further changing these values.

Change-Id: I2c528b54ce07e90b66b56ef008b73b78e4227c9d
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: mdss: remove unnecessary mutex lock.

Remove additional mutex lock at the time of releasing retire
fences.

Change-Id: Ibd2f05ce057ae7370cce14245303f83ef228b432
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: mdss: Fix check for highest of overlap and prefill bw calc

This check is supposed to be used to get the max between overlap and
prefill bandwidth value. This value is used when calculating the ib
bandwidth value to request when bus bandwidth is updated. Having a value
that is too low results in mdp underrun.

Change-Id: Ie1302737f004d8e030f8d61c75d4301fe99b1069
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: mdss: apply BW fudge factor to all controllers when video mode present

If there is a video mode controller enabled and other
controllers non-video mode, current display driver apply
the bw fudge factor only to the controller that it is
video mode.
This change will apply the fudge factor to all the
controllers enabled if any of those it is video mode to
fix some of the underruns observed in the video interfaces.

Change-Id: I0d01477dc45edbef2a25ccd540aa06b3c43073a4
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>