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
Enable build with postproc if requested

Change-Id: I426683ae7727ee4d598ffdb000e391da00450e3f
hwc: Use rotator for resolution change for all display

Rotator need to be used when resolution change happens for
primary or external display to avoid flicker or page fault.

Change-Id: If4b584c7afb7d2265b1efd7c320ac76ade199b74
hwc: send layer with non-contiguous buffers to GPU

when layer containing non-contiguous buffers are send to MDP,
flickers are observed

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp

CRs-Fixed: 624456
Change-Id: I4bcea959bd4849028368316aae39d1b0b17fa5b3
hwc: Do not use C2D composition for plane alpha

When C2D is used for plane alpha and immediately falls to GPU
   results in flicker for difference in composition

Change-Id: I2ae43c6ed22c829e952a0a4edee7f83c24645172
hwc: hwc_sync - populate correct fences for BLIT

Previously, the acquire and release fences for BLIT
composition were populated using same logic as Overlay,
but BLIT composition consists of separate BLIT step
before screen refresh, and app buffers are no longer
required after BLIT. So holding the buffers for both
the steps is unnecessary and impacts performance.

This change adds condition for BLIT in fence population
logic in hwc_sync and populates the right fences for the
App Buffers and Display Refresh during BLIT composition.

Change-Id: I9998a7052c0375acb32a174bdf0469d2a88f79e8
hwc: Correct Display Commit sequence during WFD-HDMI interaction.

When WFD is active and HDMI is plugged in, the pipes allocated
to WFD(mixer 2) are unset. Call Overlay-commit on mixer 2 to
unstage the pipes correctly. This also makes sure that a secure
WFD session is teared down correctly.

Change-Id: I7531339148e400727549decbde72096f2a7dd798
hwc: Reset previous width and height

If the current YUV count is 0 previous width and height
needs to be reset.

If FLIP is required then do not use rotator for resolution change.

Change-Id: I601cee2eddcf304b9c94d3def19d603c04b18ceb