msm: Display: Add support for "Continuous Splash Screen" feature.

The image displayed on the screen by the android bootloader
driver should continue till the android animation shows up.
Delay the display initialization for MDP, display dependent clocks
and panel power on functions.

Change-Id: I6c82721eef55ad6ad0ea2312048af3648b932df0
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm: Display: Fix the reference count for MDP and DSI clocks

The clk_enable() call for MDP and DSI clocks are called more
than necessary. These clocks were not turning off during
suspend mode for "continuous Splash screen feature" and
dtv. Fix this by calling clk_disable() functions whereever
needed.

Change-Id: Ie1aa62e1b3aecfebc4e0904ac3445872e5b230bb
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm: display: Add device pointer with clk_get for retrieving clocks

clk_get requires device pointer to return appropriate clocks
for display subsystem. Rename the names of display related clocks
in the lookup table based on functionality.

CRs-Fixed: 336925
Change-Id: I784bc4e650d779d1422a9ff1b9a75e36d669e551
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/clock-8x60.c
	drivers/video/msm/mipi_dsi.c
msm_fb: display: Add clk prepare changes to MDP and rotator

Use clk_prepare_enable and clk_disable_unprepare instead of
clk_enable and clk_disable respectively.

CRs-Fixed: 351340
Change-Id: Ifb2a9405b8f445a90277d2fade9ab33f5becbd6e
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_dtv.c
msm: rotator: Add secure session flag to rotator start data

Add flag for handling secure session to rotator data passed during
start ioctl call.

Change-Id: I58e2107dfc5c9956691a3defa7364fc220cfe079
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Build script
msm_fb: display: add dtv wait for vsync when in blt mode

Currently dtv is waiting for overlay done when in blt mode. When dtv
frame rate is low, this return may be too soon. So before dmae
finishes updating buffer, the buffer may be overwritten by userspace.
Add dtv wait4vsync after overlay done to lock the buffer untill the
next vsync to avoid tearing or flicking.

Change-Id: Ic57544a5305fdf9081bfeeccd8d364395faaf602
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dtv.c
msm_fb: display: Move mipi dsi clock enable before dsi soft reset

mipi_dsi_clk_enable() is called after dsi soft reset. Move mipi dsi clock
enable before dsi soft reset as per mipi dsi hardware design document.

Change-Id: Ie1cfdf53bc74b87b5a0e0679ab26bc513205673d
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Rename MDP IOMMU context bank names

MDP IOMMU context banks do not correspond to the input
processing pipes like RGB and VG. So the context banks
are renamed based on port and number.

Change-Id: I39a6b1a66226aeaaf48fb3697f90ab55b67a592c
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm-fb: display: Reducing the display wake up time

100 msec sleep in phy init delays system wake up. Using usleep instead of
msleep to optimize it.

Change-Id: Ibdbb771145210c9462aa68543024be2ae797be4f
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Flush MDP registers before staging up any pipe

Add flush calls to MDP's pipe and mixer registers before staging
up any pipe to a mixer.

Change-Id: I36f5aa04634bae43a38e57cd97bd2aafe9631eda
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/mdp4_overlay_lcdc.c
msm_fb: display: add mdp version info for later mdp h/w

fbtest needs to get the correct mdp version number, but now only the
version up to mdp4.0 is returned. Add the latest mdp version up to
4.4.

Change-Id: If1ff302bb4a02ed13bb4dcabcb933fd5adfbec6d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Attach and detach MDP IOMMU on suspend/resume

MDP IOMMU is not in a clean state on suspend/resume with page faults
seen with video playback after resume. Hence, IOMMU is detached
during suspend and attached on every resume call.

Change-Id: I906cd7fa79ab67fd69eb1974d06d3521d42bf55b
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: Fix invalid x offset programming for YUV444 fmt

Source x offset adjustment is not properly programmed for YUV444 format,
it is always programmed as 0. Add support for correct x offset
adjustment.

Change-Id: I73e87f961bda60670cc764c66be955e48ccf2734
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: add YUV444 interleave format support to mdp

Add support for H1V1 interleave (YUV444) to mdp

Change-Id: I86b76831ad87dede90ddd8d8f5ae64e51fa28c27
Signed-off-by: Kyong Hwa Bae <kbae@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Add MDP IOMMU detach support for DTV

IOMMU detach support on suspend is currently meant for DSI Video
and LCDC modes. The detach call is moved to early suspend for primary
display and external DTV to avoid page faults related to
suspend/resume cases.

Change-Id: Ia45071c44c20b951a328f39a033bdd83ff77d8f8
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: Free staged foreground pipes during suspend

During suspend, some foreground pipes might still be staged and
have to be removed before disabling timing generator.
So, these pipes are staged down and freed before timing generator
is switched off.

Change-Id: I3f2376cac43464c64cd1c9e2f16f3d801298c25d
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dtv.c
msm_fb: Display: Add additional settings to improve DSI signal strength.

Modify/add new Physical layer settings for Lane,
BIST and PHY strength to improve the rise/fall time of
the DSI clock waveform.

CRs-Fixed: 364037
Change-Id: Ie2503100eebdf9d4c82d457c187ab8fa903778c6
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm-fb: display: lm2 writeback support on mpq platfroms

lm2 writeback has broken on mpq platfroms as lm1 and lm2 are
selecting the same axi writeback path. It adds the support
to select the right axi writeback path based the availability
of the write master

Change-Id: Ia6b868ff13de5edc641e4795794286893c063e66
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm_fb: display: Wait for external vsync before DTV IOMMU unmap

In play wait call for DTV, software waits for overlay1 done before
unmapping IOMMU buffers. This is replaced by external vsync wait
to avoid page faults.

Change-Id: I67d3615121e9eda3a4378553049a41e32860a520
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>