hwc: Add MetaData support in overlay path.

DONE:
    1. HSIC(SPA) test.
    2. IGC R/G/B channel test.
    3. QSEED2 sharpening/smooth test verified through register value check.

Change-Id: Ia9472f489c013df22a3411eeaac3c8d1e6e22ac0
libexternal: disable HPD during initialization.

- Disable HPD at start, it will be enabled later
  when the display is powered on
- This fixes the issue where the HDMI mirroring
  was not working when there was a framework reboot
  or adb shell stop/start

Change-Id: I56d706ebae281297a8ec6517a4fb8e5cdda27617
CRs-fixed: 461820
Merge "hwc: Check vsync state before sending it up"
Merge "libcopybit: Remove usage of C2D_NO_BILINEAR_BIT"
gralloc: Align protected allocations with the spec

The specification for GRALLOC_USAGE_PROTECTED indicates that
allocations with that flag must be protected by securing with
hardware. If such protection is not possible, the buffer must not
be composited. In our current software only the MM_HEAP is
secured. If we allocate protected buffers from any other heap we
block those from being displayed.

CRs-fixed: 465012
Change-Id: I9d47aba3d28192db3fcc394fd6b38efe42ae118b
Merge "hwc: fix dst calculations for right mixer"
Merge "gralloc: Align protected allocations with the spec"
libcopybit: Use blending parameters passed by HWC

Instead of assuming the premultiplied alpha based on the color
format, use the blending parameter passed by the HWC.

Change-Id: Ib494644b6f9c4bf13d8ea28327ccc2058a52aae8
CRs-fixed: 466732
overlay: Use correct downscale for rotator.

Downscale is calculated based on area of dst and src.
Apply sqrt of downscale to each dimension.

Change-Id: I9def4ea5073e0e49a05103505a6b6f5013f0d579
Merge "hwc: Add DMA pipe support in MDP composition."
display: Use cache invalidate and clean correctly

Make sure cache is invalidated before reading in software and
cleaned after writing in software.

Change-Id: I91c471c47a5f1ff11f9960f08091a17ffe575534
libqservice: Change the permission for SCREEN_REFRESH

Change the SCREEN_REFRESH permission from AID_GRAPHICS to AID_SYSTEM.

Change-Id: I8d732282df481695d8241e3087725784825b756d
hwc: Fix alpha downscale check for mdp composition

Do not allow mdp composition when any layer format has alpha channel
and needs scaling as the VG pipes are not supporting alpha downscaling.

In few scenarios, at the beginning/ending of animations Surface Flinger
passes few frames with flag HWC_BLENDING_NONE though it has Alpha.
When such layer passed to VG piple and if needs scaling , it results in
flicker. Hence, just checking for HWC_BLENDING_NONE is not enough.

Change-Id: I70fdfe4547df6fe7b2771ed8042f43aa4e07a71d
CRs-fixed: 462508
libhwcomposer: add dynamic thresold support for copybit.

copybit blit may not be effective if data for composition
is high. Add configurable threshold support beyond which
we can avoid copybit blit. set default threshold value to
2 times of fb resolution.

CRs-fixed: 462450

Change-Id: I0ee77ea1d761dc370d82ade1724caefbecfa01f5
gralloc: Override gralloc calculated size only if bufferSize is greater.

bufferSize set using native window set buffer size will override gralloc
calculated size only if bufferSize is greater.
Fix for 720P, 1080P HD content playback is not working on 7x27A due to
buffer size mismatch between requested size by frameworks and allocated
size by gralloc for HAL_PIXEL_FORMAT_YCrCb_420_SP and
HAL_PIXEL_FORMAT_YCrCb_420_SP format

Change-Id: I16d04e406ab8f1f35e0e0a70e19d99a019adc5ef
CRs-Fixed: 451783
hwc: Configure pipe for FB even if we exceed max layers

Even if we exceed max supported layers, configure pipe for FB
Because FB contents are always displayed using hwc

Also some minor code fixes

Change-Id: I740ab7e908c916373b1d87facd831e09098ce753
hwc: Processing of HDMI connection request when WFD is active

  when HDMI is connected during active WFD session, teardown
  WFD and process HDMI connection request.

CRs-Fixed: 442226
Change-Id: I4b22ff9f1ab3175bab47babdaf040cb2289ebe4d
hwc: Use correct z-order in video overlay

Set z-order of video layer to 0 and framebuffer to 1 in case
of video overlay composition so that the blending takes effect.
Also set is_fg OFF for framebuffer.

Change-Id: I05f930074d265d690f29a1003b7c28077df89bbf
CRs-fixed: 458180
Merge "libexternal: disable HPD during initialization."
Merge "libcopybit: Use blending parameters passed by HWC"