libmemtrack: Fix compilation warning error

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

Change-Id: Ic4bbba425486bb7f456e928968afa5f2b04ca7ea
liboverlay: Rotator hangs on playing VP9 tile encoded video

VP9 tile encoded video is of Android YV12(MDP_Y_CR_CB_GH2V2) format
Rotator hangs if the source image height is not multiple of 4
for 1/2 downscaling, multiple of 8 for 1/4 downscaling and
multiple of 16 for 1/8 downscaling

Change-Id: I985805e66fd979168c157620eacef711b030e519
CRs-Fixed: 613645
Invoke a padding round in certain use-cases.

* In some use-cases, it is possible that there are
no AppBuffer layers on the external/virtual layer-list
during which all the pipes will be allocated to the
primary. When layers do comeup on external/virtual
layer-list, subsequent overlay sets fail.

* This change ensures that in such cases, we invoke a
padding round on all the displays to free up the
hw resources which can be used in subsequent cycles.

Change-Id: Ifac0b8f51a8719eb55b11010d05b8d11352db054
gralloc: Set default value for implementation defined formats

For implementation defined formats which go via HWC, set the
default value to RGBA8888

Change-Id: Ia1abcbd74c8b44baee34f39cda28740031a64b7c
libhwcomposer: Synchronize Uevent and Composition threads

When Uevent thread needs to wait for composition cycle to be completed
It should be signaled by the Condition variable rather than waiting
based on 2 vsync cycles of sleep, which is not guaranteed.

Change-Id: I5a868c75393d201791e417f5450a8164c6025d68
Revert "overlay: Add tolerance to downscale factor"

This reverts commit c2be636a6c49b760592e8ff50141204c377ed414.

Change-Id: I2b850a8a8d5e11736780a92fd3a8421ace0e2542
liboverlay: Correctly roundoff the Downscale factor

Rotator needs to be engaged for downscale factor
1.3 and above to prevent excessive load on mdp
resulting in underruns while playing 1080p Video
on 720p panels

Change-Id: Ie35d7f90ece080e8f318118974d62f86852df64b
CRs-Fixed: 620313
display : Add wormholeRegion Calculation

For copybit cases we should clear wormhole region
rather than nonwormhole. Adding support to calculate
and clear the same

Conflicts:
    libqdutils/Android.mk

CRs-Fixed: 624456
Change-Id: Ie85d1b484174199e35f43ce95b30de1fac9c30b2
hwc: Enabled COPYBIT for UI layers in VideoOnly composition

When video only layer is getting composed by mdp, UI layers can
be composed using copybit on framebuffer target.

CRs-Fixed: 624456
Change-Id: I29fc68fe2d1bb8f20bdc4056c21e9318d32c807a
hwc: Reset layer composition to GLES if copybit fails

Reset composition type of all the layers marked as copybit if
it fails for any of the layer.

Conflicts:
        libhwcomposer/hwc_copybit.cpp

Change-Id: If81cd5d961ce7802b60192e53ee92d951889a075
hwc: remove waiting for fence in copybit and avoid sending to mdp

- Waiting for acquired fence is not required in copybit draw as Frame
  Buffer target is used for copybit output after egl swap
- Avoid sending the acquiredFence fd to the MDP for those layers which
  are marked for copybit.

Change-Id: I433c16a2c26b03691e6e259fd8cfcb1b37ef8786
hwc: Do not use copybit if planeAplha and downscaling invloved

C2D can not handle plane alpha with downscaling properly, so
do not use copybit for such layers.

Conflicts:
        libhwcomposer/hwc_copybit.cpp

CRs-Fixed: 617718
Change-Id: I879bec6365a09bcaa803ed1a765f1e4dd9999474
hwc_copybit: wait on fb target acquire fence before composition

Copybit need to wait for the FrameBufferTarget acquired fence fd
before drawing on it as it uses FB target buffer for composition.

CRs-Fixed: 623231
Change-Id: I8e79871d307aa74ad608b0e077e3c7605a8b0de8