qcom_display: add TARGET_PROVIDES_LIBLIGHT

Change-Id: Ifa4984a3dc4b938fb89d6c65c8cda931d643f3c6
Only build CAF display variant when requested.

Change-Id: I273b9e16afa011445e185fdaf1e7cf2f029b077c
Update include paths

Change-Id: I463eb0a6693ec5da41118f132d8dcdb0d11e4be8
overlay: Bring back debug.mdpcomp.maxlayer

 * We're having underrun issues with 4-layer composition. It generally
   works, but when the system CPU ramps down and the device is mostly
   idle, underrun is happening.
 * Limiting to 3 layers solves the problem temporarily on these devices.
 * Readd the option so that the issue can be debugged without afflicting
   our current users with massive amounts of flickering.

Change-Id: I7ab7d013f65eaf12a3d21a91229dcaad6a815069
display: Add support for MDP 4.1

 * MDP 4.1 does not support the borderfill pipe and the baselayer logic
   should not be used.
 * Only use 3 pipes for MDP 4.1.

Change-Id: Ide542079902f35818300619f8eefd3d188342b5d
Fix ION_IOC_MAP error on old ion api during drm video playback

Video playback in the Google Play Video app would
result in an ION_IOC_MAP invalid argument error and
the app to display error 22.

This fixes some old ion api code left out with the
"display: Reconcile display HALs" commit which resulted
in the invalid arugment or an out of memory error.

This was found using a Nexus 4 (mako) and the Google Play Movies
app while attempting DRM video playback.

Change-Id: I2f7724515cbb7449086611fb79d042ea71d6eb39
qcomBSP:  put check on new ionalloc

* prevent compile error when trying to init the same thing over
Tiny changes to support media codecs with vanilla driver.

Change-Id: I5415b6af1b13c4d9e95dfe4199325274b1d0f3eb
gralloc: Let gralloc_priv.h be overloaded by device trees

Adjustments to private_handle_t may be necessary for device-specific
blob compatibility, so don't enforce usage of the local header

Change-Id: I588ca59ed76b1a063a4b663ac2c98589865b7738
copybit: Fallback to SF heap when IOMMU isn't available

Change-Id: I0baa43a84fa12f8dbde8e958f1bb37f7a46f388b
display: Use actual kernel headers for all builds

Change-Id: I1add22c0bc33942bc8f89dbb37333bf08d49bf72
display: Fix support for MDP 4.1

 * MDP 4.1 still does not support the borderfill pipe, baselayer logic
   should not be used.

Change-Id: I587bdff4a03ced141e43819eea70cec1aedaeb7b
gralloc: Add workaround for Jellybean camera drivers

* Arcee is smarter than I am, and discovered that we can simply swap
  two fields to ensure compatibility with Jellybean camera drivers
  having the metadata fields in the private_handle_t struct.
* Enable this by defining QCOM_BSP_CAMERA_ABI_HACK.

Change-Id: I2cd267dd5550404cf2e61d76fb805e780cd99d3c
overlay: Add tolerance to downscale factor

In certain corner cases for 1080p panels, round doesn't get us
the right downscale factor resulting in MDP attempting to go into
blt mode. Add a tolerance for failure.

Bug: 9322550
Change-Id: I2be4715955d9e248fc63e408dc4a2cdf493152f6
Signed-off-by: Iliyan Malchev <malchev@google.com>
Add support for white LEDs

Bug: 9079860
Change-Id: Icc981682a274546c1414bd7c0b0045b1293575bf
display: Remove libmm-abl dependency

This lib no longer needs to be linked to any component in the
display HAL.

Change-Id: Id332d3cb22fc35e16f655d4c6127d6f1891330b0
hwc: Add support to enable CABL for video use case only

Set property "persist.qcom.cabl.video_only" to 1 to enable this
feature. With this feature, CABL will be turned on only during video
play cases. CABL will turn off for UI cases.

Bug: 9414907
Acked-by: Ping Li <quicpingli@codeaurora.org>
Change-Id: I7dee9e03685bdf8e5f69ad5004e63f15dd028333
Signed-off-by: Iliyan Malchev <malchev@google.com>

hwc: Ignore SIGPIPE error when communicating with ppd

This avoids a potential crash in HWC if a SIGPIPE is thrown due
to failure communicating with the other end.

Bug: 9414907
Change-Id: I7f1de4f2ff0f287de4cad29dd92a6e964ba50224
Signed-off-by: Iliyan Malchev <malchev@google.com>

hwc: Don't run CABL when HDMI is connected

There is no power benefit with CABL when HDMI is on.

Bug: 9605980
Change-Id: I57b3af493e0af54db520fea04dc3a2d007943b82
Signed-off-by: Iliyan Malchev <malchev@google.com>

hwc: Don't kill ppd when HDMI is on and primary also has video

There is still a power impact when video is playing on primary
with HDMI connected.

Bug: 9680403
Change-Id: Ia12710194ea6ebc677c7a86731a409333853ccfc
Signed-off-by: Iliyan Malchev <malchev@google.com>

hwc: Set a timeout when communicating with CABL

Bug: 9669813
Acked-by: Ping Li <pingli@codeaurora.org>
Change-Id: If0f65e9ee100b368e46f8f6d4edf9d7a93120bed
Signed-off-by: Iliyan Malchev <malchev@google.com>

hwc: Handle the broken pipe issue between hwc and ppdaemon

If broken pipe is detected, close and then re-establish the connection
between hwc and ppdaemon.
Acked-by: Ping Li <pingli@codeaurora.org>

Bug: 9850103
Change-Id: I68ff21b93ab5b40608ca9ab4951adaa9d75fa17e
Signed-off-by: Iliyan Malchev <malchev@google.com>

hwc: Resend the command after broken pipe is fixed

Bug: 9850103

Change-Id: Ia2ee8019394ce1397fe7eaf73a44a00b0b78e88c
Acked-by: Ping Li <pingli@codeaurora.org>
hwc: Get the retire fence from the MDP driver

Get the retire fence separately instead of duplicating the
release fence.

Bug: 9319776
Change-Id: Iacb773c2d94f635e27a7b355d399cb2e36dac2a5
Signed-off-by: Iliyan Malchev <malchev@google.com>
gralloc: Backward compat for devices using older camera heap

Change-Id: I5d3feadd0c4dd629fcb3a750e9d4be0c6b3d6a6f
display: Add flag to allow legacy allocations from MM heap

 * New devices with IOMMU use the MM heap exclusively for protected
   buffers. We need to support the old behavior for devices with legacy
   userspace.
 * Enable the old behavior with TARGET_DISPLAY_INSECURE_MM_HEAP.

Change-Id: I7882354fa8f159c707be11d7021c18561abfb522