msm: display: Clear performance request data in turning on

In resume, previous cached request data needs be cleared as
they do not reflect the current hw status.

Change-Id: Ib8b4f703255592869055b3fca004b33f79f86d9b
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
msm: display: Fix blend configuration for video layer with MDP composition

With video layer in MDP composition, there is no need to apply destination
over blend rule, as z-order of layers take care of proper staging of layers
by default. Apply constant blend to the video layer when in MDP composition

CRs-fixed: 437965
Change-Id: I7476659f12cdf06018bf6ace829a836c86ae97e8
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm_fb: display:  add mdp bandwidth runtime calculation

Currently mdp bandwidth request logic is based on source image size
and number of layers. This logic can not support complicated mdp
usecases and it is not power efficient. The logic is improved by
calculating mdp bandwidth request at runtime from all pipes and mixers.

CRs-fixed: 425823
Change-Id: I63206f00f8d3017a2449f8ac617fce3ba2a4d36c
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: fix frame rate wrong calculation

For cmd mode the frame rate calculation result is wrong. Also in mdp
driver there are several places to do the same calculation. So fix the
wrong calculation and use a single func to do calculation.

Change-Id: I3a4be39e480ce82677dcefb666202947f7f6d3c1
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit d4eb5a1a3ef0935ce6aeffb2b48974c01b9518b9)
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
msm_fb: display: get mipi frame rate from panel file

If frame rate value for mipi video panel is coded in panel file it can
be directly used to avoid calculation error.

Change-Id: I6ad86226c81da4bcf36196385f9ff4bea0bef0ca
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb:display: correct bus bw for downscale case

The check condition for updating bus bandwidth if downscaling is
needed was always FALSE.

Change-Id: Iec0a4d13c7737d86976d76e0dfd3ec45062799fd
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: keep borderfill pipe's iommu info

Keep borderfill pipe's iommu info during base layer pipe
swap with original base layer pipe. Otherwise, borderfill
pipe's may contain original base layer pipe's iommu info
which cause iommu page fault due to same iommu buffer is
unmapped two times.

CRs-fixed: 436711
Change-Id: Ibdb792055287283c4449db07c2de2901aa4fe9b6
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: add mdp clock control to histogram enable/disable

Add mdp clock control to histogram enable and disable block to
prevent system from crashing when accessing register with mdp
clocks off.

Change-Id: Ide808b332b5456f3fc639fcbb0d03d5cad0e387f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: restore previous mdp bandwidth when resume

mdp resume bandwidth is set to the value when device was suspend, so
that the correct init value is set to avoid underrun.

CRs-fixed: 425823
Change-Id: Ie9b832f0eb5b5e1b6cb5e8979626986d896d340b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
video: msm: Cleanup from merge

Change-Id: I07bdaa8289ee3f5505dbb6730a5c43268ec4c9a8
msm_fb: Increase the pixel clock range for DSI panels

Increase the upper limit for the pixel clock that
changed with the newer version of the DSI controller.

CRs-Fixed: 380003
Change-Id: Ibbeaa478b4d12ae8f350be41f959d53a6ae6c923
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
video: msm: Workaround an MDP crash on 8660

 * If an impossibly high clock rate is needed while composing with MDP,
   the hardware will lock up when BLT mode is used.
 * Reproducible on the Galaxy Note by long-pressing power while the
   camera preview is running.
 * Just fail the overlay set so that userspace switches to GPU.

Change-Id: I2a69f967efb90a08efaadbe2d13584ca450f9805
msm_fb: display: add per stage alpha drop detection

Currently, alpha drop detection is done per frame which
means multiple blending stages share same alpha drop status
which does not reflect the alpha effect truly on each blending
stage. This patch enforces that the alpha drop detection
is done per blending stage so that alpha effect is applied
properly at each blending stage.

Change-Id: I2f456623c696192cf3388a635584a4a49d4720a0
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Revert "msm_fb: Clear real pipe attributes in the pipe free"

This reverts commit 984b289e565d300004d90399618ab977af51bd15.
video: msm: More cleanup

Change-Id: Idb3db313149ac02ae8e42bb923d3d304cf7448d3
msm_fb: display: empty pending queue during suspend

Overlay_play() adds a pipe into pending queue and pan_display()
will commit those pipes to hardware and empty queue. This patch
will make sure queue is empty at suspend so that no unexpected
pipes will be commited to hardware by pan_display() at resume.
Otherwise, iommu page fault may happen.

Change-Id: I486b15f6702448710063b0ec285680f4f89cd507
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm_fb: Fix display corruption with continuous splash screen feature

During boot up, we observe random lines on screen between the
splash_screen image and the android animation. MDP clocks
were turned off during bootup. Fix this issue by enabling
the clocks when this feature is enabled.

Add check to see that the video mode engine is not busy before
turning off the dsi controller to avoid any underruns.

CRs-Fixed: 399634

Change-Id: I8fdb50fa848362a548b8cdd53ee1817346b57716
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
msm_fb: display: delete dsi clock control from cmdlist_commit

cmdlist_commit perform dsi clock control which turns off
dsi clock unexpectly when dsi controller is configured as
command mode during booting up. This cause display panel
can not be lit up. This patch drop clock control mechanism
from cmdlist_commit and move dsi clock control mechanism to
caller.

Change-Id: I1882ea3ee1c90ac5d76958c986740582929a5e3b
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: check FB_ACTIVATE_VBL bit only

FB_ACTIVATE_VBL bit is set to enable TE logic at pan_display
and unset to disable TE logic at pan_display for smart panel.
This patch checks for FB_ACTIVATE_VBL bit set only instead of
value.

CRs-fixed: 433399
Change-Id: I6fc913c6752fcca6a27c783c45ab318065217973
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: Clear real pipe attributes in the pipe free

Clear original pipe attributes in the pipe free call.

Change-Id: I776869e7997e5b70e4c2b102e1a394034247bbcd
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>