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>
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

Conflicts:
	common.mk
gralloc: Use new ION API by default

This conditionally reverts commit b519bb243a1537f7420a2e81bbfa91d38d4ae8dc
and reverses the logic to use OLD_ION_API since NEW_ION_API
is the default.

Change-Id: I3708dff82207844302431296ccfc29421d104442
gralloc: Fix some differences with compatibility code

Change-Id: I0f41ff987b6b3f554e11ea2f259d778c8cee7fa2
gralloc: Use compile time flag for mdss.

The gralloc allocation can happen from processes other than
surfaceflinger in which case we cannot open the framebuffer
device to get the mdp version. Use the MDSS_TARGET flag to
differentiate.

Change-Id: I69bc9ff6004b382a2836274a32fbbd3b2e67dea2
Fix media playout on 8974

Yeah, we need the venus color format on recent platforms, and
I can't reproduce the clean_headers conflict...

Change-Id: I47fcaea999cce01c29681c7acdf456a12785a34e