msm: mdss: Handle case when pipe is not idle during cleanup.

When pipe is not idle during cleanup, MDP can go into an unrecoverable
state, which can lead into other issues. If it gets to this point we
need to recover even if it means changing display contents for a
fraction of time. To handle this follow recovery sequence:
1. Setup the pipes that are not idle to solid fill mode so that nothing
   is fetched from memory on these pipes.
2. Stage them into mixer, flush and wait for a vsync to happen and reset
   sequence to take effect on these.
3. Finally, reattach the current frame pipes to restore display back to
   normal.

Change-Id: If545b56bf32a46699871381d86e80c1980ec3cc7
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: release secure UI buffer as soon as pipe is destroyed

When secure UI session is in progress, need to make sure that the
buffers are released as soon as pipe is freed to make sure secure
session can be properly terminated without any secure UI buffers
remaining as mapped.

CRs-Fixed: 619802
Change-Id: Ia2fa87f3182efc170304a53eb8d6b3f614355245
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mdp: mdss: Tune bandwidth and clock based on ROI

Calculate bandwidth and MDP clock requirement considering
the ROI submitted for a frame. When doing partial frame update
for smart panels, the data actually fetched for a pipe is not
always the full resolution of the buffer programmed. Use the
ROI passed to find out the region of fetching and calculate the
bandwidth and clock values accordingly.

Change-Id: I01f24f8fd9a42a2c4d705b8eb0a7658e79884175
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>