Revert "msm_fb: Handle static screen update case in CABL for MDP3.0.3"

This reverts commit ff77f57b5bb1cd55bfdd3a14430470829e360822.
Patch causes histogram ioctl to fail after there is no UI update
for 50 ms. Abl-daemon handles static screen update case in CABL
from now.

Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit c7d7aa888a33818f278bdce86fa6c349561e05ea)

Change-Id: I50bc6cf209adcae631e7add010c30814ace47fbd
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb : Check the validity of Histogram start/stop ioctls.

Histogram start/stop ioctls are called now without checking
if the panel is on or not. Add check to validate the ioctl
calls in this aspect.

CRs-fixed: 327910
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 207b565179fe95d9537ad1d8172ba9de91a3fbaf)

Change-Id: I61b90b5f325523c945ee992b171ae6f924e0b2de
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb : Check validity of histogram bin collection

When CABL is disabled from UI, wait for completion gets killed.
Histogram bin collection is invalid in this case. Add checks
to handle this scenario.

CRs-fixed: 331527
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit 0bd48279653be46c7b91648e1ae0d93c7131e425)

Change-Id: I9a9ff110d1b97b206bbd899271ac6c52e13f6657
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: Cleanup log messages for ION buffer management

Cleanup log messages for ION buffer allocation and de-allocation
functions

(cherry picked from commit 175d1281a5c1635cffc911dac261efc67d807c9d)

Change-Id: I06fb6634e32f264cf00903fd0a27b7899e986801
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: perform backlight updates on overlay play

Perform pending backlight requests on overlay play to handle cases in
which framebuffer updates are not happening to update backlight.

CRs-fixed: 334643
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit da2f3cc0003c55cd18d6f052ecb9530fe2acea9a)

Change-Id: I448241fa76d96c0511f92f22aab5c57e4d29546f
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: increase wfd resolution to 720p

Wi-fi display can support upto 720p resolution.

(cherry picked from commit 3ab14ddf6e9fa157c292ba7442550628f090b5a5)

Change-Id: Iab722347583da67b1fed9856f5700b5af6dfe582
CRs-Fixed: 332226
Signed-off-by: Rajesh Sastrula <vrajesh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: Add DSI Video Toshiba WUXGA(1920x1200) panel support

Add DSI Video Toshiba WUXGA(1920x1200) panel support using DSI Toshiba
WSVGA bridge chip for controlling panel

Change-Id: I36de195a0f86acd5415f2c6a0c4f0cfe050512bb
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video:msm: Adding stub for MSMFB_MDP_PP ioctls

Basic handling of invalid copy_from_user and op from an invalid range.

Change-Id: I788b28d3804e7312ee18310011c75d11287c4c6c
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video: msm: Adding CSC configuration for DMA P

This enables the ability for the MSMFB_MDP_PP ioctl to configure the DMA P
CSC registers.

Change-Id: I1e18646decdd26641592bbc2a2dc0a4aa74e5f8a
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video:msm: Fix histogram error check logic

Current error check logic is incorrect. Starting the histogram should
throw an error if the histogram current state (mdp_is_hist_data) is
already true.

Similarly, stopping the histogram should only throw an error if the
histogram current state has already been set to false.

In the cases of suspend/resume the mdp_histogram_ctrl calls should only be
allowed when the histogram desired state (mdp_is_hist_start) is true.

Change-Id: Idef307293a7e4fb70807e9cea53078bf3cc67f15
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video:msm: Reset histogram when not read

Reset the histogram collection if there is no one waiting for it when it is
completed.

CRs-Fixed: 308367
CRs-Fixed: 305674
Change-Id: I76de44f237f842a1163d8b9f0783bf3457ff1d3d
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video:msm: Move histogram reads to workqueue

Histogram must be read after each histogram completion in order to clear
the histogram registers; this patch reorganizes the histogram code to use
a deferred workqueue task to read the histogram registers out of the
interrupt context.

As well, this re-organizes the histogram start-up to clear, using the same
new workqueue, the first histogram that is read because it is often
incorrect (too many or too few bins filled).

Change-Id: I4348bfb229992a054f71286a6083c249754f4ed7
CRs-Fixed: 328214
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
include:linux: Adding MSMFB_MDP_PP IOCTL

Add MSMFB_MDP_PP IOCTL and required data structures for new post processing
features

Change-Id: I459a18bbb739f79833901159a19c2c8705147b57
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video: msm: Adding CSC support for other MDP blocks

Adding support for VG1, VG2, DMA_S and Overlay Mixer 1.

Change-Id: I95a5832a70fd893970e82dadcec1e11ed608d79c
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit fa1de67dbadc084aa9fd6afa5ab4fae335089334)
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: Add support for Polynomial Color Correction (PCC)

Add support for programming Polynomial Color Correction (PCC)
parameters on MDP. PCC is used for enhancing colors on display panel by
programming the display panel calibration parameters

Tested using fbtest and dummy calibration data

Change-Id: I57dae828365f02d560e932ed0f26aa76c819fd31
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from commit 85153bdf335804c526746ab8d930087b658f3d50)
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: Add support for Area Reduced Gamma Correction (AR GC)

Provide API for programming Area Reduced Gamma Correction parameters.
AR GC is used for adjusting panel gamma behavior for R, G and B channels.

Tested using dummy AR-GC data from panel calibration and fbtest

Change-Id: I64e9f81510160ffaacb6927de1812dfd2a3e5436
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from commit c7a7cc6dc79a6f60b0468efd0fb3964b1ebc7a70)
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: change perf level for 720p landscape video

New perf level 3 (128M mdp clk) is used to play 720p landscape video,
changed from previous perf level 2 (160M mdp clk), to save power.

Change-Id: Ie27de4d2e407513eeb4cfb8fba6dd535a45c1364
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit e063a05cb7b869853ac7968c29acc0891b0d70f9)
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video:msm: Add IGC LUT functionality to PP IOCTL

This patch adds the functionality to write to the IGC Look Up
Tables (LUTs) in the MDP.

Change-Id: I4789820a56748b1a5e33ee4ca979e418170695a3
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit acde4b6510b352b97ca1dc7d3386c6696e8f10fb)

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: fix underrun seen with big src coordinates

MDP underrun happens if combination of x + w or y + h exceeds 2048.
To handle such use cases add an offset to the source address instead.

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit fa559f6cb6c9a75beb48b594f952ccfe213c4234)

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Change-Id: I41390def2f2d9a647707da86a3aee7362a127f8b
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: perform staging updates on a single vsync

Store all staging updates locally and write to hw on a single vsync
only when changes are detected, this allows a smooth transition
from using multiple overlays to framebuffer for UI

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit 94c8a2c7f32371057f094cac19aa1bb905e714f6)

Conflicts:

	drivers/video/msm/mdp4_overlay_dtv.c

Change-Id: I9deeaacfaafcf37f4feca0f537aff179b91fb988
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>