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
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
hwc: Silence some logging

Change-Id: I3eb64b2557ce1d533486c89ac2bd648522bf74ca
Disable Mixed mode for External

Disable Mixed mode for external only in the case
involving alpha scaling due to limitation of VG scaling
MDP4_OP_SCALEY_PIXEL_RPT algo to upscale RGB layer

Change-Id: Ic074c712b657bf0be6ba2262b08e315e33dd76c7
Crs-Fixed: 567571
Revert "HWC: Check for proper MDP version to enable C2D comp"

This reverts commit 88e2b9cef6827506467599995e921374ff334ee0.

Change-Id: I092b2c073280b52bd1280fbddbcc09a805800200
hwc: Make the fallback to Copybit composition a compile time option

- let only the devices that actually need it to use this code path
  (it breaks the transition animations on S4 Plus devices otherwise)

Change-Id: Ie6dadf5f0b32631c355eb41e6a0e77ed4e08f763
Remove AOSP reference to utils.mk

Remove function calls from AOSP code to utils.mk
& replace them with actual definition.

Change-Id: I2ca64995e54dcc535b5f69fe448e190615b74b94
CRs-fixed: 566287
WFD video playback scenario in downscale mode.

In case of downscale usecase, correct params are
not getting set for external/virtual.
This was due to missing function call
calcExtDisplayPosition in configureLowRes
for RGB layers.

Change-Id: I47fe556d84eef15827e6e5733359654f8970e406
Crs-Fixed: 565655
Initial memory tracker HAL

Squashed commit of the following, from AOSP display:
libmemtrack: Add libmemtrack to HAL directory listing

Change-Id: Ifbe55a339d589ad1bfab07fef684a738976877bd

commit 454565c66a5d068c0722aa3bb1fccc4c383a5808
Author: Colin Cross <ccross@android.com>
Date:   Mon Sep 30 13:09:02 2013 -0700

    fix fd leak in memtrack.msm8960

    Close smaps_fd when exiting function.

    Bug: 11007903
    Change-Id: I4a9fcd1e84aae195d229e5dd11f99ccb9f6f5006

commit 28c93c950cd82667a43dd0dd64043274eb7a1e55
Author: Colin Cross <ccross@android.com>
Date:   Mon Sep 16 15:16:08 2013 -0700

    Fix remainig exynos references

    Also fix a compile warning by replacing enum with int in the getMemory
    function.

    Change-Id: Ic4bbba425486bb7f456e928968afa5f2b04ca7ea

commit b46313b2e4d0e7fd1a475bf26ce396bcd0243921
Author: Colin Cross <ccross@android.com>
Date:   Fri Sep 6 18:03:02 2013 -0700

    Initial msm8x64 memory tracker HAL

    Reads memory info from kgsl to track unaccounted for GL and ION
    memory.  Right now it has to parse every allocation and then
    cross-reference it against /proc/pid/smaps.  It would be faster
    to modify the kgsl driver to keep counters that could just be
    read directly.

    Bug: 10294768
    Change-Id: Icb17558f03ce53bc594fbee097e51fe82e15dc31

Change-Id: I7816cf5f506ac94229646013683bdba674110ede
memtrack: actually replace remaining exynos references

Change-Id: I4c648c9414ffcf8b94c96b68bab7bb66dc516196
gralloc: Perform function to return custom stride

The custom stride can be set by video for smooth streaming.
Return this in perform so that graphics can use it.

Bug: 10192531
Change-Id: I798fc0894b8d9662e93769a53a540cb61b527a44
hwc: Enable rotator during resolution change.

MDP VG pipe framesize register is not double bufferred.
It introduces corrupted frame during resolution change especially when
rotator is not used. Enable rotator to handle the transition case.

Change-Id: Ifec55fee0c762dfb12a09580b80dca6f051a1c86
Acked-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>