msm_fb: display: increase mdp upscaling range

The old range is x8. Acturally mdp rgb or vg pipes can scale up more
than that. The max up to x20 is verified.

CRs-fixed: 340747
Change-Id: Ief7ee936e39de2ada87d47b14872bca0c3cf36a7
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c
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>

Conflicts:
	arch/arm/mach-msm/devices-iommu.c
Revert "msm_fb: display: Rename MDP IOMMU context bank names"

This reverts commit ad46a3a9fa0ef271e2370ce42647adce24208c18.
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>

Conflicts:
	drivers/video/msm/msm_dss_io_7x27a.c
	drivers/video/msm/msm_dss_io_8960.c
	drivers/video/msm/msm_dss_io_8x60.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>

Conflicts:
	drivers/video/msm/msm_fb.c
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: Flush background pipe after solid fill configuration

For is_fg support on a foreground pipe, the  background pipe is
currently set to Solid Fill mode without being flushed. Add flush
after enabling Solid Fill on background pipe.

CRs-fixed: 352855
Change-Id: I91c4e391c9577a9198d048d2b369369d348efeab
Signed-off-by: Amara Venkata Mastan Manoj Kumar <manojavm@codeaurora.org>
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c
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>

Conflicts:
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4_overlay_dtv.c
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_dsi_video.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>

Conflicts:
	drivers/video/msm/mipi_toshiba_video_wsvga_pt.c
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>

Conflicts:
	drivers/video/msm/mdp4_overlay_writeback.c
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>

Conflicts:
	drivers/video/msm/mdp4_overlay.c
msm_fb: display: Clear background solid fill on closing video pipe

Clear background pipe's solid fill setting on closing Video pipe
to avoid blink issues in display

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

Conflicts:
	drivers/video/msm/mdp4_overlay.c
msm_fb: display: switch mdp mode without turning off timing generator

MDP need to be in idle state before switching to different mode.
Dmap_done interrupt is delivered when the last line of frame is
clocked out. Therefore mdp is in idle state during dmap_done ISR.
This patch execute mdp mode switching inside dmap_done ISR.
Therefore timing generator is not necessary to be turned off
since mdp is in idle state already.

CRs-fixed: 350154
Change-Id: Ib10557bde90856ffd5284a0a76dddbe92f2abc0e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: rotator: reset rotator to CAF

Revert to CAF at revision:
"switch mdp mode without turning off timing generator"
commit: 545a67dfb147c4f64381b4bd03f40119a39edf1d

Change-Id: Ibac40ae03cdad1e5311a44aae917ff77ae8c8ab3
msm: vidc: reset vidc code to CAF

Revert to CAF at revision:
"switch mdp mode without turning off timing generator"
commit: 545a67dfb147c4f64381b4bd03f40119a39edf1d

Change-Id: I4d74280ead18afff853ab13e1777f4b482645f64
msm_fb: display: reset all display code to CAF

Revert to CAF at revision:
"switch mdp mode without turning off timing generator"
commit: 545a67dfb147c4f64381b4bd03f40119a39edf1d

Change-Id: Id9ee1f71c7b3f2bc48590f9a4b17c6f8f1b29aad