msm: rotator: Don't control rot_axi_clk explicitly

It is now controlled implicitly along with the rotator core clock
for all SoCs.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: fix the rotation issue on 8960 V2

8960 V2 contains different version from V1, until we
have the proper soc check in the board file to modify
the rotator device version disabling the check in the
rotator driver. It won't have any side effects.

Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: add check for buffers boundaries

check that offset is within the range of buffer to avoid possible
access to other memory regions.

Change-Id: I37f49b0c95cc9bf79a09c7b0fa04f1135b691a5d
CRs-Fixed: 308058
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: ion support in rotator driver

Add support for ion memory heaps in the rotator
driver

Change-Id: Id844050871e4aaa7fa0e0fc9d69646d6d9875b85
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: Replace clk_set_min_rate() with clk_set_rate()

The rotator driver requests exact rates.  There is no need to call
the clk_set_min_rate() API, which will soon be removed altogether.
Call clk_set_rate() instead.

Change-Id: Ica9cb30f85132e92a00b0000eea498c47645b697
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: add downscale support in rotator

Rotator is capable of performing 1/2, 1/4 and 1/8 down scaling. Add
downscale_ratio parameter to provide support for this feature.

CRs-Fixed: 315874
Change-Id: I57dc3456ccc9bec2a125750b3e9909ffcbaf45f6
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: Fix rotator YCrCb planar formats unexpected output

Rotator expects planar input in YCbCr order, wrong color can be seen
on ouput image when given YCrCb because the chromninance planes picked
are not correct. Swap Cb and Cr plane addresses to output correct image.

Change-Id: Ia05ab704d18da4aac49e63fb805c40a95ea51a33
CRs-Fixed: 327956
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: Add bus scaling support

Add bus scaling support to rotator driver

Change-Id: I53faf6070a9dc6d6359b6d58cb7cb618217ee8c0
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: rotator: Add pseudo-planar output for interleaved format.

Rotator gives pseudo-planar H2V1 output for interleaved
H2V1 input format.

Change-Id: I2a7af3243dfb1175ea14d6649b4cec87029fec38
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: decrease file->f_count when play

Frame buffer's (fb0) f_count needed to be decreased after both
overlay play and rotation so that fb0 can be closed and display
will be blanked out after system suspended.

CRs-fixed: 336254
Change-Id: I966e7b2bb4def0c9c09580be12048933723e2c2e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video: msm: Remove redundant code in histogram collection

Rewrites start and stop histogram functions to better use the existing
mdp_histogram_ctrl function.

CRs-Fixed: 310429
Change-Id: Iecc97c1376319021f99dd00eee6fb154bf7a5740
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video: msm: Clear and disable histogram interrupt

When the histogram is disabled, its interrupt should also be disabled and
cleared.

Note: only applicable to MDP4.0 onwards as earlier versions of the MDP
expect the histogram interrupt to be left enabled after running
mdp_histogram_ctrl.

CRs-Fixed: 310429
Change-Id: I5a8df4fdcc41520e1ed0af970a8628479a4645a6
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video: msm: Track validity of and synchronize histogram

Adding mutex to more thoroughly lock histogram calls; additionally,
adding a flag to track histogram data validity. Together they ensure
that the histogram is not started, stopped, or read out of order.

CRs-Fixed: 310429
Change-Id: I276974811a5e673b05c68b41f5fbff5b178165cb
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video:msm: Fix histogram error check logic

Current error check logic is incorrect. Starting the histogram should
throw an error if the histogram current state (mdp_is_hist_data) is
already true.

Similarly, stopping the histogram should only throw an error if the
histogram current state has already been set to false.

In the cases of suspend/resume the mdp_histogram_ctrl calls should only be
allowed when the histogram desired state (mdp_is_hist_start) is true.

Change-Id: Idef307293a7e4fb70807e9cea53078bf3cc67f15
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb : Check validity of histogram bin collection

When CABL is disabled from UI, wait for completion gets killed.
Histogram bin collection is invalid in this case. Add checks
to handle this scenario.

CRs-fixed: 331527
Change-Id: I0c25417672ee44a63011f76f2c998cbef9ae95f5
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: remove while loop in mdp ISR
Fix-up
msm_fb: display: Add SMP-safety for PPP Operations

Adds protection using spinlock for the variable used in
controlling the PPP operations

Change-Id: Iba6ef5e32d38668bd110ed23ee9631aa40de79e0
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
Fix-up
msm_fb: display: clear mixer blending cache during resume

Clear mixer blending cache so that new blending value can
be committed during system resume.

Change-Id: Ie4e8399cdbbdb2153417c19e7f8019f38a294dd6
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>