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:
	drivers/video/msm/mddi.c
	drivers/video/msm/mdp.c
	drivers/video/msm/mipi_dsi.c
	drivers/video/msm/mipi_dsi.h
	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: Enable 32bpp framebuffer format.

Enable 32bpp framebuffer format for 7x27a and 8x25.

Change-Id: I38deabca45ea849710bd2edb2b6847c5309a0c9e
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Allocate writeback buffers of panel resolution sizes

Allocate MDP writeback buffers based on panel resolution size
dynamically

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Change-Id: I4a456199a05850f35c204edfa7ae3679036138a9
msm_fb: display: add mixer1 writeback buf init call

mdp4_init_writeback_buf call is missing for mixer1 interface. And
blt_addr should be nulled when dtv interface is initialized,
otherwise, mixer1 writeback mode may be false enabled which causes
system crashes or garbage display on TV.

Change-Id: Idbf5fe90eb50f0a68b434f2c76012c64a38553a4
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
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/hdmi_msm.c
	drivers/video/msm/mddi.c
	drivers/video/msm/mdp.c
	drivers/video/msm/mipi_dsi.c
	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: Update clock prepare changes for MIPI DSI

Update the clock prepare/unprepare changes for MIPI DSI clocks
and update the clock lookup table for ebi_lcdc_clk for MIPI DSI
interface.

Change-Id: Ic31e2e1b169894e633849573eb54325457080b53
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: Clean DSI state on continuous splash disabled cases

Reset the DSI clock control, disable controller and PLL
to resolve boot issues for DSI command mode for continuous
splash feature disabled/unspported cases

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

Conflicts:
	arch/arm/mach-msm/board-8960-display.c
msm_fb: display: remove mdp writeback2 overlay kickoff waiting

Before overlay2 kickoff, there is already a dma busy waiting, so once
overlay is kicked off, mdp driver can safely return to userspace. Then
if there is another request while ovlay2 is still busy, dma busy can
take care of it.

Change-Id: Ibb45a8b306a393c8e240fc64b5857e8700afcaba
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@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: update dtv panel info clk rate

dtv panel clk rate is dynamically changed with the HDMI
resolution. s/w panel info needs to keep its clk rate updated.

CRs-fixed: 355110
Change-Id: I9365d67820158afb2bc520736df9152864a2a962
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
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>
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>
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>

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