msm: ion: Only return Ion flags in ion_handle_get_flags

Since the ion_buffer.flags field is shared between the actual Ion
flags as well as the Ion heap mask, make sure that we're only
returning flags. The heap_mask bits should be masked off.

Change-Id: Ibdaf0ea374b7b80a036bddd11d19c4bafa173ef6
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm_fb: display: wfd with vsync driven frame push

To improve performance, hardware vsync event at mdp driver
is passed to framework so that both composition and frame
update are aligned at vsync event. This patch will upgrade
wfd to incorporate vsync driven frame push in consistence
with other interfaces.

Change-Id: If088826ec387446301f1f6acc311d909edb04163
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm_fb: Wifi display changes for commit ioctl

This change handles panel updates for WFD panel via
overlay_commit interface, along with conglomeration of
some common code across pan_update and overlay_commit ioctls

Change-Id: I092180a4f2be801cd5b9008e99d0b712d089746b
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm_fb: display: empty pending queue during suspend

Overlay_play() adds a pipe into pending queue and pan_display()
will commit those pipes to hardware and empty queue. This patch
will make sure queue is empty at suspend so that no unexpected
pipes will be commited to hardware by pan_display() at resume.
Otherwise, iommu page fault may happen.

Change-Id: Iafdf469c6cdbf5d469c9dee114555a8d1adb9c66
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm_fb: display: empty pending queue during suspend for wfd

Add the logic for wfd writeback interface. It already presents on
other display interfaces.

Change-Id: I389be77ec18041e260d0e71940586e86f1841ff8
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm_fb: display: add config of wb_mux_sel during update

To make sure for each writeback play the reg is configured and avoid
mdp hang.

Change-Id: I29bdc31f27accca84e7add126c1c1e3c8a78fa15
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm_fb: display: add wfd clk ctrl in pipe_commit

mdp_clk_ctrl on is not called when commit is from overlay commit path
which can cause mdp hang. mdp_clk_ctrl off should be after mdp
overlay2 is done, so schedule a work in overlay2 done isr.

Change-Id: I94fd08da27cfda114f5cc0056a5103f0a9b772f6
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: Add switch node mechanism for wfd

Add switch node mechanism for WFD to indicate the
connection/disconnection event.

Change-Id: I7623e50ba8053602e4b2924d75c0e23b641e2b9a
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
video: msm: Handle MDP_REV_43 MDP identity

Earlier code improperly labeled MSM8960v3 devices as MDP_REV_42. When this
bug is fixed the devices fails to boot. Update checks that exclusively
check against MDP_REV_42 to allow MDP_REV_42 and greater.

Change-Id: I34909cd3cb4a6b937f641737328a0b2ea45a22fc
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Add logical display id for post processing

Define logical id for display backend processing.
These ids are independent with hw implementation, could be used
for MDP4, MDP5 and future ASICs. Kernel driver implementation will
also be abstracted to the post processing user.

Change-Id: I0ce92120e2e008f9acbb934fef0ff7654f27b39b
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
(cherry picked from commit 6a431631728d2d217447079dd636bd1e26d56ac4)
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: PCC/GC config register protection

PCC/GC configuration registers are shared with other features. This patch
makes sure that the other features implementations don't overwrite the
existing settings for PCC/GC.

CRs-Fixed: 345395
Change-Id: I5467a4c50eae214181d67a7976eee92c0ae26fe5
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 65fe6e713f7ca6b662c2cf4ce7335e22ca371118)
video: msm: Allow PCC/GC to be disabled/select bins

Current implementation would not set enable/disable bits to PCC/GC nor be
able to select the zero'th bin after selecting the first.

Change-Id: I0f52beb8914cdaecbabe913455c00fb9ea6100db
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 59e7b0e47eaee57850157361f31c230b3e1c8a8f)
video: msm: Remove an ifndef from mdp_isr

Remove ifndef so later patch does not require adding more ifndefs.

Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 20582a5cf3fad8e9fda7ded6478ed8a32b376b97)

Conflicts:

	drivers/video/msm/mdp.c

Change-Id: Ia06e844f42086ad76019f66b575ed78a40ebafc4
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Finish histogram collection framework for MDP blocks

The patch "Add Histogram collection framework for MDP blocks" was included
on this branch; however, it was an incomplete version. The additions are
more histogram function pointers and better comment formatting.

Change-Id: Id5fb20f07f2c50eb678fd8f57238f4ef3d77acb0
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 7b8b64075ee4b61c15e28f3042672b26674e0b45)
msm_fb: Increase backlight granularity from 15 to 255 levels

Currently number of backlight levels are set to 15, which causes
noticeable flicker when backlight level is changed from CABL
functionality in userspace. So to improve visual performance,
increase backlight granularity from current 15 levels to 255 levels.

This change is for msm8960 & apq8064 liquids which use Chimei panels.

CRs-fixed: 342485

Change-Id: I204f881d45fbcd4a419cc8e61c3bcb1f4d520f7e
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from eee66c6ffa18c954fa2583fdda66526f90bad40b)
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm_fb: Increase PWM granularity to 255 levels for 8960 fluid

Currently 8960 fluid display panel only supports 100 levels for backlight.
Content Adaptive Backlight Control requires 255 levels of backlight for
optimal user experience with CABL turned on.

CRs-fixed: 342485

Change-Id: I02226a7790f2dd0144c1eb623c8177724e33a715
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from commit 9f1453ec3eb2b22160d25148a45f1731a23d4c95)
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Clear previous histogram data on next startup

Clear the pointer to the userspace histogram struct when histogram is
started. Previously, when the histogram was stopped while a histogram read
was in progress, the pointer was not cleared, causing the next histogram
read to think that someone was already using the histogram.

CRs-Fixed: 361640
Change-Id: If09017149e98b35c49603372c554aa4c97f2de82
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 19e4b71f617e307cacf0be077e08bec5c37df290)
msm_fb: Add histogram support for MPQ 8064

Currently, there is no support for histogram on MPQ 8064. Add
support for histogram ioctls to support histogram testing.

CRs-fixed: 375580
Change-Id: I24ccf73c6ea6d230da4624ea196cba2d8195f8b2
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit c8430bd159039340c5a50e6897b256631f5dc7bb)
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Remove old post processing overlay integration

Remove old implementation of HSIC and QSEED smoothing/sharpening overlay
integration. Need to replace with new implementation that better integrates
the existing functions of the two APIs.

CRs-Fixed: 380750
Change-Id: Id3469fad16764ed88e74a8da75bb873f726ba366
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
(cherry picked from commit 3118cb077358e472adb0db8e207a63bd84fd267f)
video: msm: Add CSC and QSEED support to Overlay API

Add support for CSC and QSEED configuration through MSMFB_OVERLAY_SET and
MSMFB_OVERLAY_PLAY ioctls. Provide better integration than previous attempt
with the existing Overlay and PostProcessing APIs.

CRs-Fixed: 380750
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit dfe5751941ef2478c57565f8ebca09623d83a8a4)

Conflicts:

	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	include/linux/msm_mdp.h

Change-Id: If895391074ef1e7d7a6824d289e1ed9da6a52180
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>