hwc: Enable MDP_BACKEND_COMPOSITION

 * Add MDP_BACKEND_COMPOSITION flag to resolve flicker

Change-Id: I3dfa680e0c74ccbac69f40dc15e014153ce0b530
libqdutils::Use qcomuiClearRegion for dynamic composition

Change-Id: I7483f6967c6f712af15031c386fb08c8fdae0808
Add support for PIP, picture in picture feature

Add a new state and required implementation in new overlay to support playback
of two videos using overlay.
Add a new class VideoPIP to handle the pip feature.

Change-Id: Ibce7044bc1216cba77bd952e191aed5472ed6737
libcopybit: fix YUV buffer alignments as per gralloc

buffer alignment in copybit should be in sync with
gralloc allignments while allocating buffer.

CRs-fixed: 377051
Change-Id: Ib2ae64e368ea3c92d3494c71da605197ccb4a9a5

Conflicts:

	libcopybit/copybit_c2d.cpp
libgralloc: Allocate buffer Fix.

Fix to allocate buffer of size defined by the client using
NATIVE_WINDOW_SET_BUFFER_SIZE property function.

Change-Id: I29f3e7e85c2f8dd7c11149d78b2681e6478cef78
overlay: Remove OVASSERT from getFormatString utility

Remove OVASSERT from getFormatString utility. OVASSERTS should happen only from
critically wrong states of overlay.
Just failing in this utility method would allow a fall back to GPU.

Change-Id: I4467a750574ee90aee4fa2e0fbb041e7f386a63b
hwcomposer : Use system property to set DYN composition threshold

Change-Id: I15c82d46ec846ff2bff7a1fc7a924bb7fcf844f9
hwc: Set premultiplied alpha flag appropriately

Change-Id: I516dc5c6d3bb4f02c98b4add5e818ae88d08eba4
hwc: Correct default value of dynThreshold

Change-Id: I18aefe755334cb62e43fc2c39cc42fb0fcbadef1
hwc: Call swap buffers even on NULL lists

Swap buffers and UI mirroring must be done even on NULL lists
which are composed by SurfaceFlinger.

Change-Id: I6c840e3dd02dfa447c10bf3f4798114fc74536ee
copybit: Fix crash when copy_image is called with Tile format

Add check for copy_image failure case.
CRs-Fixed: 393122

Change-Id: I5765120e87a135795d771c5d331275a66ade7e23
display: Add support for video rotation on Ext display

- sourceTransform in the hwc_layer_t has the source buffer transform,
  use this transform for external display.
- This helps in showing videos with source orientation properly on the
  external display

CRs-fixed: 387357
Change-Id: I2ac7e5481a27b93d10ba3fc1ad2e4a8788dc20a5
(cherry picked from commit a51a41188d34db49528edadadbf9ddbc052e772d)
hwc: video: Create crop and position structs only once.

Create crop and position structs only once.
Fix bug where x and y were not updated.

Change-Id: I7c6a873ba207997baa302b8999bdaf34cc938dba
hwc/overlay: Add premultiplied alpha support.

Add premultiplied alpha support to video and mdp comp features.

Change-Id: Ieddaf82d5cc43c455bd1c10dbc82b0fc016903ea
Overlay: Change MDP format for YV12 buffers

   Android uses different alignments for YV12 buffers.
   Hence, introduce a new format (MDP_Y_CR_CB_GH2V2) for
   such buffers.

Change-Id: Id4d58dd77f22c9efb8ece9caa34a8717964bf58d
hwc: wait for fb_post, PAN only if target has overlay.

Wait for fb_post, PAN only if target has overlay.

(cherry picked from commit c6e9a0aae817e75b4b5e20ef23edd02a0a627ccd)

Change-Id: I9696c122b3ce5abed2ae2adb9e5929d3664b3add
libgralloc: Fix possible leak of fd

Fix possible leak of fd in ion allocation.
If mmap fails close the fd before returning.

Change-Id: Id414792c14a75259f6075b0d76bc470c31fb5853
CRs-fixed: 387633
libhwcomposer: Reset layer list before clearing MDP states.

This change resets layers flags and composition types
before clearing MDP states.

Change-Id: I03ec173df7dec67348942f307079b506649f592b
hwcomposer: keep secure content in an overlay when below skip layer

Secure content can not be displayed unless in an overlay.  Since
getLayerStats marks all layers under the skip layer for framebuffer
composition, when there is a skip layer on top of protected content,
the protected content disappears since surfaceflinger doesn't draw
protected layers.

Change-Id: I59dd5dffad08dbf578baa459f5f4c726b6674c83
libhwcomposer: Close MDP PIPES in hwc_prepare.

Since MDP is doing a deferred close on pipes after PAN DISPLAY
HWC can close the pipes in prepare

Change-Id: Ia451e3b2e388d1b2199a14e31c3991d5d1b057c8