msm_fb: display: change mdp clock while mdp is idle

Mdp clock need to be adjusted at run time base on the
performance level. However mdp clock can only be changed
when mdp blending/dma engine is idle.

Change-Id: Ief7b0b6dde4bc60d573e7d21624358bbe2e278d6
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: disable fill screen with blank on early suspend

Disable logic to fill framebuffer with black screen before early
suspend, this is causing slugish wipe off from top to bottom
animation on screen.
This logic is still needed for MDP3 because of hardware limitation.

CRs-Fixed: 298050
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm-fb: display: back light support for mipi driver

back light control logic is added to mipi driver. it supports
100 levels

Change-Id: Idce5edb71c94e826e668ca2fe5d5f81f7a18c7c7
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm_fb: display: increase mdp max burst size

increase mdp dma and pipes max burst size, to avoid mdp underruns
(blue frames shown on display).

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: Adjust overlay VG pipe src params for non-zero x_offset

Adjust overlay VG pipe src params for non-zero x_offset to avoid
overfetching of pixels from the left of x_offset

Change-Id: I6996eac6d544edae5f85ab86551670c906e71dc0
CRs-Fixed: 296185
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: change mdp clock while mdp is idle at overlay_set()

MDP clock is adjusted base on run time perfomance level.
This patch  will change MDP clock while mdp is in idle
state at overlay_set() when performance level changed to
avoid MDP from underrun.

Change-Id: I0484a5f42736be7479cab0137f837fb24fc4ba5a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display:  updates

Change-Id: I2b1cb820739ed748219e09da075e5e52cd654dc4
msm_fb: display: use mutex instead of spin lock to avoid deadlock

There has deadlock between mdp4_isr() and disable_irq() called by
LCDC thread. Disable_irq() will wait for mdp4_isr() to complete
before return. Meanwhile mdp4_isr() will try to acquire mdp_spin_lock
which had been acquired by lcdc thread before call disable_irq().
This patch replace spin lock with mutex to avoid deadlock from happening.

CRs-fixed: 301276
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
msm_fb: display: synchronous UI and Video thread

Use mutex to synchronous between UI and Video thread.
Meanwhile, add yield() when at end of frame push of
UI thread to prevent UI thread from dominating cpu times.

CRs-fixed: 303246
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix YCrCb planar input format support in mdp

MDP hardware expects source addresses to be in YCbCr order, in order to
support YCrCb, need to swap chroma planes addresses.

CRs-Fixed: 302408
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: Remove histogram memcpy from MDP Interrupt handler

Change-Id: I46df1eb70001adda44621904cf8562e414f788b0
CRs-Fixed: 300666
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm_fb: display: wait for vsync and change perf level only if needed

since overlay_set can be called multiple times to change some
parameters, there is no need to wait on vsync to change clock for each
call to overlay_set unless there is a change in performance level.

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: use blt mode to implement MDP writeback

MDP frame buffer mode was used to implement writeback for
pulling interface (lcdc and dsi video). However frame buffer
mode is not recommanded by hardware engineer due to lacking
of verification. This patch will replace frame buffer mode
with BLT mode to implement MDP writeback.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm-fb: display: mdp clock scaling clean up

clean up of clock scaling code to organize it better

Change-Id: I6d62bbd31e2124fba317c464f2df9099222e386f
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm_fb: display: no wait for vsync after suspend

There has possibility that overlay_unset() is called after
suspend had been done. In this case no wait_for_vsync is needed
for pulling mode interface (lcdc and dsi video mode) since
timing generator was turned off and hence no vsync interrupt
will be delivered. This will cause thread to hang up.

Signed-off-by: kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: add mutex during lcdc off

There has possibility that suspend operation and screen
update happen simultaneously. There mutex at lcdc_off is
necessary to serialize both lcdc off and pan display.

CRs-fixed: 302527
Signed-off-by: Khsieh <khsieh@codeaurora.org>
msm_fb: display: Fix division by zero error in MDP downscale check

Fix division by zero error in MDP downscale validation by rejecting
destination rectangle width and height params with 0

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
msm-fb: display: Fix for the green patch issue in rotation cases

always programming the tile_size register has side affect in
rotation case. the issue is fixed by programming the tile_size
register only in case of tile buffer

Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
msm_fb: display: remove yield with pan display

It is more proper to have USER space thread to decide when
yield be called.
This patch remove yield() from pan display.

CRs-fixed: 307344
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix behavior of NO_WAIT flag during writeback

if NO_WAIT flag, overlay buffer should be set and wait for dma_p done
should only be done if flag is not enabled.

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>