frameworks/native: Add support for external-only layers.

Add support for external-only layers, used for dual-display
or closed captions.
Do not draw external-only layers.

Change-Id: Ieeb945d8a01f16a61a40433aa388a7c7822dcc8a
SurfaceFlinger: send the orientation information to HWC

Change-Id: I04a30d472ac2d12706b8d82b4bb433598482454d
CRs-fixed: 382796
SurfaceTexture: Add support for drawing non-GPU supported buffers.

Add support for drawing buffers which are not supported by the GPU.
These buffers are drawn using the overlay or C2D. During rotation,
when the draw operation is performed, the GPU clears the clip region
for this buffer.

Change-Id: I7e7abef68ef5aefddaf1596979819ddd66be3681
binder: libsamsungion goes libsecion

Change-Id: I40024b0611ee7f938e238a64e5ee1626f308f0da
native/libs/ui: Adding fix for conf 2.0 seg faults

function call to cancelBuffer was resulted in seg-faults on conf 2.0.
Setting function pointer of cancelBuffer to null in order to select
correct path of execution.
CRs-fixed: 383715

Change-Id: Ic560bf2e19fe22812dacfca1a54148076cc98b13
frameworks/native: fix copy back dirty region

Copyback dirty region logic does copyback,
even when its not necessary causing 2ms delay.
Fix the logic to copy back only what is necessary.

Change-Id: I52de68258ac9f87d704ee5401f93417805fa6773
FramebufferNativeWindow: Fix locking

* No locking needed for query.
* Postpone locking until after fb_post returns

Change-Id: I214afddc1f32295c9fb625d07b27a9d98999859e
Add support for custom buffer sizes.

Add native window properties NATIVE_WINDOW_SET_BUFFERS_SIZE to the
perform function of SurfaceTextureClient to set the user defined size
of graphic buffers.

Change-Id: I1dc2203990a3641fbb9ddab9a86f7e9017f05270
fix build

Change-Id: Id22c93397e759eb013162e9b6baa2db571c0e786
BufferQueue: Increase MIN_UNDEQUEUED from 2 to 3.

If 2 queueBuffers happen fairly closely, the former buffer is not picked by
display. But SurfaceTexture won't return this to clients, since its not the
oldest. It will return the locked buffer causing deadlock.

Increasing the min_dequeued buffer count to 3 (from 2) will increase the
distance between video and display by 1 more.

CRs-fixed: 382393

Change-Id: I275c01473c7057714da35693dfda7a358e9d9285
Revert "BufferQueue: Increase MIN_UNDEQUEUED from 2 to 3."

This reverts commit 1a5f0b044fdb6b8a5c809891cf6942704d7ce8cc.
Allow 3+ undequeued buffers for SurfaceTextureLayer

 * Eliminates launcher jank on QCOM hardware.
 * Original patch from QCOM that set this to 3 globally uses too much
   memory in places where it's not really needed such as camera.

Change-Id: I0153f981a3645f22fdb61b6ea38eeacb3eaf65de
surfacetexture: Add API to set the min undequeued buffer count

 * Needed if we want to globally raise the value to reduce jank. Too
   many buffers causes issues for camera drivers.
 * Change the value back to 3 globally for QCOM targets.

Change-Id: Ifc553fc0ea622974f773550799970b37e80a7c96
SF::Call qcomuiClearRegion() method for mdp composition

Change-Id: I2c36aeea1a71312e1fbd5b56a14c8c183719a8ba
CRs-Fixed: 383115
Fix makefile from the previous commit

Change-Id: Ia245a408cf02ee0d1968bbc05ac181fe1129b9ce
native: Add custom 32-aligned NV12 colorformat

Change-Id: If00faad5b155e8be70ffb48b01992bdf86165dc8
Revert "surfacetexture: Add API to set the min undequeued buffer count"

This reverts commit 7523410a5d3721e84fe96464ff2cf61482137c58.

Revert "Allow 3+ undequeued buffers for SurfaceTextureLayer"

This reverts commit 3c77f875627a504ec8e52a341ce654a4e16a3838.
Merge branch 'jb' of https://github.com/AOKP/frameworks_native.git into jb