msm: display: Change DSI escape clock to byte clock

Changing DSI escape clock source from PXO to byte clock to add
more flexibility.

Change-Id: Ia78093f8b8be6a27c86f3e8db68fa1f4a4d85086
CRs-Fixed: 361022
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:
	drivers/video/msm/mipi_chimei_wuxga.c
	drivers/video/msm/mipi_chimei_wxga_pt.c
	drivers/video/msm/mipi_novatek_cmd_qhd_pt.c
	drivers/video/msm/mipi_novatek_video_qhd_pt.c
	drivers/video/msm/mipi_orise_video_720p_pt.c
	drivers/video/msm/mipi_toshiba_video_wsvga_pt.c
	drivers/video/msm/mipi_toshiba_video_wuxga.c
Revert "msm_fb: display: Rename MDP IOMMU context bank names"

This reverts commit 06c0500ae33011d1354dc514dd69f098a1aaf381.

Change-Id: I2b0f1df469c71d48f073bad03e98b1a1f441fd36
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm_fb: Provide support for ARGC and CSC for layer mixer 2

MDP 4.4 supports additional layer mixer (LM2) with ARGC and
CSC blocks. Extend existing ARGC and CSC functionality to additional
layer mixer (LM2).

Change-Id: Id9e5d0a80fcd9a6e3b6132b083d8a43450c0efa1
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
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>

Conflicts:
	drivers/media/video/msm/wfd/wfd-ioctl.c
	drivers/video/msm/mdp4_overlay_writeback.c
	drivers/video/msm/msm_fb.h
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: 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>

Conflicts:
	drivers/video/msm/logo.c
	drivers/video/msm/msm_fb.c
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: panel: add esc_byte_ratio

Change-Id: If4911de60071acc873ac8fd556fdafefc454e133
msm: vidc: Extract PAR info for MPEG4/DIVX.

Display needs the pixel aspect ratio information
from the video decoder to display the picture
with the right aspect ratio. Video decoder extracts
the pixel aspect ratio information from the
video core and passes it to the client/display
as extradata.

Change-Id: I513e93bb8c2c08aa7ad85e5b82718cb9dab724ec
Signed-off-by: Arun Menon <menon@codeaurora.org>
vidc: 1080p : Add support for slice delivery mode to encoder

Slice delivery mode enables confguring the encoder to deliver
one slice per output buffer. This mode is valid only for h264
codec when multi slice config is set to slice by mb.

Change-Id: Ibc9f3193faa3e1bc6009a6521475ef15966fc7c1
Signed-off-by: Pradnya Chaphekar <pradnyac@codeaurora.org>
msm: iommu: remove HTC map range functionality

Change-Id: I691df8d3b249b1362bbaab77393d48937f97cde5
msm: iommu: re-enable system IOMMU for KGSL

Change-Id: Idb4db36594284692f90e2b30793d28b8ddba02d2