msm_fb: display: MSM V4l2 video overlay driver

Provides a V4L2 device that uses the MDP overlay pipes (on MDP4),
or the PPP interface (MDP3) to overlay frames on top of display
framebuffer.

Signed-off-by: Alhad Purnapatre <alhadp@codeaurora.org>
Change-Id: Iab69d0a5acfe993d13cb7a585e292b9a87eb90ee

Conflicts:

	arch/arm/mach-msm/board-msm7627a-display.c
	drivers/media/video/msm/Kconfig
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>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_video.c
msm-fb: display: Perf changes for mdp composition

Display under-run issues are observed with mdp composition.
Fix underrun issues by changing perf level.

CRs-Fixed: 354377
Change-Id: I82346e65af173d7592506f1cee7f90f40ee01485
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Remove chicken bit config during video playback

Remove the chicket bit configuration and overlay status check
for MDP 4.0 v2.1 hardware version

CRs-Fixed: 313524
Change-Id: I0fd2db72a25a628398c9f794676d2178cdca78df
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.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
msm_fb: display: Fix color swap issues in MDP4 and Rotator drivers

Many of MDP input formats don't have correct unpack pattern, so image
displayed on screen is not in the actual format set. Also,Some rotator
output formats differ from input, these mappings used to be handled in
userspace, but to avoid issues this is now done in driver. For YCrCb planar
inputs chrominance order is dependent on rotator hardware version. Add
hardware check to swap Cb and Cr for 7x30 and 8x60 rotators.

CRs-fixed: 339114
CRs-fixed: 337040
Change-Id: I55691aa7c9d38e83e4fc63a162ffb23959ba30c1
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:

	drivers/char/msm_rotator.c
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>
msm_fb: display: Flush pipe registers before staging the pipe

Flush pipe registers before staging the pipe for the Mixer with
pull mode panel interfaces. This fixes the IOMMU page fault/underrun
caused by pipe fetching previously unmapped buffers due to missing flush
calls

CRs-Fixed: 356484
Change-Id: I6bc2e49746a7c3773708796bc1709c75a8afaa4b
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: perform data flush for each data path separately

Performing data flush on stage commit causes some frame updates to be
missed waiting for stage commit, this can lead to old data being
overwritten while it's being displayed causing visible corruption.
Change flush to happen on each frame update to avoid corruptions.

CRs-Fixed: 341597
Change-Id: If91800068d2bfd5a2e43fe3e2a96c457e173763d
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: flush base layer pipe when solid fill is enabled

Need to flush bgpipe with solid fill format to avoid fetching from
bg pipe when its contents are not displayed. Also add other missing
flushes.

CRs-Fixed: 342961
Change-Id: I03e517e02c02d9abc26fd9365e7b67025fa59657
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_atv.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_lcdc.c
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>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
video: msm_fb: Wait for dma to finish before terminating

If writeback takes too long to finish, after calling _stop()
writeback client might deallocate buffers during the DMA causing faults.
To prevent this situation, make _stop() a blocking call that waits
for the writeback to finish before returning.

Change-Id: Ia710095a55d705589a81aa9bc29c41d536c2a42d
CRs-Fixed: 351773
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.h
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: add mixer2 writeback userspace support

Apps, e.g. fbtest can access mixer2 writeback functionality in
userspace by providing ion writeback buffers.

Change-Id: Ia56ac5275854231f1f28066f78db6dda97bb7b85
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>