Revert "Revert "msm: mdss: push wait for fences and ping pong done as late as possible""

This reverts commit 53c2b788a66f2acb6f5e8113734c1f2593a54169.

Change-Id: I0471c41726c84743565c48b440086b5d8cd8d293
msm: mdss: clean up overlay resources properly when display is off

When display is turned off, the clocks are already turned off and
unprepared.  Earlier, when unsetting the overlay resource, we were
trying to re-enable the unprepared clocks.

Change-Id: I36e79e4a0bdbbe35f4474527a09a4da59cbec96c
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
mdss: display: add command mode mdp fifo underflow recovery

At command mode, mdp underflow can not be recovered but cause
mdp to hang up. Add mdp underflow recovery mechanism  when mdp
underflow detected.

Change-Id: I26fc64005ac247372257aa126f2c8c0076925bb9
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
Merge "Revert "Revert "msm: mdss: push wait for fences and ping pong done as late as possible""" into cm-11.0
Merge "msm: mdss: clean up overlay resources properly when display is off" into cm-11.0
Merge "mdss: display: add command mode mdp fifo underflow recovery" into cm-11.0
msm: mdss: Display splash screen during boot up

It is required to display the splash screen as soon
as fb driver is probed. This shows the device life
at early stage before boot animation rendered by
surface flinger. Current implementation shows the
splash screen only when continuous splash is disabled.

Change-Id: I2642e9e766fecefe62b431cd92ca541691466d91
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss:Add splash logo configuration entry in fb

Framebuffer driver displays penguin logo image
for all targets. Bootloader also displays the
same image. However, customer has to change this
boot image at two places if they want to display
different image than penguin logo. This change allows
customer to disable/enable the splash image from
framebuffer driver.

Change-Id: I56e78ce93aa8c218adffef03bfebd462d6bda254
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: hdmi: add missing sentinel to of_match_table

The DT of_match_table is missing the NULL entry that is needed to
terminate the table. Without this there is a risk of corrupting memory.

Change-Id: Ida223b91b00c72a6a2990653e3cb5ee693bd7e05
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: mdss: Sanitize overlay kickoff inputs

Overlay kickoff in certain situations can be called without a ctl
attached to the frame buffer device. These situations need to
be captured and logical path should return safely.

CRs-fixed: 619588
Change-Id: Ibee6b59be667b7e5c9841ffb49c67d86bde45026
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
mdss: display: initialize panel_mode at mdss_dsi_ctrl_init

Initialize dsi controller's panel_mode at mdss_dsi_ctrl_init()
due to mdss_dsi_host_init() is not called during boot up if
continuous splash is enabled. An unnecessary timeout will happen
for dcs command send of command mode panel if panel_mode is
initialized as video mode.

Change-Id: I041abcebb9479f3d55f2f21d560aced6c4b77b91
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: keep clocks on during kickoff operation

There is deadlock scenario where work thread to turn clocks off is
trying to acquire DSI's mdp_busy lock while holding clk_mtx to turn
mdp clocks on.  Meanwhile kickoff thread holds mdp_busy lock and
trying to acquire clk_mtx to turn on clock.
This patch ensure that clocks are kept on and work thread is not
scheduled while kickoff is in progress so that deadlock will not happen.

Change-Id: Iceb5db431a7f9f0e1f56a0e3c1ced2d08d762b86
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
msm: mdss: remove interruptible timeout waits

Currently display driver contexts are not utilizing interruptible
wake-ups while using wait_for_completion_interruptible_timeout. This
can lead to incorrect context wake-up and un-predictable outcome. Since
there is already a timeout attached to these kind of context sleeps, it
is safe to replace them with wait_for_completion_timeout.

Change-Id: Ia528debf34aef0acdda2bea1219a128c200c3651
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Make notify update waits interruptible

Wait for completion in notify update call are uninterruptible
causing excessive delay during suspend cases. Making them
interruptible.

Change-Id: I1a4ff6ce3e0add21d4e46a41372b076b277d10f5
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
mdss: display: edp continuous splash support.

Both edp main link clock and pixel clock are source from PLL.
This patch add edp clock nodes into system clock tree so that
both main link clock and pixel clock are configured properly
to support different panels with different resolution. Edp
related clocks handoff from bootloader are supported.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>

Signed-off-by: Manish Kumar <manishku@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_edp.c

Change-Id: I035dbea9a4533b0342603628478b3f251fca268c
msm: mdss: Sanitize read of panel properties

Check panel property's values properly before operating on
them.

CRs-Fixed: 562887
Change-Id: I26ce51e8b3a8e9328e7b6370b9c56d67fcdd1901
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: mdss: Sanitize read of panel properties some more

Change-Id: I6741d4ff21510156518005abd0de4da7a6afc585
msm: mdss: perform proper clock handoff during cont. splash screen

During continuous splash screen need to ensure clocks are properly ref
counted once and released once handoff has happened. Doing it in
different places can lead to improper order and cause clocks to be
disabled. Fix this by centralizing this into footswitch ctrl which is
called when continous splash screen is enabled.

Change-Id: I17f3d5517d9a0583221fdb5c354bf1992ddeddbd
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: implement overlay prepare ioctl

Overlay prepare will allow a full frame with multiple overlays to be
configured at once and perform frame level checks before being pushed to
display. This function guarantees that if the call is successful, the
frame can be displayed successfully on the screen when display commit is
called.

Change-Id: I276b6fe3e0a872a2e93170f3cea1002d3ce0dac9
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
msm: mdss: dsi-1 as master clock controller at split display case

During split display case, both dsi controllers share the same
dsi pll(dsi0) dsi-0 clock need to be enabled before dsi-1 and disabled
in the reverse order. This mechanism helps using a unified clock control
logic.

Change-Id: I9fe0095b0427c9c2b7fd84c3179bc8364049cce4
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>