[2/2] Speed up booting on multicore devices.

Add multithreading support.

Change-Id: I13630de9d75d13c0368d261b3564b787067b65b1
binder: update MemoryHeapIon

* Update from ODROID-XU 09232013 BSP release

Change-Id: I5245c8a9f783e8902bf91a0ee23e60ebeb335b27
Forward-port surface dithering from CM10.2

This allows the use of 16-bit color displays without excessive color
banding;

Change-Id: Icb469b9cb4beb686516c60bb576dbd0a73f505e0
Add sessionId metadata with every buffer queued through Surface

Add sessionId metadata to identify the buffers to be belonging to a
single video session

Change-Id: Ic26cf1d7fdead1c38c0f43e562b7878663d7291c
Display: Add swaprect feature for MDP composition.

Add swaprect feature for MDP composition.
SwapRect is a SurfaceFlinger feature for selective composition
of only thedirty region.
* Existing SF does copying of the complete layer for every
 layer (in effect the full screen) whether or not the layer's
 information has changed (dirty region).
This is very inefficient use of compositing hardware (MDP/GPU).
* At the app level, we're doing dirty region rendering (App only
renders what is changed) using the feature "Dirty Region Rendering".
So, at the app level we know what has changed (dirty region) per
 layer. But SurfaceFlinger doesn't know this info and hence it's
 not able to use dirty region for selective composition and ends up
 compositing full screen.
* For SurfaceFlinger to composite only the dirty region
   1. It needs to know the dirty region (This needs to be passed
      down from the app)
   2. It needs to pass this info to the actual compositing hardware
     (MDP / GPU) so that the hw can do selective composition
* SWAPRECT feature needs to implement 1 & 2.
* 1 is common for all composition types whereas 2 is different
 for each composition type
This change implements 2 for MDP composition
* We've also added strong checks in the feature to make sure the
 feature kicks in only for the UX scenario's where performance
 improvement is expected and no functionality issue would arise.
To enable MDP Swaprect, setprop debug.sf.swaprect 1 and restart
framework.

Change-Id: Iac67acffcd4de1413cdbe0f15a278cc2cd54206f
SF: Add flag for swaprect status in HAL

We need to check in HAL whether swap rect
is enable or disable to calculate wormhole region.

Change-Id: I4fbff4119856e41694e2065141b40fdd7a15f375
sf: Enable swaprect optimization by default only on QCOMs

 * This is confirmed to cause problems at least on i9500.
 * Only enable it by default on QCOMs, other devices can opt
   in using the system property.

Change-Id: Ic00137201f4a5383877f4033473c1ea5ac32a3a7
SurfaceFlinger: Change to support framebuffer flip for 2D blitters

- Surfaceflinger does not flip framebuffers when there are
  no layers marked for HWC_FRAMEBUFFER
- This change checks for the HWC_BLIT flag and will request a flip
  to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers

Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c
Display: Define new composition type for blit composition

This change defines a new flag 'hasBlitComp' to identify
blit composition. This flag is used to enable the swap rect
feature for blit composition cases.

Change-Id: Ic523e19796a893efbfc3bff300d1f982cba5ddfa
Revert "Add sessionId metadata with every buffer queued through Surface"

This reverts commit 85743373ed7d4eb6cb58412bda6c74f9ee29f06f.
This change is no longer needed

Change-Id: Ia5612b42f081236db65ac8eef9d359dfd23f4117
surfaceflinger: Conditional compilation for swaprect feature

 * Since this now calls into the HAL, we can only support it on
   devices which use the new version.

Change-Id: I231d70ac3d17fd2198f3929057c1edb0f158c099
Do not just silently fail if surface creation fails

Some apps do not check if they actually got a surface (e.g. bootanimation)
So this helps the track crashes down to the cause.

Change-Id: I6e74bdb52ad7ebe260b0ec1777c585781f6bbd42
SF: Fix invalid reduction of transparent region from a layer.

Reduce transparent region from a layer only if the transparent
region has valid intersection with the layer. Otherwise, reducing
a transparent region lying completely outside of the layer leads to
invalid sourcecrop values for the layer.

Change-Id: Iee9ba53a8072c21c9ba8a6d58cb14ca30f8600ba
CRs-Fixed: 620973
sf: Determine if virtual display can use HWC for composition

For HWC virtual display using V4L2 approach:
1. HWC virtual display implementation doesn't send output buffer
   back to Surface Flinger.
2. For non-wfd virtual displays(e.g. Simulated Secondary Displays,
   Screen Record, CTS etc..), configure VDS to use GPU for
   composition on output/sink buffer.
3. For wfd virtual display (a.k.a hybrid wfd), use
   Framebuffer surface (similar to external display mechanism).

For HWC virtual display using VDS approach:
1. HWC is allocated for first virtual display connection.
2. Subsequent virtual display sessions will be composed by GLES driver.
ToDo: Modify VDS component to allocate hwcDisplayId based on
mForceHwcCopy (which is based on Usage Flags)

Change-Id: Ib7d2c00ca5fa07908b2eac8085654f8d2cd9af0b
Revert swaprect feature for new upstream implementation.

Revert "Display: Define new composition type for blit composition"

This reverts commit 835f0ad6da60ad5cd5f8d6d872c5665aae6f5584.

Revert "surfaceflinger: Conditional compilation for swaprect feature"

This reverts commit 5e9e33ac72e608d584b13bea176f8fc7f30d88e7.

Conflicts:
	services/surfaceflinger/DisplayHardware/HWComposer.h

Change-Id: I83e3b5a66b9ea7c3bae008d6a7e84c1358c512bc

Revert "SF: Add flag for swaprect status in HAL"

This reverts commit 4fd75c0a371d4ee04e0f583d790b576494257ea8.

Conflicts:
	services/surfaceflinger/DisplayHardware/HWComposer.cpp

Change-Id: Ibd8714a49e09653bf34da466db17fbe4b20c6c8d

Revert "sf: Enable swaprect optimization by default only on QCOMs"

This reverts commit 0438f810c7e8e3c53850874c7bdb74ac43b2ec88.

Revert "Display: Add swaprect feature for MDP composition."

This reverts commit 9b5ef3793b6012e979c10e4cc9a7e091092a4a57.

Conflicts:
	include/gui/Surface.h

Change-Id: I6d276ee82f8f0b4214e79c91cd9675fcbfd57dd4
frameworks/native: Propagate dirty region in hwc_layer

This change propagates dirty rect value of each layer down to HWC
in hwc_layer structure.

Change-Id: I91d87facf4a321b92539de5353faf09b553d4919
egl: Addition of eglGpuPerfHintQCOM

This patch implements a wrapper that hooks into the QCOM
functionality.

Change-Id: Ifcb77e90ba137a4dede7d25663b032df6acc799d
SF: Add known programs to cache.

First open/close application after boot creates
shaders and compiles them we can cache these
programs at initialization, to avoid CPU work
at open/close application and JANK in SF.

CRs-Fixed: 615960

Change-Id: I4837e83941db903e84f195aa052e9e9dab6ff81e
libs/gui: Release acquired buffer when createImage fails

When EGL fails to create an KHR image for an acquired buffer,
release the buffer before returning with error. This unblocks
the dequeue buffer call waiting and may succeed in the next queue.

CRs-Fixed: 624244

Change-Id: I674807f4bb1f1253cb787daaa5a7adf351caaae7
(cherry picked from commit 9e9b12d7f37a6120a705db56a4374e7141c79a41)
Add OMX_AUDIO_CodingAPE and OMX_AUDIO_CodingDTS

Copied from the stagefright-plugins project.

add HEVC decoder and cleanup

Change-Id: I16342228014320161a22302a3c14df7725556cd2