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

All the configuration up until MDP flush is double buffered. This means
we are able to do all hardware programming without settings taking
effect until flush happens. Perform all programming, wait for fences
and wait for previous frame is done just before the flush in order to
reduce the time between last frame done and kickoff of next one.

Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_overlay.c
Revert "msm: mdss: fix sync fence deadlock when rotator is used"

This reverts commit 3a8809d47ba8b2dd62851b25ac5d22748d1d597a.

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_overlay.c
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.

Change-Id: I6e4096beb9bff0d39f4f850bbc6d2157ac42e524
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
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:

	drivers/video/msm/mdss/mdss_mdp.h
	drivers/video/msm/mdss/mdss_mdp_ctl.c
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>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Sanitize read of panel properties some more

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_intf_video.c
	drivers/video/msm/mdss/mdss_mdp_overlay.c
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>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:

	drivers/video/msm/mdss/mdss_dsi.h
	drivers/video/msm/mdss/mdss_dsi_host.c
msm: mdss: Add support for ULPS mode for DSI

For smart panels that can refresh display from their internal
RAMs, it is possible to configure the DSI clock and data lanes
in Ultra Low Power State (ULPS) during idle static screen
usecase. Add support for this feature.

[myfluxi: Adapt to hammerhead]
[neo: Some sanitization]

Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:

	Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
	drivers/video/msm/mdss/mdss_dsi.c
	drivers/video/msm/mdss/mdss_dsi_panel.c
	drivers/video/msm/mdss/mdss_mdp_intf_cmd.c
	drivers/video/msm/mdss/mdss_panel.h
Revert "video: msm: Remove some cruft"

This reverts commit 8751a8e597035e6f9cad7e2169343b113ec43756.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm/dt: hammerhead: Enable ULPS mode

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Add SMP parameters into hw capabilites

To handle use cases better, expose smp_mb_cnt and
smp_mb_per_pipe to userspace as part of hardware capability.
Pipes availablity for a use case can be computed taking these
values, based on which, composition decisions can be made.

Change-Id: Ia7cc4db153cdb164a29ae2369d3e991b95aaba65
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>