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: wait for dma done before issuing dsi bta request

In the command mode panel, the mdp pixel data is using the
dsi command mode engine which is shared with the dsi dma
transaction.  This change makes sure there is no pending
mdp dma before issuing the dsi bta request.

Change-Id: Ida99e973c2bf73757726134ba7e2ad2df9e6eb02
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: add bandwidth check while performing frame level checks

Add frame level check inside overlay prepare API, for the bandwidth that
would be required by MDP to display the frame. If the bandwidth is over
the defined limits, then we need to fail the configuration to allow an
alternative composition configuration to happen instead.

Change-Id: I7721047589ce9239f1fb63c37ca5d97127c90f7e
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
msm: mdss: Prevent race condition between dsi off and bta status check

fb_event_callback() is what is responsible for cancelling the
delayed_work when it gets the FB_BLANK_POWERDOWN event. However,
this event occurs after the panel & DSI have been turned off. So
if the check_status function was being called right when the panel
is being turned off, we have a race conditon. Hence check
shutdown flag to avoid bta status check when dsi is being turned off.

Change-Id: I103bafb4ab63be83c47dfd6b3bad06d36704ff68
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
mdss: Notify userspace of changes to blank status

Allow userspace to poll on the blank event to avoid triggering
unnecessary updates, such as when shutting down the device.

CRs-Fixed: 627814
Change-Id: I36bb7845edba14ba0b0ddbe43eaf3d386af2d5f1
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
mdss: Add newline to VSYNC timestamp

This makes sure that the userspace correctly interprets the end
of the vsync timestamp.

Change-Id: I66f9939658b6fb7531468429c1ca3e551a4a285c
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm: mdss: Program unpack pattern for pipes with solidfill

When a pipe is staged with a solidfill color, we need to also
program the correct unpack pattern for the color format. If the
unpack pattern is not specified, the corresponding color layer may
not be display correctly.

Change-Id: Ic52fe29235813faa788745dd72f82edaca2635f1
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
msm: kgsl: allow creation of events from the future

For contexts created with the KGSL_CONTEXT_USER_GENERATED_TS,
allow events to be created for timestamps that have not
been issued yet. Presumably these contexts know what they
are doing.

Change-Id: Iccf2e549b38e1a11850d26ee64b7279ab0b8a1ae
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>