msm:video: Enable the LUT update on DSI command mode panel

CRs-Fixed: 462625

Change-Id: Ieb670abbed0ad06a9c758fb044bf71b6fc2c71b0
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
msm_fb: display: add one more pipe_commit delay before free ion buffer

It is possible that two consective pipe_commits happen within
same vsync period.  This will cause iommu page fault due to an ion buffer
that is being fetched by mdp's pipe is freed. It needs one pipe_commit
delay to free ion buffer to prevent iommu page from happening. Therefore
an extra free stage is needed to empty ion buffer free list.
Also, ION_IOMMU_UNMAP_DELAYED flag is not necessary at mapping of an
ion buffer since one pipe_commit delay had been added.

Change-Id: I340e002e8dc30b6faa0c095ba042eab50e8b7c88
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: rotator: Add pseudo-planar 422 H1V2 dst format for MDP4

Rotator outputs pseudo-planar 422 H1V2 for interleaved inputs
on 90 degree rotation.Add changes to support MDP_Y_CRCB_H1V2,
MDP_Y_CBCR_H1V2 in MDP4.

CRs-Fixed: 371303
Change-Id: I42ea86992fc77cd335437a47611e9f640f30ed25
Signed-off-by: Mayank Goyal <goyalm@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: Fix interleaved 422 input format register settings

Check to update chroma sample information in source format register is
based on fetch plane value, which does not take into account for
interleaved 422 input format. Remove this check and set chroma sample
values for RGB formats as well.

CRs-Fixed: 501035
Change-Id: If8fd47b6d47b326efd1cb70ce9701ac1d457dcfd
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: Add minimum src/dst image size validation for MDP

MDP4 has minimum size restriction for both source and destination
height and width. Add checks to validate source and destination
layer size.

CRs-fixed: 484728
Change-Id: I8cb8d4b969cd6ab2d8e99d7ed2ebb1a4adce1ef3
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: display: Do not commit in unset for external.

In case of external, commit is happening in unset itself which
is causing flickers. This patch fixes the issue.

Change-Id: Id55346be7a155108954e23bef236db80e7b65152
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm_fb: display: Add null check for base layer

Add null check for base layer in mdp4_overlay_borderfill_stage_up
to avoid NULL pointer dereference, and kernel panic.

Change-Id: Icc6db4807274bd44aafdabc3d8b8dae70587d8d0
Signed-off-by: Neti Ravi Kumar <ravineti@codeaurora.org>
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm_fb: display: Do a pre-fill to writeback buffers.

When switching mdp operating mode to blt, writeback buffers need
pre-fill. Move the pre-fill code from isr routine to do_blt, where
actual switch to blt mode happens.

CRs-fixed: 471098
Change-Id: I0f845397894c749ac518a1fa605f84cd5fc2ad15
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c
msm_fb: display: issue completion when disabling vsync irq

When vsync irq is disabled, vsync_wait_cnt is reset to zero and
completion is issued out as they are done in isr to make sure all
wait_for_completion is released.

Change-Id: I689f0c8cde43404d0caf5bb4644efa6385798d0e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
video: msm: Cleanup

Change-Id: I20adb69aaef04450146aac3a494af1f9502d6f84
msm: mdp: Unmap secure memory on dtv off

Signed-off-by: naseer <naseer@codeaurora.org>
msm_fb: Remove the extra freelist in display_commit

There is an extra freelist call to unmap IOMMU source buffers
in display_commit for LCDC interface. This is causing IOMMU
page faults during boot up on targets with LCDC interfaces.
Remove this extra freelist call.

Change-Id: I12a905efc82c5b9751acbc5941a66d0b58027509
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: release mdp clk in mdp4_overlay_writeback_on()

mdp clk is not released in mdp4_overlay_writeback_on()

CRs-fixed: 433986

Change-Id: Ida121e03b0f08ca312c60fb8d945fe2011df853f
Signed-off-by: Mayank Goyal <goyalm@codeaurora.org>
msm_fb: display: add wfd suspend/resume to early suspend

wfd on/off was handled by fb_on/fb_close which are called from video
or userspace side. However, this is not the case for this branch. mdp
driver has to register wfd for suspend to make sure proper panel
on/off happen.

Change-Id: If1836598e5ae95e4b2b72e40dc85784a0d20c843
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: Add switch node mechanism for wfd

Add switch node mechanism for WFD to indicate the
connection/disconnection event.

Change-Id: I6242ff06c56479c2fe558658f1bf5a2981379b19
Signed-off-by: Amara Venkata Mastan Manoj Kumar <manojavm@codeaurora.org>
msm:wfd: Unregister switchdev before freeing memory

Change-Id: I42fa43e3991a6e1d4ead7d286c095831847a2e03
Signed-off-by: Shalaj Jain <shalajj@codeaurora.org>
msm: mdp: Move wfd state signalling into mdp driver

Previously the WFD driver was reponsible for signalling the
online/offline events to userspace listeners.  This led to redundant
notifications due to the manner in which the WFD driver is used. The
signalling is better purposed when done from MDP driver.

Change-Id: I2248de84d57504c2fa9f26e1bfdf0e0d4a02257a
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
gpu: msm: Allow retries for 0 order allocation

When allocating order 0 pages we allow the allocator to retry
the allocation to ensure we can take advantage of pages that
are being reclaimed. This will help avoid unnecessary out
of memory errors from kgsl clients.

Change-Id: Iec2a0a1fe10302c320a58cef90ae1ee7e35d71ee
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: mdp: Free secure memory based on pipe config

When there is no secure pipe configured, we can unmap secure
memory instead of relying on unset with secure flag set from
userspace.

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm_fb: display: Do clock control within mdp4_hw_init

Since mdp4_hw_init() access mdp registers, mdp clock control
within mdp4_hw_init() is necessary.

CRs-fixed: 455506
Change-Id: I768f468314fc920029b4c88e49ef6a74f6b74f58
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>