msm: mdss: Flush pending clk work before set ctx variable to 0

When clk work function use ctx variable, this variable can be set 0 array
by mdss_mdp_cmd_stop function and it causes kernel panic.
To fix kernel panic of NULL pointer dereference, flush pending clk work
before set ctx variable to 0.

Change-Id: I0206d40ae7e1ab5857feb2e1ed4fea3b74a0852f
Signed-off-by: Han Jun-Yeong <junyeong.han@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: mdp: Add retire fence

Generate the retire fence with a +1 offset from the current
release timeline. This would mean that the retire fence of the
last frame is signaled when the current frame has transferred.

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
mdss: Fix writeback

Fix retire fence threshold for writeback.
Notify when writeback buf is not available.

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
mdss: Validate sync timeline object before inc

An earlier commit - 4b7db574f061e13857e3780ceddd24ab0681628b
removed this by mistake. Restore this check.

Bug: 10953656
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm: hdmi: Handle fast HPD interrupts

When MHL cable is disconnected and connected again very quickly,
HPD and DDC modules  needs to be put into right state to make
sure HDMI is subsequently turned on and off properly.

CRs-Fixed: 548508
Change-Id: Ibb35d146d99ea5f5406e94eb7aba0b42a5348da0
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
mdss: display: turn on mdp clocks after acquiring dsi lock

At command mode panel, mdp related clocks are turned on/off
frequently to save power.  It will be turned off after 4
vsync time if no kickoff happen.
MDSS_EVENT_DSI_CMDLIST_KOFF event will try to acquire lock
of dsi controller and it may take some times to complete it.
Therefore mdp clocks have to be turned on after acquire lock
of dsi controller instead of before.

Change-Id: Ied3de9f96fabbc06b43cad23ac54659c785012d3
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>