merge in klp-release (no-op)
Use implementation-defined format when HWC writes to output buffer

When GLES isn't writing to the output buffer directly, request an
implementation-defined format with minimal usage flags, leaving the
format choice up to gralloc. On some hardware this allows HWC to do
format conversions during composition that would otherwise need to be
done (with worse power and/or performance) by the consumer.

Bug: 8316155
Change-Id: Iee6ee8404282036f9fd1833067cfe11dbadbf0bf
Add a boardconfig to force HWC composition of virtual displays

When this boardconfig is defined, even when all virtual display
composition is done by GLES, the HWC will be forced to copy from the
GLES framebuffer to the output buffer. On some hardware this allows
HWC to do format conversions that would otherwise have to be done by
the consumer, with worse power and/or performance.

Bug: 8316155
Change-Id: If980ecc589f138cef063eafa757f7f748196713e
Wait for buffers to drain

When a BufferQueue producer disconnects and reconnects, we retain
the previously-queued buffers but empty the slots.  This allows
the number of queued buffers to grow without limit.  The low-memory
killer does not approve.

Bug 11069934

Change-Id: Ia2eaa954c7a3904b54209a3701dba01689e204d8
Only consume touches up until the frame time

When resampling is disabled, it's currently possible to consume
touches after the current frame time. This breaks some guarantees and
could cause unexpected behaviors.

Change-Id: I99908a2cac2df9f795dd4a07188b4451213cf3e4
Merge "Use implementation-defined format when HWC writes to output buffer" into klp-dev
Merge "Add a boardconfig to force HWC composition of virtual displays" into klp-dev
Fix handling of undefined TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS

related to b/8316155 - Implement HWComposer 1.3 w/ virtual display support
Change-Id: I2dc8d65a74174aa833cc491264f97f1f2df49307
Native counterpart of new power manager method

Cherrypicked from master.

b/9464621

Change-Id: I54c0ed50a57ac870da91db8589a73a2c792dbd8d
Bug fixes for SensorService

i) Emulate Flush for AOSP Fusion Sesnsors on newer HALs that support batching.
ii) Early return if there are no events for the current SensorEventConnection.

Bug: 11325707, 11376538

Change-Id: Idb856302463649a99d3d5d0c965bb06ba06b8e1d
Merge "Bug fixes for SensorService" into klp-dev
EGL: rename CallStack::dump into CallStack::log

Bug: 11324229
Change-Id: Ibac1be182c336e7aa5ac098f08d18b3c188964b4
Merge "EGL: rename CallStack::dump into CallStack::log" into klp-dev
surfaceflinger: Allow gpu to render widevine level3.

Allow gpu to render widevine level3 but keep
blocking screen shots.

CRs-fixed: 428647,424769,421767
Change-Id: I914232a062acbb7b17901dbf2b414973230e59d9

Conflicts:

	services/surfaceflinger/Layer.cpp
(cherry picked from commit f4c511eadf2450f1764617245205ffb940b710f8)
(cherry picked from commit 98d7ecf2a82fe6c2a82285b64ea9a8d8da443e9a)
(cherry picked from commit 2dcc6c014c7593d4d18667299718832a339905e3)
frameworks/native: Add support for custom layers in Surfaceflinger.

  - Check for the EXT_ONLY layer and add only that layer to external
    list and do not add that layer to the primary list
  - Check for INT_ONLY layer and remove that layer from external list
  - These are added to support EXTERNAL_ONLY & INTERNAL_ONLY feature

Change-Id: I8f84eeacebf97d44446f319f69b8a73e56f2cb6d

Conflicts:

	services/surfaceflinger/Layer.cpp
	services/surfaceflinger/Layer.h
	services/surfaceflinger/SurfaceFlinger.cpp
(cherry picked from commit 42cd6bd3bc9e8d1e1eaabaaa06d16803b45942bd)
(cherry picked from commit 62af24e70035866aa8e8741a6f058fa8309d0028)
(cherry picked from commit 97112b478210c2adebdc1c0b41b60444e9ce6767)
Add support for custom buffer sizes..

Add native window properties NATIVE_WINDOW_SET_BUFFERS_SIZE to the
perform function of Surface to set the user defined size
of graphic buffers. This is needed for adding support for
the playback of interlaced content.

Change-Id: I8354c29d2ffcc03178fae86dfa449cbefd24ae55

Conflicts:

	include/gui/BufferQueue.h
	include/ui/GraphicBuffer.h
	libs/gui/IGraphicBufferProducer.cpp
	libs/ui/GraphicBuffer.cpp
(cherry picked from commit 989265bbdcaeab8ae59e8615aebc3a20b2775436)
(cherry picked from commit 25c5de066d911c4720cc6570a8bb9e21e899e4fb)
(cherry picked from commit e9a8f7b1f1334d4a36eebde3b3f7ff141ae26bc7)
Surface: Fix gralloc flags conflicting values.

Due to some custom code, unwanted flags (HW) got added with SW flags.
Restrict the flags to custom ones.

Change-Id: I2ab1c75eef4d6d16f0dd7d43aff3c7377486801a
(cherry picked from commit d9b9e1510418e5babf54f34ed8a81cbc368f521e)
(cherry picked from commit 947e0802d55a70aef4c32875f4ddfd2c30576bce)
(cherry picked from commit 4d3419b9185e8f57ff811cf7b14782902c66172f)
sf: Override presentation layer with ext_only layer

Do not add presentation layer to the external list when external only
layer is present.

Change-Id: I46c8a85a572f88a2d4026c4026d99fd037b928be
(cherry picked from commit 9b39ac80890e77177427acec3f6e423085265491)
(cherry picked from commit d5be54b045571e0b9d139bd1022d922137c13bb9)
(cherry picked from commit a72ea507c0587031910e484d989ab32179a7ddfe)
SurfaceFlinger: Dont show Animation on External Display

- With this change the animation effect will not be shown on
  external display.
- It will change from portrait to landscape in one shot.
- Primary would still continue the animation effect
- set property sys.disable_ext_animation to disable animation

Change-Id: Ibd94bf166f08eeab1d504afe69230f7c6a617eb6
CRs-fixed: 453747
(cherry picked from commit 2435bb907b32a7931a2860b7fa984d2e705b5ed1)
(cherry picked from commit 04886a20e6547d12b20f45265fc6ae431b0f9efd)
(cherry picked from commit c6933cb180e67e159a01a75fd36dc8aaaf8b891f)
Surface: Initialize variable and add a defensive check

Initialize buf variable and make sure to check for return
value of dequeueBuffer() before sending to the client.

Change-Id: I0569f2d45825fab0e5d0f38fc91a07990f57c7ab
(cherry picked from commit a6bd7106a7305208f187fbf0a48f14139e33c9d6)
(cherry picked from commit e5d7662d68c5be2b282edd58d4feb68a4d476182)
(cherry picked from commit 885c146144480d4371a0a97df89b8e77f53d3d94)