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>

Conflicts:

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

Conflicts:

	drivers/video/msm/msm_fb_panel.h
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>

Conflicts:

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

Conflicts:

	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_cmd.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/mipi_dsi.h
	drivers/video/msm/mipi_dsi_host.c
	drivers/video/msm/mipi_orise.c
	drivers/video/msm/mipi_tc358764_dsi2lvds.c
	include/linux/msm_mdp.h