msm-fb: display: Tearing issue during video playback

Tearing was observed while playing 1080p H264 videos in
potrait mode. Enabled blt mode check for MIPI command
mode panel as well.

CRs-Fixed: 369365
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Change-Id: Iac980050e5966db4731240c11e89e1f68118f2b7
msm_fb: display: Enable mixer1 writeback for video downscale use cases

Underrun occurs while downscaling video data on 8x60. Enable writeback
if video downscale is required.

CRs-fixed: 329630
Change-Id: Ief4b002efd6f4ad9fcfd844325c05de619d47719
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: use spin_lock_bh() when turns on/off dsi_clk

Since dsi clock is accessed by both thread and timer context,
spin_lcok_bh()/spin_unlcok_bh() must be used to serialize accessing
of dsi clock.

Change-Id: Iac80400d871c90413dcbb10a12efc6bc6247e986
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: add dtv_pipe null check before dereferenc it

There are chances that a null dtv_pipe pointer is dereferenced and
system crashes. One such case is unplug HDMI cable while playing
video. So a null check is needed for each dtv_pipe dereference.

CRs-fixed: 355238
Change-Id: I1ff57b00169e217fc5ed98574db7fd49b9319d0a
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Increase wait for VSYNC

Wait time for VSYNC needs to be increased to accomodate 1080p
24HZ resolution which requires around 41ms.

CRs-Fixed: 368521
Change-Id: Ideda24bb83e32a6d5035c6193ef3dfd5e0c947fc
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
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>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
video: msm: Load correct default values to QSEED at init

The previous QSEED Table 1 values are not suitable values (would end up
smoothing and sharpening content which can lead to artifacts).

The values loaded by this patch are the suggested default values for QSEED
since they do not smooth or sharpen most content (bi-cubic filter), but
will slightly smooth low frequency components of the image (i.e. helps
reduce artifacts that produce sharp edges on content that is supposed to
be a constant color; often introduced by some video encoding algorithms).

Change-Id: Ic4c0ca4719141bf52123ad239fcca5d3767a2c2b
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Update video format on fps change

Added check for frame rate change. Corner case if there is no
change in xres,yres and pixclock.

Change-Id: I0ff5eb65364d2a370e0973da7e84f738bd042a20
CRs-Fixed: 356328
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: disable pan display and memory access to fb1 and fb2

The native fb1 and fb2 framebuffer memory is not used and not
allocated on the board file. So on the driver side, pan display ioctl
or other operations on fb1 or fb2 framebuffer memory is checked and
invalidated.

CRs-fixed: 357242
Change-Id: I2883926251a0465f69f18c442d5867556a4651bf
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: add writeback mode for mddi on 7x30

Add support for BLT mode in the MDP4.0 overlay architecture while
downscaling to more than half of the source dimensions to avoid
underrun issues.

CRs-Fixed: 313524
Change-Id: I3ead5329edbef36697c26d55e6cf8d8cd316fdbc
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Keep fb1 for MDP version < 4.0.2

For better memory usage, fb1 memory allocation is removed for
targets like 8960 which support BF pipe and true mirroring but
required for targets like 7x30 and 8660 which still needs fb1
for border fill.

CRs-fixed: 364669
Change-Id: Id741223a0107e356b9164b582aa1f901caa21988
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Fix 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: Iff90aec4e4aae9b3350f8e043c94995d72e50817
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: Configure MDP clock table based on DSI Video pixel clk

To avoid display underrun issues, configure the MDP clock table's rate
according to DSI Video mode panel's pixel clock frequency by 1.15 times.

Change-Id: I9bc864a754c2d51c9d86ece79863820eb72cdae8
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: add CONFIG_FB_MSM_NO_MDP_PIPE_CTRL

Enable CONFIG_FB_MSM_NO_MDP_PIPE_CTRL to bypass
mdp_pipe_ctrl(). This is for vsync driven screen
update mechanism.

Change-Id: I90d294e045b84eef909703f20d649dda15272a5f
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: vsync driven screen update

This patch will queue multiply surfaces and commit those
surfaces into mdp at same instance so that surfaces will
be blended and displayed at same time. Hardware vsync event
is deliver to frame work at user space via uevent. Both
queue and commit are controlled by frame work and
synchonized with vsync event. Therefore frame rate will
match with vsync rate.

Change-Id: If630a6d94fd38483ee313f575b1a71ed8bd65a52
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: add out of range check for display sizes

MDP pipe or mixer size registers have 12-bit number, so boundary
checks are needed for those parameters. If not, input req sizes could
be very large 32 bit unsigned numbers, e.g. 0xffffffff, unsigned
operations may have overflow to pass all later checks, causing MDP
underruns or hang issues.

CRs-fixed: 380469
Change-Id: I096d7022ede21d54266b46a140782ab0348dd54b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha <agrawals@codeaurora.org>
msm_fb: display: vsync driven screen update II

Fix whitespace issues from the patch titled
msm_fb: display: vsync driven screen update

Change-Id: I96bf0210c20667486e48f5e20b7525cade098020
Signed-off-by: Siddhartha <agrawals@codeaurora.org>
msm_fb: display:  free writeback buffer at correct time

When mdp pipe is freed at end of video play back, Writeback
buffer is freed while mdp still fetchs data from it. This cause
system crashed and blue screen shows on screen. This patch
will free writeback buffer at correct time.

Change-Id: I46a5031c13d86f943d6604713e1841b482dffe96
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: enable MDP interrupts base on panel interface

Enable necessary MDP interrupts base on panel to avoid
triggering dma_s isr handler.

Crs-fixed: 331668
Change-Id: I139a6193338a1b0a7c9cc7869e3ea1b3f9a65c4d
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha <agrawals@codeaurora.org>
Merge tag 'M8960AAAAANLYA100713O' into jellybean

M8960AAAAANLYA100713O

Conflicts:
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/mdp4_overlay_lcdc.c
	drivers/video/msm/mdp4_overlay_mddi.c
	drivers/video/msm/mdp4_util.c
	drivers/video/msm/mipi_renesas.c
	drivers/video/msm/mipi_simulator.c
	drivers/video/msm/mipi_truly.c
	drivers/video/msm/msm_fb.c
	include/linux/msm_mdp.h