msm_fb: display: skip one vsync event after enabling mdp and vsync clk

Both mdp and mdp_vsync clks are disabled for command mode panel when
no new frames are being played. When they are re-enabled if new
requests come in, the first vsync event which is signaled by read
pointer interrupt arrives in a random time due to the sync between mdp
and panel, so skip it to maintain correct vsync timing.

Change-Id: I683b765e4a16d3d152b9270f5982234b94921f1e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit a4567ac320abe5d74b3c7decdbddba4bd8c57463)
msm: display: dsi command mode vsync time generation

In each vsync cycle there will be two vsync interrupts
generated, need ignore the wrong one to provide the correct vsync
timestamp.

CRs-fixed: 452269
Change-Id: Ic13eea77d15eb46f4879f818d346425c63efe41a
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
msm_fb: display: add mdp master port1 bandwidth request

mdp bus traffic go through both mdp port0 and port1, but now mdp
bandwidth request is only for port0.

Change-Id: Ie902de6362cd9225abf6e9c42f260b5af7c3c6f8
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: get mdp bandwidth parameters from board file

Underrun issues can be solved by changing mdp bandwidth parameters:
max_bw, ab_factor and ib_factor. However these parameters are not
universally same for all targets, and one set of values that works for
one target could cause underruns or higher power on other
targets. This change is driver change which makes those parameters
target dependent.

CRs-Fixed: 464492
Change-Id: Ib23ebc431caabbe91c7ae3bd96bb38789d7ddc90
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: balance bus bandwidth on mdp axi port0 and port1

mdp read and write clients are connected on both mdp port0 and port1,
however, the bus bandwidth request is made on only port0. This change
divides mdp bw requests to port0 and port1 based on pipe connections
to mdp ports.
ab - no scaling factor - port0 and port1 split
ib - scaling factor - port 0 and port1 split

Change-Id: I9050d1178f634ca908675fa826d08bee09e2a2f3
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: add scaling factor for mdp ab

system profiling found that mdp downscaling needs larger bandwidth
that is related to mdp ab request, so adding scaling factor to mdp ab
calculation reduces the chance of underruns.

ab - scaling factors - port0 and port1 split
ib - 1.5 x ab - no split and same on both ports

Change-Id: I4fde87fce1cd292e317a8261e4700cf98662d09d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: keep a minimum mdp ib bandwidth request

The calculated ab and ib bandwidth requests are very small which cause
underruns if mdp composites only very small layers. For these use
cases keeping a minimum ib request based on the baselayer size can
prevent underruns and no power impact is observed.

CRs-fixed: 472444
Change-Id: I08e77610aafdfa84c5c2a882a0c95a51950aa069
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: Add minimum src/dst image size validation for MDP

MDP4 has minimum size restriction for both source and destination
height and width. Add checks to validate source and destination
layer size.

CRs-fixed: 484728
Change-Id: I8cb8d4b969cd6ab2d8e99d7ed2ebb1a4adce1ef3
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: rotator: Wait for the pending commits in finish IOCTL

Due to asynchronuous rotator mechanism, sometimes the
MSM_ROTATOR_IOCTL_FINISH arrives before the previously queued
do_rotate work is completed. This causes fence to be signalled
before the buffer is used by rotator. In case of fast YUV 2 pass
scenario, this causes IOMMU page fault on 2 pass buffers, since
the buffer is unmapped when the rotator is still using it. Hence,
wait for the pending commit works to be finished before releasing
the fence and freeing the 2 pass buffers.

Change-Id: Iec9edd11406d102c7dd102c2ad7935184bbbba93
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: display: provide mdp bandwidth parameters from board file

Underrun issues can be solved by changing mdp bandwidth parameters:
max_bw, ab_factor and ib_factor. However these parameters are not
universally same for all targets, and one set of values that works for
one target could cause underruns or higher power on other
targets. This is board side change.

CRs-Fixed: 464492
Change-Id: I2a8fbb9018011ddf42dfa50b371e450e38f4351a
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
video: msm: Add MDP bandwidth parameters for Celox/Quincy

Change-Id: I0b5afa247f394b2a34418f8cffbf965d74484909