msm_fb: display: add out of range check for display sizes

MDP pipe or mixer size registers have 12-bit number, so boundary
checks are needed for those parameters. If not, input req sizes could
be very large 32 bit unsigned numbers, e.g. 0xffffffff, unsigned
operations may have overflow to pass all later checks, causing MDP
underruns or hang issues.

CRs-fixed: 380469
Change-Id: I096d7022ede21d54266b46a140782ab0348dd54b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: vsync driven screen update II

Fix whitespace issues from the patch titled
msm_fb: display: vsync driven screen update

Change-Id: I96bf0210c20667486e48f5e20b7525cade098020
Signed-off-by: Siddhartha <agrawals@codeaurora.org>
msm_fb: display:  free writeback buffer at correct time

When mdp pipe is freed at end of video play back, Writeback
buffer is freed while mdp still fetchs data from it. This cause
system crashed and blue screen shows on screen. This patch
will free writeback buffer at correct time.

Change-Id: I46a5031c13d86f943d6604713e1841b482dffe96
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: enable MDP interrupts base on panel interface

Enable necessary MDP interrupts base on panel to avoid
triggering dma_s isr handler.

Crs-fixed: 331668
Change-Id: I139a6193338a1b0a7c9cc7869e3ea1b3f9a65c4d
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha <agrawals@codeaurora.org>
video: msm: Add user-defined backlight scaling

Add method for scaling backlight based off of a user provided ratio and
minimum level for the scaling to be applied.

Change-Id: I494bdd4545e9e02602faa01bed820120cd96298f
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit f0fd8e7323ea0f60539918528a4cfa1edb39b828)
video: msm: wfd: Add turbo mode support

Add support for userspace to push the video core clock to maximum
supported by hardware.

Change-Id: I47295d0fc67d32302312600a90359be23e3fc2c2
CRs-Fixed: 361108
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
msm: display: Set max MDP bandwidths for larger primary resolutions

To avoid underruns for larger primary display resolutions,
set max MDP clock/bandwidths for dynamic boot parameter
cases with HDMI as primary and WUXGA panels

Change-Id: I1e020de0cbd4082edd26d4b03ebee4d4b976c26a
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-msm8x60.c
msm_fb: display: fix iommu leaking

Fixed iommu map buffer dropped after overlay unset by saving
origianl iommu list before zero out overlay pipe structure.

Change-Id: I498dd4cf62e93f4571883fe20a0298e9fad4ccab
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: free dtv iommu buffer

Free iommu buffer after pipe is committed to hardware.

Change-Id: I00506d6fd55d99fec7921c02953fd755a7536d3e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
 msm_fb: display: clear correct pending isr

Clear correct pending isr during irq enable/disable
to avoid un expected side effects

Change-Id: I5e7afc778cb8d5feda40f359ff2aae6493dc7cd2
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix fake iommu buffer drop

During pipe free, some content of pipe is backed up and then after
pipe is zeroed out, the content get restored, in between there should
be no actions to change the content since any change will be wiped out
by the restore.

Change-Id: Ia6da0162d1f9b614682e1fc36edab1db003b42ab
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: camera: Add retry logic if stream ops fails.

During monkey/stability runs the open/close sequence is going out of
sync. This patch ensures that the sequence is maintained and also add
retry mechanism in case stream ops fails.

Signed-off-by: Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org>
(cherry picked from commit 2ddecacee48508b4a89d568c01c9e5ddbdd29999)

Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
(cherry picked from commit 3351b3811abdd9e2158223bda15aac2d01091cd6)

Change-Id: I0f214b4e38ad53dffde5b211b3f54ed7f6e0d914
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

Conflicts:

	drivers/media/video/msm/msm_mctl.c
Bluetooth : hidp: Get the valid hci_conn while unlink

Since the context where unlink will be called is unaware of
validity of hci_conn pointer, fetch the valid hci_conn
before unlink.

CRs-fixed: 370274
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
(cherry picked from commit f411769619b631aa0d9f7d460bcfec4ff3e6f54a)

Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
(cherry picked from commit fce25f117ec7ea4296f550f8ed819dc517f89172)

Signed-off-by: Sunil Joseph <sunilj@codeaurora.org>
(cherry picked from commit 025e910a412c9f5d2e8d247e69afdb3041706a3a)

Change-Id: I60c9024c1c27d18ee2852166eed03a4c8593ca88
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

Conflicts:

	net/bluetooth/hidp/core.c
msm_fb: display: add stage commit before kickoff to WFD

Since stage commit had been splited out of stage up fucnction,
it needed to be called to stage pipes into mixer befroe
kickoff mixer. Add this function into overlay writeback for WFD.

Change-Id: I11e4486d92b89a15e58531033d474b3137b5935a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: upgrade MDP blt mechanism

Upgrade  mdp blt mechanism so that future patches can be
applied without confliction.

Change-Id: I7fef96e2f9e2ad12fa8918f40caf1c6a44f8bf37
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: audio: qdsp6v2: Replace PMEM with ION in Audio Decoder drivers

ION is replacement for PMEM which is less complex with better
reference counting. Hence ION which is a superset of PMEM is
used to allocate memory in the audio decoder drivers.

Change-Id: I0c9458b902bad169d6fcc36dfc66d538c00a6e22
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
msm_fb: display: vsync support for HDMI as primary

When HDMI is primary, dtv is associated with node 0. In this case,
DTV vsync and ctrl need to be called for node 0.

CRs-Fixed: 383877
Change-Id: I425cddf453dd159259883e71f92c32918ca8e6c7
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: display: Enable pre-multiplied alpha for MDP303

For images which are pre-multiplied with alpha, driver
support is now added to blend them properly

Change-Id: I1c07496f9d85c50f1df9eb8d70362ff23dbd90f8
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
msm_fb: display: Add BLT support to dsi command mode panel

At run time, mdp BLT (writeback) mode is enabled and disabled
base on performance level to avoid mdp underrun. Move BLT
enabled/disabled logic to pan display so that enabled/disable
is done per commit instead of per queue. Since all panels
are shared same logic, dsi video mode and lcdc panle BLT logic
have been changed accordingly.

Change-Id: Iee4854b1bb6cc6f249dce0c2ccb39d5b07abe858
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: clean pipe free or unlock calls

A few places have unnecessary mutex unlock calls, and iommu pipe free
depends on pipe parameters so move it before pipe is zeroed.

Change-Id: I67158380ec2d0f1727bebfaf9e6a4a0652d40f30
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>