HWC: Fix for use int reference in function call

To use the integer reference, declared integer
variable to get value directly in that variable.

Change-Id: I1fd1a45580be99dd95ccbc3495e28455a4c7de23
hwcomposer : Fix rotator fence for FB pre rotation.

Add framebuffer to rotator map data structure if
rotator is used for pre rotating framebuffer.

Change-Id: I496656c22b289b0bb0bf8c49056384a7fad3ac7d
CRs-fixed: 569696

Conflicts:
	libhwcomposer/hwc_fbupdate.cpp
hwc: Add deduction operation to Rect utils

Seperate out rectangle deduction from the layer cropping. Update
layer sourceCrop and displayFrame after deducting the rect value.
This makes the function generic enough to be used by other
modules

Change-Id: I587ac951357af823a1bf5e06c15ff47ac6a9c2a0
hwc: Crop source rect for the optimized destination

If a layer destination can be optimized, its source rect
needs to be cropped for the optimized destination rect.

Change-Id: If9a9891200d9cea52b58b253299b4007197cd9e5
Merge remote-tracking branch 'cm/cm-11.0' into kk-4.4
fix fd leak in memtrack.msm8960

Close smaps_fd when exiting function.

Bug: 11007903
Change-Id: I4a9fcd1e84aae195d229e5dd11f99ccb9f6f5006
GCC 4.8 Build Fix
Merge https://github.com/AOSP-S4-KK/platform_hardware_qcom_display-caf into kk-4.4-sm
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