msm_fb: Fix adb shell start/stop issue when bypass enabled

Currently when 2/3/4 layer bypass is enabled, doing a adb shell
stop/start is failing overlay and composition happens through
GPU. Fix this issue by proper overlay configuration during this
scenario.

Change-Id: Ia04f1839bf80ed552671e48445af63a4dcd6bdfd
Signed-off-by: Padmanabhan Komanduru <pkomandu@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: fix iommu leak during base layer swap

Retain RGB1 iommu information during  base layer swap
so that iommu used by RGB1 can be freed back to pool later.

Change-Id: Ibed85179284743dc8a9d1434f0c81626b0567e16
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
(cherry picked from commit be46f9f596c5172438a74759d48ca7db600cd737)
msm_fb: display: fix the suspend/resume hang caused by wait4vsync stuck

wait_for_completion in wait4vsync stucks after multiple suspend/resume
tests. The cause is that when show_event timeout happens, or vsync isr
is disabled for long time, wait_vsync_cnt resets to zero, and in vsync
isr complete_all has no chance to be called which caused mdp hang. So
complete_all needs to be called whenever show_event has timeouts.

Change-Id: I124899ff95fd5550d2759d215f16fa9cb8c0c211
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
video: msm: Simplify show_event

Change-Id: I03380905c49ffabc0a64bab50209723c89830a1c
msm_fb: Update MDP fence wait behaviour

The current fence wait times out too early in cases where the GPU
is under a heavy workload. Change this behaviour to warn and wait
for a longer time for GPU to complete it's work.

Change-Id: I8b20c22733a77c1aaea4a1fd1e4daaa14b5ec2fd
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm_fb: hdmi: HDMI resume delay

Remove the delay in HDMI resume sequence by not waiting for HPD
to be switched on. HDMI panel will not be turned on by default
when the device resumes and would instead be turned on by HPD
sense if it is still connected.

CRs-Fixed: 440559
Change-Id: Id276dddbcebf9226e9688aa1b5dad4b281545b21
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: display: display idle checking update

msm_fb_blank_sub might be called for UNBLANK from
display update work queue, which is at commit state.
Idle detection is invalid in this situation
Add detection for external snd earlyuspend/resume interface.

Change-Id: Ie27030ddd9de5f56d7ccd1c203a92acb26d77f25
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
msm_fb: display: suspend-resume on HDMI

When HDMI is primary, suspend-resume is not happening.
For HDMI as primary case, early suspend and resume can be
used. This change implements early suspend and resume for
hdmi as primary case.

CRs-fixed: 381097
Change-Id: I7b83d07a8b109294f3606c60f58b760836b88685
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: call the backlight control before FB_BLANK_POWERDOWN

You might see the white line while lcd off. You should turn lcd backlight
off before lcd off to avoid that issue. So call the notifier for backlight
before handling of FB_BLANK_POWERDOWN in msm_fb.

Change-Id: I3bd08025a949ec02a1fba7cef98a13d8977c135b
msm: display: Fix composition issues when framework rebooted in suspend.

Currently, if framework is rebooted while in suspend mode, borderfill
is not unset due to which MDP composition can not be enabled. This patch
fixes the issue.

Change-Id: I8b671eccedebf2bb08724cf2d284d4ab27a71360
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm: display: msm_fb: Fix hang when framework is rebooted in suspend mode.

Currently, if framework is rebooted while in suspend mode, system hangs
permanently. With this fix, framework will be rebooted successfully even in
suspend mode.

Change-Id: If86ed2613f05454c28a9474ca813f3cfb7cb1069
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm: fb: make the pan task interruptible

Change-Id: I1796469e7ecacbbf0bddc32ebaeef71bd67b6d6f
msm: display: reduce timeline to 1 for smart panel

For smart display, dsi command and wfd, since it has its
own buffer, the input buffer can be released once the
display commit finishes, hence the fence threshold for
creation can be smaller. This patch reduce the timeline
from 2 to 1 for samrt panels. Also, it needs to
wait4dmap/wait4ov after kicked off. Otherwise, tearing may
happen.

Change-Id: I9eca871d8d863ef23b1d67b6e1e9cffea40ae4a6
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix fence fd list be put twice

msm_fb_wait_for_fence() will put fence fd list if sync_fence_wait()
failed. After that same fd list wil be put one more time. This
cause a fd put twice and cause system crash at the time fd
was closed.

Change-Id: If6a358e051c98841e34c23d81098243003ef0836
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
mako: backlight: use linear brightness ramp

Change-Id: Ic905e323f11dbde43767b62db35a4f0ce1399f84
msm_fb: Set backlight during resume after first display commit

Set the backlight after resume only after the first display
commit is done. This will avoid panel specific transients to
show up on the panel during its initialization. Also, avoid
backlight scaling during resume until backlight is set.

CRs-fixed: 468633
Change-Id: Ic9e24e9cd9d57fbdd767f9dae92f418b0b139c94
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: check active queue before signal timeline

This patch make sure active queue is not empty before signal
timeline.

Crs-fixed: 453745
Change-Id: I450c0923a67bdc90d06249e3ba83edb0b3b4b319
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
video: msm: Clean up backlight scaling cruft

Change-Id: I3c92423fd93db3f6aac393e67c456997856dbc85