• Home
  • History
  • Annotate
  • only in /frameworks/native/services/surfaceflinger/DisplayHardware/
History log of /frameworks/native/services/surfaceflinger/DisplayHardware/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3c085a07a84bc03aefb2c0caf24a1ae1a9f5f90c 10-May-2018 Lloyd Pique <lpique@google.com> SF: Initialize DisplayDevice with the active config index

This is a port of aosp/580542, with added unit test changes now that the
correct config is being set in the DisplayDevice.

Bug: 69807179
Test: atest libsurfaceflinger_unittest

Change-Id: I51c13678bc28c715fa116ad127478d4afa3d0349
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
306e499d2599edb882f4e3f85a438e5f4497f773 08-May-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Fix HWComposer error message.

BUG: 79362190
Test: build, flash and verify with adb logcat
Change-Id: I507cb53d9e291f5fe53134e820ceb6fda3e341d7
WComposer.cpp
56a9e5d33ce9a60f042288ef8b62952d44ffec4c 19-Apr-2018 Dominik Laskowski <domlaskowski@google.com> SF: Clean up HWC validation

This CL adds macros for validating HWC displays and return values.

Bug: 74619554
Test: Build
Change-Id: I9f8eff97255087d13fe975f3fc45cfbb6d4ea4d6
(cherry picked from commit fc2c032b2c1bec0494f1a69497aafa2df4992dc5)
WComposer.cpp
2c327ac2840b34848543cc961d16d3dbad102f16 20-Apr-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Plumb getPerFrameMetadataKeys and setLayerPerFrameMetadata.

This patch compresses supported metdata types into a bitmask and stores it in
DisplayDevice and refactors the code in Hwc2::Layer regarding HdrMetadata. When
DisplayDevice is created, the ability of accepting metadata will be queried
from hardware composer and stored in DisplayDevice. Hwc2::Layer will construct
HdrMetadata to PerFrameMetadata when setPerFrameHdrMetadata is called if the
incoming meta data is changed.

Previously, setLayerPerFrameMetadata was named as setLayerHdrMetadata, but
since we move the responsibility of constructing PerFrameMetadata from
ComposerHal to Hwc2::Layer, we change the name to setLayerPerFrameMetadata,
which is more generic and matches the HIDL interface.

BUG: 77831156
Test: Build and flash
Change-Id: I447956f4dcf42c90ceb3d29091cd5034ad91061a
Merged-In: I447956f4dcf42c90ceb3d29091cd5034ad91061a
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
3c89463809229f53bdcfc7f3116beb5b222428fb 03-Apr-2018 Dominik Laskowski <domlaskowski@google.com> SF: Clean up name lookup in ComposerHal.{h,cpp}

Bug: 74619554
Test: Build
Change-Id: I3096c67dbd994a5df087d8744934ba3c0b8bf9e3
Merged-In: I3096c67dbd994a5df087d8744934ba3c0b8bf9e3
(cherry picked from commit 6231aaf11145a20676d9e759073aa400d78885a6)
omposerHal.cpp
omposerHal.h
6266589793ddd9769a649a6b5f61ef115179572b 16-Apr-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Extend HDR support.

Previously we stored HDR10 support in DisplayDevice. This patch extends and
generalizes the support to HLG and Dolby Vision.

Minor: Adapt Hdr type from HAL.

BUG: 73825729
BUG: 77156734
Test: Build, flash, watch Youtube HDR
Change-Id: Id642bc9482523b4646814dca9ecfb1f043987dc5
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
0e7a791d51e92aafefd416044a2d38b6eec22a00 05-Apr-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Plumb HAL to hardware composer.

Previously we introduced HIDL interfaces for Auto Color support. This patch
implements HAL interfaces in DisplayHardware/.

BUG: 73824924
BUG: 73825729
Test: Build
Change-Id: I4f2011bfa9306552d50a88fe0f065932be3efd0c
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
34beb7a0ff0494b0c5ad81104171f8a49e599163 28-Mar-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Replace android_dataspace with Dataspace.

This patch replaces all android_dataspace in SurfaceFlinger with Dataspace
V1.1. 3 commands in sequence are used to do the conversion:

find ./ -type f -exec sed -i -e 's/android_dataspace_t/Dataspace/g' {} \;
find ./ -type f -exec sed -i -e 's/android_dataspace/Dataspace/g' {} \;
find ./ -type f -exec sed -i -e 's/HAL_DATASPACE_/Dataspace::/g' {} \;

With some minor tweak because most of the APIs in frameworks/native are still
accepting android_dataspace/android_dataspace_t.

Next step is to convert the rest of android_dataspace usage to Dataspace in
frameworks/native as well as frameworks/base.

BUG: 77156734
Test: Build and flash
Change-Id: I2304c7014cb49a1c9f67c4563603fb55e8dbd679
omposerHal.cpp
omposerHal.h
ramebufferSurface.cpp
ramebufferSurface.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
0cab4a530234efe62ab279ced52744de8833a69a 03-Apr-2018 Chia-I Wu <olv@google.com> Merge "surfaceflinger: fix per-frame metadata to be per-layer" into pi-dev
63e3a5e6ce7ffcbac2eaa65fe4f1ccf98f781a79 02-Apr-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Removed unreached return statement.

This bug was introduced in ag/3818244.

BUG: 77466401
BUG: 77156734
Test: Build
Change-Id: I22b57e9b9dc7a517180c5aed25c907d5c8f2674c
WC2.cpp
bcbd53c5b6330ebd08fef2e1d8256b6ceb1c0317 30-Mar-2018 Chia-I Wu <olv@google.com> surfaceflinger: fix per-frame metadata to be per-layer

setPerFrameMetadata is renamed to setLayerPerFrameMetadata.

Bug: 32148660
Test: builds
Change-Id: I4a6a8eb3479c4535277a2de1f432cf7f6fa95db4
omposerHal.cpp
36d8ba87141022784b4f1dede894bfd039d14f8e 30-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "surfaceflinger: minor dumpsys improvements" into pi-dev
fd997e0969100418b4df8b8d97d21d497afa76c3 29-Mar-2018 Peiyong Lin <lpy@google.com> Add proper namespace to GraphicTypes.

Renamed GraphicsTypes.h to GraphicTypes.h and added proper namespace to avoid
naming conflict.

BUG: 77156734
Test: Build and flash
Change-Id: Ibd9f454b5b72d5f8c6d94a3869a60a1bf821f106
Merged-In: Ibd9f454b5b72d5f8c6d94a3869a60a1bf821f106
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
1e04361db1b65d3998edbf820078ccfaed477cb6 01-Mar-2018 Chia-I Wu <olv@google.com> surfaceflinger: minor dumpsys improvements

In the order of importance,

- fix eglGetConfigAttrib calls
- mark Zs as relative in minidump
- dump DisplayDevice wide color states
- rename pixelformat to defaultPixelFormat in layer state
- better grouping and indentation for DisplayDevice dump

Bug: 76415976
Test: dumpsys
Change-Id: If9254ffe43cb1de82d562fcc27e828d54eba9387
ramebufferSurface.cpp
bc79209c0b392f2d450658167d01f8d8b13cbb96 17-Jan-2018 Lloyd Pique <lpique@google.com> SF: Switch to internal display setup

Rather than call the public hotplug() functions, which may have
undesired effects, set the internal state directly for a display in the
middle of being connected.

[Test execution time not significantly reduced]

Test: libsurfaceflinger_unittest passes on Pixel XL
Bug: 74827900
Change-Id: I604ff7267e7ea3af94095ca05e288ef18e248ee5
(cherry picked from commit a618d855a2c1192c3817863b373a9cbfcba3ffbb)
WC2.cpp
WC2.h
3bed0524e31f5f1844909006d952ff72196b98a2 20-Mar-2018 Steven Thomas <steventhomas@google.com> Fix frozen screen after exiting vr

When a hotplug connected event occurs, don't recreate any
already-existing entries in mBuiltinDisplays. This fixes a problem where
the screen would freeze after exiting vr.

In the future, we may want to use hotplug connected events to notify
surface flinger to reinitialize display state. This CL includes a change
to the code in HWC2.cpp to always reinitialize the display state when we
get a hotplug connected event, even if the display is already connected.

Bug: 74985350

Test: - Confirmed exiting vr no longer freezes the screen.

- Added code to simulate a hotplug connected event while the device is
running, to test the changes in HWC2.cpp. Confirmed the device
continued to function normally.

Change-Id: I6afda67cae84842b2568c773e6b5aa4f38df6a96
Merged-In: I6afda67cae84842b2568c773e6b5aa4f38df6a96
WC2.cpp
a52f0295622a42849f5ef81c44589b816b2ccacb 15-Mar-2018 Peiyong Lin <lpy@google.com> [Native] Replace android_color_mode usage with ColorMode.

To ease the pain when we add color mode v1.1, we replace all current
android_color_mode usage in framework native with ColorMode directly from HAL.

BUG: 73824924
Test: Build & flash
Change-Id: I4436fc225c7807506825c7148bc794cb99f278dc
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
301bb3097c267e6dbab25f6099403269b75a4e1c 12-Mar-2018 Courtney Goeltzenleuchter <courtneygo@google.com> Do not send HdrMetadata on older interface

Need to make sure composer@2.2 is supported before sending
HDR data across composer interface.
Test: boot
Bug: 74523164

Change-Id: I551c8568098990193309939483f10a30cc47350c
omposerHal.cpp
f9c98e552b2ca404200048d8a78244e4fa080223 12-Feb-2018 Courtney Goeltzenleuchter <courtneygo@google.com> SF: Update to composer@2.2 implementation

Bug: 63710530
Test: adb -d shell am start -n \
com.drawelements.deqp/android.app.NativeActivity \
-e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.hdr_metadata.* \
--deqp-log-filename=/sdcard/dEQP-Log.qpa"'
Change-Id: I5412eae0a001406e058cd6687b02f3a37c82a7f1
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
fb0aa3da65ca60f5c9d69f9760faf2c81e4d294b 16-Feb-2018 Steven Thomas <steventhomas@google.com> Merge "Fix "invalid buffer slot" hardware composer error"
b6c6ad48fb0d6ad51d660a7b1ef72a1bdd8198d0 29-Jan-2018 Steven Thomas <steventhomas@google.com> Fix "invalid buffer slot" hardware composer error

For virtual displays we weren't calling setClientTargetSlotCount(),
leading to "invalid buffer slot" errors from the hardware composer
service.

Bug: 69814692

Test: Observed the "invalid buffer slot" errors are gone.

Change-Id: I2268acd7d59dcbe2a943ddf388d88632a8b81b5d
(cherry picked from commit 8f1110776981bf35d5952532f99f32d9420dc017)
WC2.cpp
e39cad28aa810490861512e0ada7757c2887f8c5 21-Dec-2017 Lloyd Pique <lpique@google.com> SF: Add a first real unit test

Use the newly defined mocks to substitute for the real instances,
allowing a simple direct test of
SurfaceFlinger::processDisplayChangesLocked(), for the case of a display
being added.

[Test execution time 25ms]

Test: libsurfaceflinger_unittest passes on Pixel XL
Bug: None
Change-Id: Icdb763ecc3adb1a8bf04268f3dc5716606e6e7e8
WComposer.h
d0094aaeba95917949b80f491924aeb21077778e 21-Dec-2017 Lloyd Pique <lpique@google.com> SF: Define Hwc2::mock::Composer

This allows the unit test to use a mock in place of android::Hwc2::Composer.

Test: Code builds
Bug: None
Change-Id: Ia6f0df083d579cf69e97abc2ff7f2d3f5789a320
omposerHal.h
a822d52f1a7f651bf1056f4b99e7b8dd214c2ebb 21-Dec-2017 Lloyd Pique <lpique@google.com> SF: Separate Hwc2::Composer into interface and impl

This makes the android::Hwc2::Composer substitutable. In this case the
intent is to allow a mock::Composer GMock class to be defined.

Hwc2::Composer now is a pure interface class. Hwc2::impl::Composer is
the normal implementation.

Also included is another minor change to allow HWC2::Device to be
constructed with a Hwc2::Composer (interface) pointer instead of a
service name. This means that now SurfaceFlinger itself constructs the
Hwc2::impl::Composer using the service name, rather than passing it down
a call chain.

Test: Code builds
Bug: None
Change-Id: Ic79f645cee40c534651b9c7b70f05497d98e51dc
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
87551225ede71b5b64cd3bf14ed0d0daca2be356 16-Jan-2018 Courtney Goeltzenleuchter <courtneygo@google.com> Update hwcomposer include paths

In preparation of new hwcomposer interface, updating
existing includes to include specific version.
Bug: 71513561
Test: compile

Change-Id: Iab13368f782067f255f7dee5318bfd57872f30dd
omposerHal.h
0c114599e52bfcbe2b5ff0b734c9f8ca11de8879 19-Jan-2018 Matthew Bouyack <mbouyack@google.com> Merge "SurfaceFlinger: Change to support client target flip"
88a905b9aff600150916a644d5bfd01a31c0ba82 04-May-2017 Madhuri Athota <mathota@codeaurora.org> SurfaceFlinger: Change to support client target flip

- Add support to flip framebuffer target if
HWC2 implementation requests for it.

b/38114488
b/68271386
CRs-Fixed: 2057401
Change-Id: I91422ef60a139cbaf491db219b216cd1252e7e63
Signed-off-by: Madhuri Athota <mathota@codeaurora.org>
WComposer.cpp
WComposer.h
2ae2b3bd5bfbacc3b52f222441bfbbeb9bd54dc7 15-Dec-2017 Lloyd Pique <lpique@google.com> Allow a primary display disconnect

This patch forwards the primary display disconnect event to the
Framework, and otherwise ensures that SurfaceFlinger does not crash
while there is no primary display.

Note that the Framework does not yet accept this change. In particular
the ActivityManager ActivityStackSupervisor code promptly asserts that
one cannot remove the primary display. With this assertion disabled, the
framework does not crash (surprisingly). And if the Framework
subsequently receives a primary display connect event, it does not seem
to do anything useful -- the display remains in a default off state, and
no layer stack/viewport/etc is set on it.

Bug: 38464421
Test: Works (with workarounds as noted) on a Chromebook
Test: Added Unit test passes on Pixel 1 XL

Change-Id: Ia11439030efdc53bc17474b71a0ffb3d3085bb49
ramebufferSurface.cpp
ramebufferSurface.h
715a2c13e6a010143761c1822ce7c4975921aa0b 15-Dec-2017 Lloyd Pique <lpique@google.com> Determine displayType in SurfaceFlinger

This change eliminates an assumption that the first hotplug connect
event is for the primary display, and all other events are for the
external display.

Bug: 38464421
Test: Boots, settings app navigable
Change-Id: I753deb9a4e99a7b225ab89562c7acf4ce284dbf5
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
566a3b4a1d1a2a6d38257113700eea92aa44ea2b 10-Jan-2018 Peiyong Lin <lpy@google.com> [SurfaceFlinger] Replace NULL with nullptr.

Test: make
Change-Id: Ia0ecb3160cd5fddf22fb7100c1759d62e723d0b7
ramebufferSurface.h
WComposer_hwc1.h
irtualDisplaySurface.cpp
7a9477298d8c5d231d20629962bcc2173e82ed6c 05-Jan-2018 Greg Kaiser <gkaiser@google.com> surfaceflinger: Remove unused variable

The stack variable 'numTypes' was set but never used in
Display::getHdrCapabilities(), so we remove it.

Test: Built aosp_arm-eng
Change-Id: I9d823feb73a14a416d21ad98396622fe72beb730
WC2.cpp
9c5795640b7a03541ec31b93b6a3217709599a8d 21-Dec-2017 Chia-I Wu <olv@google.com> Merge "surfaceflinger: do not check HWC2::Capability::SkipValidate" am: c770d27ff0 am: 45f9c3871b
am: 7fef217993

Change-Id: Id58026df73f211769764537f5648b83ff6b1b568
41b98d41f9f4e94a1a9a31960a317649cbec3b09 11-Dec-2017 Chia-I Wu <olv@google.com> surfaceflinger: do not check HWC2::Capability::SkipValidate

HWC2::Capability::SkipValidate is not defined in HIDL. We cannot
check against it.

Besides, presentOrValidate is equivalent to validate in HIDL when
the underlying hwcomposer2 implementation does not support the cap.
There is not need to check against it.

Bug: 70407085
Test: boots
Change-Id: Ib0c11e99ce3389ad555605de18e194d9b51b2bc0
WComposer.cpp
2c3217576fda79c0fc8113f157fa7f32ff81d844 13-Dec-2017 Tim Murray <timmurray@google.com> surfaceflinger: remove vsync hint

The vsync hint isn't actually useful.

Test: used taimen
bug 69982006

Change-Id: Ic64577901f95f31beb50e96b7a0570e4068a33b4
owerHAL.cpp
owerHAL.h
1e24ccebeeb6798afce2730a120abcf9927960fa 10-Nov-2017 Chia-I Wu <olv@google.com> surfaceflinger: remove all direct use of EGL

SurfaceFlinger now uses EGL/GLES only indirectly through
RenderEngine and GLConsumer.

Test: SurfaceFlinger_test
Change-Id: I78418b00168b79594979212eb488f530e738498d
ramebufferSurface.cpp
irtualDisplaySurface.cpp
6e8f706c21a01d6a1225e86972ff432bba5f0106 22-Nov-2017 Steven Thomas <steventhomas@google.com> Fix usage of HWC_DISPLAY_PRIMARY in vr flinger

The hardware composer functions require display ids obtained from the
onHotplug() composer callback. Our vr flinger code was supplying
HWC_DISPLAY_PRIMARY as the primary display id, which is incorrect. The
HWC_DISPLAY_* values are used for representing the display type, not the
display id. The code worked anyway because most hardware composers
always use 0 as the primary display id, which happens to be the same
value as HWC_DISPLAY_PRIMARY. The emulator uses 1 as the primary display
id though, which exposed the bug.

This CL changes the vr flinger code to get the display id from the
onHotplug() composer callback, and uses that value when talking to
hardware composer, instead of HWC_DISPLAY_PRIMARY. This matches the
behavior of surface flinger.

Bug: 69631196

Test: Verified the vr flinger code path works as expected on phones and
standalones.

Change-Id: Ia691941d0eafaa1f89e0ee81a4ae27fdef5a57cf
WComposer.cpp
WComposer.h
83ce7c162855742a2d9eeebc0cd70fe48d2cd125 20-Oct-2017 Chia-I Wu <olv@google.com> surfaceflinger: remove USE_HWC2

Remove USE_HWC2 and assume it to be true. Remove all !USE_HWC2
code.

This also fixes a compile error in tests/fakehwc, which never
defines USE_HWC2.

Test: boots taimen and hikey960
Change-Id: Ie6d2fcf884aa6fc715ab0ce19a1e0f7c8acf734c
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
d265c4238699ea899cc3b01cc90b643d9692db2a 20-Oct-2017 Chia-I Wu <olv@google.com> surfaceflinger: remove TARGET_USES_HWC2

Remove TARGET_USES_HWC2 and assume it to be true. Remove the unused
SurfaceFlinger_hwc1.cpp and DisplayHardware/HWComposer_hwc1.cpp.

This is expected to break some devices. All affected devices should
add

PRODUCT_PACKAGES += android.hardware.graphics.composer@2.1-impl

to their device.mk and update their manifest.xml. In the worse
case, we want to fork frameworks/native/services/surfaceflinger
before this change to
frameworks/native/services/surfaceflinger_hwc1.

Test: boots taimen and hikey960
Change-Id: I27ddd4c6c8af3c39cda99d94002d179486575b28
WComposer_hwc1.cpp
ae5a6b896a7c622dd029aa428f4f2c2493d5fc12 10-Oct-2017 Chia-I Wu <olv@google.com> surfaceflinger: flush HWC commands when present is skipped

This is how SF talks to HWC in each frame

1) queue state changes for display
2) queue validate display
3) flush
4) queue more state changes for display
5) queue present display
6) another flush

When validate implies present, we skip all steps after 3). This can
be less desirable because, when SF (incorrectly) queues more state
changes in 4), we still want to flush them to HWC such that SF
states and HWC states are consistent. The only step we want to skip
is 5) in that case. Note that we still skip 6) when 4) and 5) do
not queue anything.

The problem is much more worse in a multiple display setup

1) queue state changes for display 1
2) queue validate display 1
3) flush
4) queue state changes for display 2
5) queue validate display 2
6) flush
7) queue more state changes for display 1
8) queue more state changes for display 2
9) queue present display 1
a) flush
b) queue present display 2
c) flush

When validate implies present for display 1, but not for display 2,
we skip steps 7) to a), including the valid state changes for
display 2 in 8)! The only step we want to skip should be 9). Maybe
a) as well, but that is an optimization.

In both cases, what we really want is to skip the unnecessary
present and nothing else.

Bug: 67512553
Test: manual
Change-Id: I32d6218cda5c953e0359fecda94d2bb5482e061e
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
f797decfb2d21b0cf4340202b3c49a290d386d90 09-Sep-2017 Chia-I Wu <olv@google.com> Merge "surfaceflinger: handle executeCommands transaction errors" into oc-mr1-dev
am: f7e10c82b0

Change-Id: I02f1e3e8cb4f8c31e2959be375b8cac31c94601d
c0b2b0c457c45e09479029748e07e6d1b1c9d457 08-Sep-2017 Chia-I Wu <olv@google.com> surfaceflinger: handle executeCommands transaction errors

Unlike other functions, executeCommands both sends and receives
handles. It can fail for reasons such as out-of-fd. We want to
protect SurfaceFlinger against out-of-fd.

Bug: 65449888
Test: manual
Change-Id: Id9420dbd6d0a943737c90bd3a1ae0df3805a4cb0
omposerHal.cpp
c50be85de01a61cbb004837e960d9db294436969 12-Aug-2017 Chia-I Wu <olv@google.com> Merge "libgui: support 64-bit BQ consumer usage" into oc-mr1-dev
am: 64c9a3ee48

Change-Id: I2f28217c4c372c57b1a3b4ca64e499c7a1b34459
b02664ddc146893e6bbe7939ee2b948d54e7166a 27-Jul-2017 Steven Thomas <steventhomas@google.com> Use a separate hwcomposer hidl instance for vr flinger

Improve robustness of vr flinger <--> surface flinger switching by
having vr flinger use a separate hardware composer hidl instance instead
of sharing the instance with surface flinger. Sharing the hardware
composer instance has proven to be error prone, with situations where
both the vr flinger thread and surface flinger main thread would write
to the composer at the same time, causing hard to diagnose
crashes (b/62925812).

Instead of sharing the hardware composer instance, when switching to vr
flinger we now delete the existing instance, create a new instance
directed to the vr hardware composer shim, and vr flinger creates its
own composer instance connected to the real hardware composer. By
creating a separate composer instance for vr flinger, crashes like the
ones found in b/62925812 are no longer impossible.

Most of the changes in this commit are related to enabling surface
flinger to delete HWComposer instances cleanly. In particular:

- Previously the hardware composer callbacks (which come in on a
hwbinder thread) would land in HWC2::Device and bubble up to the
SurfaceFlinger object. But with the new behavior the HWC2::Device
might be dead or in the process of being destroyed, so instead we have
SurfaceFlinger receive the composer callbacks directly, and forward
them to HWComposer and HWC2::Device. We include a composer id field in
the callbacks so surface flinger can ignore stale callbacks from dead
composer instances.

- Object ownership for HWC2::Display and HWC2::Layer was shared by
passing around shared_ptrs to these objects. This was problematic
because they referenced and used the HWC2::Device, which can now be
destroyed when switching to vr flinger. Simplify the ownership model
by having HWC2::Device own (via unique_ptr<>) instances of
HWC2::Display, which owns (again via unique_ptr<>) instances of
HWC2::Layer. In cases where we previously passed std::shared_ptr<> to
HWC2::Display or HWC2::Layer, instead pass non-owning HWC2::Display*
and HWC2::Layer* pointers. This ensures clean composer instance
teardown with no stale references to the deleted HWC2::Device.

- When the hardware composer instance is destroyed and the HWC2::Layers
are removed, notify the android::Layer via a callback, so it can
remove the HWC2::Layer from its internal table of hardware composer
layers. This removes the burden to explicitly clear out all hardware
composer layers when switching to vr flinger, which has been a source
of bugs.

- We were missing an mStateLock lock in
SurfaceFlinger::setVsyncEnabled(), which was necessary to ensure we
were setting vsync on the correct hardware composer instance. Once
that lock was added, surface flinger would sometimes deadlock when
transitioning to vr flinger, because the surface flinger main thread
would acquire mStateLock and then EventControlThread::mMutex, whereas
the event control thread would acquire the locks in the opposite
order. The changes in EventControlThread.cpp are to ensure it doesn't
hold a lock on EventControlThread::mMutex while calling
setVsyncEnabled(), to avoid the deadlock.

I found that without a composer callback registered in vr flinger the
vsync_event file wasn't getting vsync timestamps written, so vr flinger
would get stuck in an infinite loop trying to parse a vsync
timestamp. Since we need to have a callback anyway I changed the code in
hardware_composer.cpp to get the vsync timestamp from the callback, as
surface flinger does. I confirmed the timestamps are the same with
either method, and this lets us remove some extra code for extracting
the vsync timestamp that (probably) wasn't compatible with all devices
we want to run on anyway. I also added a timeout to the vysnc wait so
we'll see an error message in the log if we fail to wait for vsync,
instead of looping forever.

Bug: 62925812

Test: - Confirmed surface flinger <--> vr flinger switching is robust by
switching devices on and off hundreds of times and observing no
hardware composer related issues, surface flinger crashes, or
hardware composer service crashes.

- Confirmed 2d in vr works as before by going through the OOBE flow on a
standalone. This also exercises virtual display creation and usage
through surface flinger.

- Added logs to confirm perfect layer/display cleanup when destroying
hardware composer instances.

- Tested normal 2d phone usage to confirm basic layer create/destroy
functionality works as before.

- Monitored surface flinger file descriptor usage across dozens of
surface flinger <--> vr flinger transitions and observed no file
descriptor leaks.

- Confirmed the HWC1 code path still compiles.

- Ran the surface flinger tests and confirmed there are no new test
failures.

- Ran the hardware composer hidl in passthrough mode on a Marlin and
confirmed it works.

- Ran CTS tests for virtual displays and confirmed they all pass.

- Tested Android Auto and confirmed basic graphics functionality still
works.

Change-Id: Ibf1dbdf3ec15ca66467697d711f8109dc9e46a47
Merged-In: I17dc0e060bfb5cb447ffbaa573b279fc6d2d8bd1
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
e2786ea5aec3a12d948feb85ffbb535fc89c0fe6 07-Aug-2017 Chia-I Wu <olv@google.com> libgui: support 64-bit BQ consumer usage

Add NATIVE_WINDOW_GET_CONSUMER_USAGE64. Support 64-bit consumer
usage flags in BufferItemConsumer and GLConsumer.

In H2BGraphicBufferProducer::getConsumerUsage, however, we will
issue a warning and return 32-bit consumer usage. We will need a
HIDL interface version bump to fix it.

Bug: 35215313
Test: manual
Change-Id: I1f8884a7db71bbdb269d05b94443ddec2ff46f8a
irtualDisplaySurface.cpp
irtualDisplaySurface.h
d7f49c5e93a554c2f0e85e279a765f92fb1e66f1 27-Jul-2017 Steven Thomas <steventhomas@google.com> Use a separate hwcomposer hidl instance for vr flinger

Improve robustness of vr flinger <--> surface flinger switching by
having vr flinger use a separate hardware composer hidl instance instead
of sharing the instance with surface flinger. Sharing the hardware
composer instance has proven to be error prone, with situations where
both the vr flinger thread and surface flinger main thread would write
to the composer at the same time, causing hard to diagnose
crashes (b/62925812).

Instead of sharing the hardware composer instance, when switching to vr
flinger we now delete the existing instance, create a new instance
directed to the vr hardware composer shim, and vr flinger creates its
own composer instance connected to the real hardware composer. By
creating a separate composer instance for vr flinger, crashes like the
ones found in b/62925812 are no longer impossible.

Most of the changes in this commit are related to enabling surface
flinger to delete HWComposer instances cleanly. In particular:

- Previously the hardware composer callbacks (which come in on a
hwbinder thread) would land in HWC2::Device and bubble up to the
SurfaceFlinger object. But with the new behavior the HWC2::Device
might be dead or in the process of being destroyed, so instead we have
SurfaceFlinger receive the composer callbacks directly, and forward
them to HWComposer and HWC2::Device. We include a composer id field in
the callbacks so surface flinger can ignore stale callbacks from dead
composer instances.

- Object ownership for HWC2::Display and HWC2::Layer was shared by
passing around shared_ptrs to these objects. This was problematic
because they referenced and used the HWC2::Device, which can now be
destroyed when switching to vr flinger. Simplify the ownership model
by having HWC2::Device own (via unique_ptr<>) instances of
HWC2::Display, which owns (again via unique_ptr<>) instances of
HWC2::Layer. In cases where we previously passed std::shared_ptr<> to
HWC2::Display or HWC2::Layer, instead pass non-owning HWC2::Display*
and HWC2::Layer* pointers. This ensures clean composer instance
teardown with no stale references to the deleted HWC2::Device.

- When the hardware composer instance is destroyed and the HWC2::Layers
are removed, notify the android::Layer via a callback, so it can
remove the HWC2::Layer from its internal table of hardware composer
layers. This removes the burden to explicitly clear out all hardware
composer layers when switching to vr flinger, which has been a source
of bugs.

- We were missing an mStateLock lock in
SurfaceFlinger::setVsyncEnabled(), which was necessary to ensure we
were setting vsync on the correct hardware composer instance. Once
that lock was added, surface flinger would sometimes deadlock when
transitioning to vr flinger, because the surface flinger main thread
would acquire mStateLock and then EventControlThread::mMutex, whereas
the event control thread would acquire the locks in the opposite
order. The changes in EventControlThread.cpp are to ensure it doesn't
hold a lock on EventControlThread::mMutex while calling
setVsyncEnabled(), to avoid the deadlock.

I found that without a composer callback registered in vr flinger the
vsync_event file wasn't getting vsync timestamps written, so vr flinger
would get stuck in an infinite loop trying to parse a vsync
timestamp. Since we need to have a callback anyway I changed the code in
hardware_composer.cpp to get the vsync timestamp from the callback, as
surface flinger does. I confirmed the timestamps are the same with
either method, and this lets us remove some extra code for extracting
the vsync timestamp that (probably) wasn't compatible with all devices
we want to run on anyway. I also added a timeout to the vysnc wait so
we'll see an error message in the log if we fail to wait for vsync,
instead of looping forever.

Bug: 62925812

Test: - Confirmed surface flinger <--> vr flinger switching is robust by
switching devices on and off hundreds of times and observing no
hardware composer related issues, surface flinger crashes, or
hardware composer service crashes.

- Confirmed 2d in vr works as before by going through the OOBE flow on a
standalone. This also exercises virtual display creation and usage
through surface flinger.

- Added logs to confirm perfect layer/display cleanup when destroying
hardware composer instances.

- Tested normal 2d phone usage to confirm basic layer create/destroy
functionality works as before.

- Monitored surface flinger file descriptor usage across dozens of
surface flinger <--> vr flinger transitions and observed no file
descriptor leaks.

- Confirmed the HWC1 code path still compiles.

- Ran the surface flinger tests and confirmed there are no new test
failures.

- Ran the hardware composer hidl in passthrough mode on a Marlin and
confirmed it works.

- Ran CTS tests for virtual displays and confirmed they all pass.

- Tested Android Auto and confirmed basic graphics functionality still
works.

Change-Id: I17dc0e060bfb5cb447ffbaa573b279fc6d2d8bd1
Merged-In: I17dc0e060bfb5cb447ffbaa573b279fc6d2d8bd1
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
a564aa8c84efed8555119dff31109e588225b298 02-Aug-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Fix build error from diamond merge

Somehow between various merges on master and oc-dr1-dev
master ended up in bad state.
CL's involved are:
cd939aa6622430 Fix build for non-HWC2 targets (master)
281e8113d0ce Communicate composition buffer dataspace to HWC (oc-dr1-dev)
79d272442ce13 Communicate composition buffer dataspace to HWC (master)
I think 281e got merged into master and re-introduced the change that
was fixed by cd93.
Test: make

Change-Id: I087244348392098f516905eb1cebebf0362fcc20
(cherry picked from commit 6461806da8d8f0677ce337700153e5a972c36593)
ramebufferSurface.cpp
a099a24c93bfa599fc5c36a647e946c26f68514f 11-Jan-2017 Kalle Raita <kraita@google.com> Faked HWC for SurfaceFlinger testing

Infrastructure and initial port of transaction tests. Faking the HWC
allows exercising the real path through the SurfaceFlinger, not relying
on screen captures. Faked HWC also opens up the possibility of faking
interactions like display hotplugs.

The tests are verifying the composition rectangles instead of a set of
select pixels. GLES rendering differences won't affect the
results. Also, the test expectations become clearer.

The ported transaction tests ran roughly twice as fast when compared
with the original transaction test. This is mostly due to the thighter
control over the vsyncs.

Test: Running the test on Marlin
Change-Id: I1c876cda78db94c1965498af957e64fdd23459ce
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
6461806da8d8f0677ce337700153e5a972c36593 02-Aug-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Fix build error from diamond merge

Somehow between various merges on master and oc-dr1-dev
master ended up in bad state.
CL's involved are:
cd939aa6622430 Fix build for non-HWC2 targets (master)
281e8113d0ce Communicate composition buffer dataspace to HWC (oc-dr1-dev)
79d272442ce13 Communicate composition buffer dataspace to HWC (master)
I think 281e got merged into master and re-introduced the change that
was fixed by cd93.
Test: make

Change-Id: I087244348392098f516905eb1cebebf0362fcc20
ramebufferSurface.cpp
d0bdfcb261c4c27cb048ea4abd9e0cd67454bbf5 02-Aug-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Merge changes If4271719,I9c9b5de9,I46a26a67 into oc-dr1-dev am: ddd9c71272 am: e124f74dff
am: 346203f942

Change-Id: Ied0a2337150aaf982833dc99dacb7015ae0fa01e
ac8661beae733fde679c3ec190ea4f04974ed0cb 02-Aug-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Merge changes If4271719,I9c9b5de9,I46a26a67 into oc-dr1-dev
am: ddd9c71272

Change-Id: Ie3868b140dfc675f450ac5f436f3533c1d2bdc93
346203f942789898b8be209049fa2c73a29a9330 02-Aug-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Merge changes If4271719,I9c9b5de9,I46a26a67 into oc-dr1-dev am: ddd9c71272
am: e124f74dff

Change-Id: I17280865ba7570933c3bfd04f2104704ac854607
281e8113d0ce20c702e847caf971663021eb65e3 14-Jul-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Communicate composition buffer dataspace to HWC

Test: adb shell dumpsys SurfaceFlinger
look for dataspace info in DisplayDevice section
Bug: 63146977
Change-Id: If427171994fbc91faacf5bad9cc736ddfbd35ec3
(cherry picked from commit 79d272442ce13418c3ea81c95d7fea0159b4b481)
ramebufferSurface.cpp
a2eb34cfbe089deb9a519e9702e17d9dfe26f9e8 18-Jul-2017 Ian Elliott <ianelliott@google.com> Have the Surface class track the buffer age.

Have the Surface class track the buffer age, so that Surface::query()
can return the buffer age without having to use a binder call to
BufferQueueProducer::query(). The idea is for
BufferQueueProducer::dequeueBuffer() to return the value, which the
Surface class will cache for later use by Surface::query().

Bug: b/27903668
Test: Use systrace to no ensure query binder call after dequeueBuffer.
Change-Id: I106a7bd27461d381f0bd84df70d804de56a128ab
(cherry picked from commit d11b044864be525a1646f93106ab496195bb8239)
irtualDisplaySurface.cpp
irtualDisplaySurface.h
d11b044864be525a1646f93106ab496195bb8239 18-Jul-2017 Ian Elliott <ianelliott@google.com> Have the Surface class track the buffer age.

Have the Surface class track the buffer age, so that Surface::query()
can return the buffer age without having to use a binder call to
BufferQueueProducer::query(). The idea is for
BufferQueueProducer::dequeueBuffer() to return the value, which the
Surface class will cache for later use by Surface::query().

Bug: b/27903668
Test: Use systrace to no ensure query binder call after dequeueBuffer.
Change-Id: I106a7bd27461d381f0bd84df70d804de56a128ab
irtualDisplaySurface.cpp
irtualDisplaySurface.h
74074f158a4535d34bfd845240c00f12e13cb614 26-Jul-2017 Ian Elliott <ianelliott@google.com> Merge "Revert "Have the Surface class track the buffer age.""
ad74480d6d9b15878bb14701aa81e73f86f70c75 26-Jul-2017 Ian Elliott <ianelliott@google.com> Revert "Have the Surface class track the buffer age."

This reverts commit b4f7493fbdb1d9d5b437a1dcb82e98b1531f4e3e.

Change-Id: I9a783c8e768637bd73ac53a856e5f42703dcd82b
irtualDisplaySurface.cpp
irtualDisplaySurface.h
56954aa36e7a81217624e58e195f357404759237 26-Jul-2017 Ian Elliott <ianelliott@google.com> Merge "Have the Surface class track the buffer age."
b4f7493fbdb1d9d5b437a1dcb82e98b1531f4e3e 18-Jul-2017 Ian Elliott <ianelliott@google.com> Have the Surface class track the buffer age.

Have the Surface class track the buffer age, so that Surface::query()
can return the buffer age without having to use a binder call to
BufferQueueProducer::query(). The idea is for
BufferQueueProducer::dequeueBuffer() to return the value, which the
Surface class will cache for later use by Surface::query().

Bug: b/27903668
Test: Use systrace to no ensure query binder call after dequeueBuffer.

Change-Id: I7a4d79d02ea68781b464a463f0ecdf64978b7fb8
irtualDisplaySurface.cpp
irtualDisplaySurface.h
cd939aa6622430482d2c79bb9deefb67d3ee4611 25-Jul-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Fix build for non-HWC2 targets

Fix build error introduced by ag/2528660
Test: lunch mini_x86-userdebug; make

Change-Id: I39b758c6456a6f334479ec4aed97db1659823a8b
ramebufferSurface.cpp
79d272442ce13418c3ea81c95d7fea0159b4b481 14-Jul-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Communicate composition buffer dataspace to HWC

Test: adb shell dumpsys SurfaceFlinger
look for dataspace info in DisplayDevice section
Bug: 63146977
Change-Id: If427171994fbc91faacf5bad9cc736ddfbd35ec3
ramebufferSurface.cpp
19987a8cb2ca05e45876946b1eab66cc9d1f9a77 14-Jul-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Dump FramebufferSurface dataspace

For debugging, dump the dataspace details for the
FramebufferSurface. Value will be 0 (UNKNOWN) if HWC is
doing composition.
Test: adb shell dumpsys SurfaceFlinger
Look for FramebufferSurface details.
Bug: 63146977

Change-Id: I9eb40739a616246bdac6e039270609d42eb56b59
ramebufferSurface.cpp
ramebufferSurface.h
49cdc635a222a495b5b5e17962c31a308003e23d 22-Jun-2017 Chia-I Wu <olv@google.com> Merge "surfaceflinger: discard stale commands" into oc-dev
am: f8ca9a0875

Change-Id: Ief69f6fcf0c738612b14b94d65b3ae1555973d6c
89283e56d6b76464ae9a61b5da5d2ba8e65c7d90 22-Jun-2017 Fabien Sanglard <sanglardf@google.com> Disable skip Validate on client composition
am: 269c236109

Change-Id: Ib0d2f8a9e59cf4618ed029fe35391f566d11bcfb
f8ca9a0875685003defb13f1a342bb8bd37cf4e0 22-Jun-2017 Chia-I Wu <olv@google.com> Merge "surfaceflinger: discard stale commands" into oc-dev
269c2361096cb8a17ea5fedbd20f800cd1b65d05 22-Jun-2017 Fabien Sanglard <sanglardf@google.com> Disable skip Validate on client composition

SurfaceFlinger should not skip validate when GLComposition is
needed. This can happen when SF decides to force GLComposition
(like when a screen rotation occurs).

Bug: 62906801
Test: Manual
Change-Id: I248146eade395a124cb149773287abd88ae36511
WComposer.cpp
0c6ce4608fc022608537162dd919e7f729b9cb77 22-Jun-2017 Chia-I Wu <olv@google.com> surfaceflinger: discard stale commands

When we skip validate, we may have stale commands on the command
buffer. They should be discarded.

Bug: 62906801
Test: manual
Change-Id: Ie7921ba75ab2252b834cda6924e1fcfdf236f759
WC2.cpp
WC2.h
WComposer.cpp
8976c6ae3710f3f524150f07be870075c9b1de9d 22-Jun-2017 Fabien Sanglard <sanglardf@google.com> Skip Validate
am: 249c0ae80a

Change-Id: I336fce473d21e5fdfb80ad8eb48f1df5a24497d8
249c0ae80a6e5690d091294c4447cb3facafbc37 20-Jun-2017 Fabien Sanglard <sanglardf@google.com> Skip Validate

b/37474580
b/62806392

Test: marlin, ryu

Change-Id: I09e0c52cb7c914dcd883dc771d97a365c89f7037
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
d8449e55a6461802514e3bd62e90e72070d3ffb4 15-Jun-2017 Alistair Strachan <alistair.strachan@imgtec.com> Fix getDisplayInfo() for SurfaceFlinger in HWC2 mode.
am: c175253b6d

Change-Id: I55ca473facef90f00eb1a401d9bc8ad7a36e4878
c175253b6d0738aec6235ef1c2e723ad36fcd346 08-Jun-2017 Alistair Strachan <alistair.strachan@imgtec.com> Fix getDisplayInfo() for SurfaceFlinger in HWC2 mode.

When HWC2 mode is enabled in SurfaceFlinger, the getDisplayInfo()
function would fail to return the correct active mode in some cases.

This bug was only noticable if you had more than one mode registered
by the HWC2 backend.

The SurfaceComposerClient::getDisplayInfo() function works by calling
getDisplayConfigs(), and de-referencing the config at the index
returned by getActiveConfig(). The active config returned was correct,
but the getDisplayConfigs() array was not properly sorted.

Tracing this back, this problem occurs because the configId is stored
alongside the config in an unordered_map, so when this is converted
to a vector and the configId is discarded, the conversion must be
sorted correctly; it can't just be the hash order returned from
the unordered_map.

There are a few ways to fix this problem, but the easiest was to nip
the problem in the bud by not allowing an unsorted list of configs
to exist on the base HWC2 class. It may be better still to just get
rid of the map and go back to a vector, as this data is more often
used as an array than it is indexed by configId, so the use of an
unordered_map was probably overkill.

Change-Id: Ibfb015a6d9b49c870f37a1c892f15f90abbd1e2c
Bug: 62617569
Test: ./cts-tradefed run cts -m CtsViewTestCases -t android.view.cts.DisplayRefreshRateTest#testRefreshRate
WC2.h
c988ee4c4c21331e2a33467dc899ebb561035b0b 01-Jun-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Remove redundent layer setDataspace calls.

Cache the layer's dataspace in hwc2 and only send
to the HAL when it changes. Allows HAL to optimize
use of layer.

Bug: 38396128
Test: Manually checked systraces on Pixel
Change-Id: Ia94bebe7de9f79d01ae19b9917591837d865fea9
WC2.cpp
WC2.h
cb496acbe593326e8d5d563847067d02b2df40ec 22-May-2017 Mathias Agopian <mathias@google.com> use 64-bits usage bits almost everywhere

Revert "Revert "use 64-bits usage bits almost everywhere""
This reverts commit 1671de0068de40f57288628d4b757a1c84962a62.

Test: manual, build
Bug: 33350696
Bug: 38466700
Change-Id: Ia2f51b97137dba754b1938dfb1e235f4babc8a88
irtualDisplaySurface.cpp
irtualDisplaySurface.h
d8ac4fd17a71b8b523121186b8a03212cd5122fe 25-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Delete SurfaceFlinger BYPASS codepath" into oc-dev
8869aec93ec44370a2b2f8fd4f3aa71768b6bcc7 24-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Use IVrComposerClient interface to expose the VR HWC client"
5b3cf0576d91358cb850945d89382938ff8dc5ed 04-May-2017 Fabien Sanglard <sanglardf@google.com> Delete SurfaceFlinger BYPASS codepath

Test: AUPT, Manual
Change-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
Merged-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
WC2.cpp
WC2.h
WComposer.cpp
WComposerBufferCache.cpp
1671de0068de40f57288628d4b757a1c84962a62 22-May-2017 Guang Zhu <guangzhu@google.com> Revert "use 64-bits usage bits almost everywhere"

Bug: 38466700

This reverts commit 175d98757d7d9003d4f64756cf4c2b366ba77e97.

Change-Id: I5f08a4ca91511775cd52250d10a0220b258b8368
irtualDisplaySurface.cpp
irtualDisplaySurface.h
175d98757d7d9003d4f64756cf4c2b366ba77e97 16-May-2017 Mathias Agopian <mathias@google.com> use 64-bits usage bits almost everywhere

Test: manual, build
Bug: 33350696
Change-Id: Ida33c2a902155044651158467bb99d664e958c41
irtualDisplaySurface.cpp
irtualDisplaySurface.h
23429778c41bb54cbbc0067f2151049488554bcf 16-May-2017 Logan Chien <loganchien@google.com> Remove stale dependency to libhwc2on1adaptor.so.

This commit removes stale dependency to libhwc2on1adaptor. Since commit
831d48ed, mAdapter has become an unused private member. In addition,
this unused unique_ptr leads to an unnecessary symbol reference to the
destructor of HWC2on1Adaptor. This commit removes them completely.

Bug: 38302528
Test: Sailfish builds and boots.
Change-Id: I0208d7fb21ff2f5d59d367162bc5f982f1515982
Merged-In: I479f12ddbae91282a13464159f00513aa7cb3208
WComposer.cpp
WComposer.h
d497cdcb7f04f648b11b1bde13beb8e07a38bb5f 18-May-2017 Chia-I Wu <olv@google.com> Merge "surfaceflinger: fix a release fence leak" into oc-dev am: 5c580eaeb6
am: 4a09c8fb5e

Change-Id: Ie0df74a1390d880735ed05887dbc7a653e0dc7ee
5e74c65a55e2297228e1c8cf7885420d6a946e80 17-May-2017 Chia-I Wu <olv@google.com> surfaceflinger: fix a release fence leak

We leak release fence fds when we believe hwcomposer2 gives us any
invalid layer and return early.

Bug: 38151478
Test: boots
Change-Id: I299721eca8bc7927052170fe87ee51e9b91006aa
WC2.cpp
a50abc2fbbc1ab4ac00aa5d3b41d77b24048f81b 15-May-2017 Daniel Nicoara <dnicoara@google.com> Use IVrComposerClient interface to expose the VR HWC client

Since the VR HWC implements the IVrComposerClient make sure the
implementation inherits from the correct interface.

Bug: 36564122
Test: Ran on device
Change-Id: I5481ab5505f824034944b4df34fb51ee1b86082b
omposerHal.cpp
aee98890db2b576afbb002af8feae53dda46cce4 16-May-2017 Logan Chien <loganchien@google.com> Remove stale dependency to libhwc2on1adaptor.so.

This commit removes stale dependency to libhwc2on1adaptor. Since commit
831d48ed, mAdapter has become an unused private member. In addition,
this unused unique_ptr leads to an unnecessary symbol reference to the
destructor of HWC2on1Adaptor. This commit removes them completely.

Bug: 38302528
Test: Sailfish builds and boots.
Change-Id: I479f12ddbae91282a13464159f00513aa7cb3208
WComposer.cpp
WComposer.h
a5ac85f608ea34cbbe6d36c1e13f5dc0bd890953 12-May-2017 Chia-I Wu <olv@google.com> Merge "Revert "surfaceflinger: work around dumpsys lockup"" into oc-dev am: acf2c6dd58
am: 6975146c6b

Change-Id: I5a4e7cbf5e86dea17db4b9d8048775bf46f45404
15b27e0e63dc1528ab2ddf1875f4d5a029059e5a 12-May-2017 Chia-I Wu <olv@google.com> Revert "surfaceflinger: work around dumpsys lockup"

This reverts commit 843460d1d8ced54ed224cff2b3fad703b6ea98c4.

Bug: 38183197
Test: manual while running dumpDebugInfo continuously in the
background
Change-Id: Ife3fb2970f58b8c8049bbe878c6a7728d1299d57
WComposer.cpp
WComposer.h
6a3c05bcfab588fd99dd8d619a53d15374e99507 28-Apr-2017 Mathias Agopian <mathias@google.com> fix circular dependency libnativewindow <-> libui

Bug: 37647680
Bug: 37648355
Test: compile, manual
Change-Id: I9631beea52e23ebb519411f943c6f5062aedd2e5
irtualDisplaySurface.cpp
831d48ed282e7e5095895c8d1896881ff36947f7 04-May-2017 Fabien Sanglard <sanglardf@google.com> Delete SurfaceFlinger BYPASS codepath

Test: AUPT, Manual
Change-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
WC2.cpp
WC2.h
WComposer.cpp
WComposerBufferCache.cpp
0af4b9f88a48a6ecc705b4a8cec3d3ba24c53ead 26-Apr-2017 Steven Thomas <steventhomas@google.com> Call validateDisplay() when skipping frames

Layer management was getting screwed up in vr flinger in the following
scenario:

1. In frame X, post a new buffer to layer L.

2. Decide to skip frame X (e.g. because we're behind our target
schedule).

3. In frame X+1, delete layer L.

When we skip the frame in step 2, we weren't calling validateDisplay()
or presentDisplay() on the hardware composer, so the composer's internal
command queue wasn't being flushed. When we called validateDisplay() for
frame X+1 the update buffer call from frame X would be run, referencing
the deleted layer L, causing a crash.

Now we always call validateDisplay() when we change the layer state,
even if we decide to skip the frame.

I also added code to explicitly clear the Composer object's internal
command buffer when we transfer control from surface flinger to vr
flinger and back. There were certain cases where there could be commands
left in the command buffer after the display handoff.

Bug: 37159844

Test: I used an app switcher script that quickly switches vr apps, which
would consistently trigger the setLayerBuffer crash. I confirmed with
this CL applied I can run the app switcher until surface flinger runs
out of file descriptors (that's a separate bug), and I never see the
setLayerBuffer crash. I also confirmed from the log output there are no
additional hardware composer errors.

Change-Id: I85832b87f393754dc6b034eb38f2937d7b58ed74
omposerHal.cpp
omposerHal.h
7d3dcb9235ec149af2f5139a8a9c6eac859d92e2 06-Apr-2017 Stephen Kiazyk <skiazyk@google.com> Avoid a potential race condition on mDisplays

I've now run this on a HWC1 and HWC2 build. Both appear to be running
correctly.

Original Message:

The race could occur when transitioning in/out of VR flinger mode.
It is now avoided by ensuring that the primary |DisplayDevice| is always
created once |mStateLock| is released, and ensuring that all accesses
to the primary |DisplayDevice| are guarded by |mStateLock|.

Bug: 36194616
Bug: 37249613
Bug: 37288476

Test: Compiled, installed, and ran with both HWC1 and HWC2 variants.
HWC1 was tested on Nexus 6P. Was able to boot, install apps, run apps,
turn screen on/off, and reboot phone.
HWC2 was tested on sailfish. Was able to boot, install apps, run apps,
run VR apps using both N path, and O1 path, turn screen on/off, and
reboot phone.

Change-Id: I0e80c2553f40cce2116b718bbb0d2566679f794a
WComposer.cpp
WComposer.h
WComposer_hwc1.cpp
WComposer_hwc1.h
0556d79eacbf0c9978080d87aa4075120533c7ef 22-Mar-2017 Mathias Agopian <mathias@google.com> get rid of IGraphicBufferAlloc

Buffers can now be allocated directly through
the graphic allocator HAL.

Test: marlin: run full camera cts
Test: angler: take screenshot, take photo w/ and w/o HDR, video, panorama, refocus, slo-mo
Bug: 36462585
Bug: 36333314
Change-Id: Ie5222c53c3b9462e0ac7a41568718aad131eb328
ramebufferSurface.cpp
c90e469393493ff2dbb96a60abf1c828d9da2012 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Avoid a potential race condition on mDisplays"" into oc-dev
8722a310c00557195a0703e95564f31d908ab2d5 13-Apr-2017 Tomasz Wasilczyk <twasilczyk@google.com> Revert "Avoid a potential race condition on mDisplays"

This reverts commit 8d6c16dc3dc8b88a0046f53668a4e3be074507ff.

Bug: b/37282502
Change-Id: Ibf64607f9e14ede201510e2c1b502c49a31e9f2a
WComposer.cpp
WComposer.h
WComposer_hwc1.cpp
WComposer_hwc1.h
6d957ec3732dd1c30b00e738ebb38d01118f9fd6 12-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes Ia1fa4a32,I2a4c3d9f into oc-dev

* changes:
hwc2: Remove Display::{mIsVirtual,setVirtual}
hwc2: Cache display type at construction
1636e003355d9dc6c04d4f9701241f3ab364be32 12-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "VR: Update VR HWC to use buffer metadata passed by SurfaceFlinger" into oc-dev
ceb67d1f8f61e15e2c752d15c4077e5194118d1c 11-Apr-2017 Chris Forbes <chrisforbes@google.com> hwc2: Remove Display::{mIsVirtual,setVirtual}

Trivial cleanup.

Now that mType is available, we don't need a separate flag for whether
the display is virtual. The remaining effect of setVirtual was to set
the display connected, so just use setConnected.

Bug: b/36597125
Test: build
Change-Id: Ia1fa4a324cc07b0d6c124f4f50966c8b0cbe4827
WC2.cpp
WC2.h
016d73c2d8f8fae544f09a6eebe827791f499470 11-Apr-2017 Chris Forbes <chrisforbes@google.com> hwc2: Cache display type at construction

The display type is constant for the life of the display. Query it
upfront to avoid the binder transaction later.

V2: fixup HWC1 path

Test: boot to launcher on bullhead; build on fugu for HWC1 path
Bug: b/36597125
Change-Id: I2a4c3d9ff449960957376afef78f424261fcc282
WC2.cpp
WC2.h
8d6c16dc3dc8b88a0046f53668a4e3be074507ff 06-Apr-2017 Stephen Kiazyk <skiazyk@google.com> Avoid a potential race condition on mDisplays

Update: The HWC1 path needed to be updated in light of a change to
SurfaceFlinger.h. The build now works for both paths.

Original Message:

The race could occur when transitioning in/out of VR flinger mode.
It is now avoided by ensuring that the primary |DisplayDevice| is always
created once |mStateLock| is released, and ensuring that all accesses
to the primary |DisplayDevice| are guarded by |mStateLock|.

Bug: 36194616
Bug: 37249613
Test: Compiled for both HWC1 and HWC2 surface flinger builds.
Normal behavior is unchanged. Explicitly testing the race
condition required instrumenting code with sleep statements.

Change-Id: I0b00e857a3b2fd01948a888db2f0715d2a8204c1
WComposer.cpp
WComposer.h
WComposer_hwc1.cpp
WComposer_hwc1.h
1f42e3a02c4f9a1ba1916a2f0e47082bedb73e41 10-Apr-2017 Daniel Nicoara <dnicoara@google.com> VR: Update VR HWC to use buffer metadata passed by SurfaceFlinger

Without gralloc1 support, need to pass buffer metadata in order to
import native buffers and used them as graphic buffers.

Bug: 36481301
Test: Compiled and ran on device; Verified VR Window Manager properly
displays SurfaceFlinger buffers.

Change-Id: I8426be1d79dcc2fbd631c399427ae03cb2afc21d
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
80c02320c49f5f6e1cb2651620fa31de551502a7 10-Apr-2017 Polina Bondarenko <pbond@google.com> Revert "Avoid a potential race condition on mDisplays"

This reverts commit 5576a555a14edd8c76addce2cee37b9b9ced2c3f.

Change-Id: I5d5889fccd94acacfbfef29847e4b65ef2543c75
WComposer.cpp
WComposer.h
5576a555a14edd8c76addce2cee37b9b9ced2c3f 06-Apr-2017 Stephen Kiazyk <skiazyk@google.com> Avoid a potential race condition on mDisplays

The race could occur when transitioning in/out of VR flinger mode.
It is now avoided by ensuring that the primary |DisplayDevice| is always
created once |mStateLock| is released, and ensuring that all accesses
to the primary |DisplayDevice| are guarded by |mStateLock|.

Bug: 36194616
Test: Normal behavior is unchanged. Explicitly testing the race
condition required instrumenting code with sleep statements.

Change-Id: I1f8fcf23982c311d47267beca8127b6c29562ce5
WComposer.cpp
WComposer.h
95a99a1d3cdbd19343d0d27271098c9c01a63e78 21-Mar-2017 Daniel Nicoara <dnicoara@google.com> VR: Remove HIDL VR Composer from service/vr/vr_window_manager

Moved into frameworks/hardware/interfaces

Bug: 35570958
Test: Compiled and ran on device
Change-Id: I735096935a06e4dd6a8fc1d719c73ad11e9c1583
omposerHal.cpp
e96afe6e91efd036089a6b6c42a855bdec4308ec 24-Mar-2017 Daniel Nicoara <dnicoara@google.com> VR: Rename HIDL service name from vr_hwcomposer to vr

This is part of an effort to simplify service names.

Bug: 36564122
Test: Ran on device and verified SurfaceFlinger connects to vr_wm
Change-Id: I3e2a2b778f3f0d2066bf5b756263de4b238b2f83
omposerHal.cpp
1971b63aa4d82db37794f19e0eb01feb1826e422 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use max acquired buffer setting to configStore

Change-Id: I48454243bcac12f5a83d080cd9115686f9f728ca
ramebufferSurface.cpp
d8ab4396a858a9c929a1bb3cadf7705fb8061574 21-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "egl: Remove retire event."
4e606e3901b500bdd0f3ea21b8cb63734087bf0a 16-Mar-2017 Brian Anderson <brianderson@google.com> egl: Remove retire event.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: Ibf63d22e42ae52307662107eec50f80de0e703f5
WComposer.cpp
WComposer.h
c8e387edfcead55b6e6fb1d05db279c264b644fa 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use configStore for maxVirtualDisplay Size

Test: Manual and AUPT
Change-Id: I17ec13f782a7c7c693d84d11c9b5e87624ee71d0
WComposer.cpp
8c02341c732956b282f11744501cc6a97ac165dc 17-Mar-2017 Fabien Sanglard <sanglardf@google.com> Revert "Use configStore for maxVirtualDisplay Size"

This reverts commit 56a5dbd3b050cbfd324308d224c7d12f4aec3320.

Change-Id: I66224bb48d3146846200ff7f2d5a66d1d8ff5cf7
WComposer.cpp
56a5dbd3b050cbfd324308d224c7d12f4aec3320 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use configStore for maxVirtualDisplay Size

Test: Manual and AUPT
Change-Id: Iefc09b06ab473c4029756279920135761547dd65
WComposer.cpp
a34ed639c3057b99da0fb703beb12827e30aa508 14-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use forceHwcCopyForVirtualDisplay in configStore

Test: Manual
Change-Id: Ie6f816cf8f48b1cca41d51f40e9f0ae49aef2908
irtualDisplaySurface.cpp
irtualDisplaySurface.h
f8b4ca51111cd2e566d1774ac464da859db78976 16-Mar-2017 Romain Guy <romainguy@google.com> Revert "Get rid of IGraphicBufferAlloc"

This reverts commit 78491c9f694cb0767996503c629776a8eda950d7.

Change-Id: I78d5c0a30ab80265f697f681387872b6763b2d1e
ramebufferSurface.cpp
78491c9f694cb0767996503c629776a8eda950d7 15-Mar-2017 Mathias Agopian <mathias@google.com> Get rid of IGraphicBufferAlloc

This reverts commit 527747dce1ab4714bd424e5c1a25ebad3506c2cb.

selinux policy allowing this change fixed.

Test: took a screenshot
Test: ran ImageReaderTest CTS
Bug: 36194109
Change-Id: I72ac17b6c252750aa2a66cd1d94bd8b4e21b5e9d
ramebufferSurface.cpp
975e49a2ae848ef7d2b9d9ad8ea1afad656f037b 13-Mar-2017 Chia-I Wu <olv@google.com> Merge "Revert "get rid of IGraphicBufferAlloc""
527747dce1ab4714bd424e5c1a25ebad3506c2cb 13-Mar-2017 Chia-I Wu <olv@google.com> Revert "get rid of IGraphicBufferAlloc"

This reverts commit 1da94dfed674e94edc37cdc8ef68530520edf169.

Bug: 36176799
Bug: 36175706
Change-Id: I6dd5fe8df564f0efa4392a800fb316e27a05076e
ramebufferSurface.cpp
aaff73f92a2fcadda8c765eb9b02f2849418a873 13-Feb-2017 Chia-I Wu <olv@google.com> surfaceflinger: simplify HWC buffer cache clean up

When a Layer is no longer connected, we destroy the associated HWC
layers on next call to SurfaceFlinger::rebuildLayerStacks or when
the Layer is destroyed. There is no need to listen to
onBuffersReleased. Besides, we need to perform the cleanup from the
main thread as we only talk to HWC process from the main thread.

While at it, move HWComposerBufferCache to its own files.

Bug: 35320590
Test: manual
Change-Id: Ifa32f24076b094c8fa9cda8572b03d5bfb8e0b93
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
WComposerBufferCache.cpp
WComposerBufferCache.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
1da94dfed674e94edc37cdc8ef68530520edf169 28-Feb-2017 Mathias Agopian <mathias@google.com> get rid of IGraphicBufferAlloc

buffers can now be allocated in-process.

Test: compile & run
Bug: cleanup
Change-Id: I3d4317a9bed20a6d8be2b7ac8fbb85738efb3657
ramebufferSurface.cpp
e29055f5fe4a2bc0f3f75d952ff417462dc607cc 08-Mar-2017 Fabien Sanglard <sanglardf@google.com> Create libhwc2on1adapter

Extract the adapter out of SurfaceFlinger library to allow code
behind HAL to use it.

Test: Manual
Change-Id: I415aa2674564eccb2c38f76086807f834177f80f
WC2On1Adapter.cpp
WC2On1Adapter.h
WComposer.cpp
iniFence.cpp
iniFence.h
c859147db5e9d5aa8a5043c0111e2799e1db042b 07-Mar-2017 Fabien Sanglard <sanglardf@google.com> Add MiniFence to drop HWC2on1Adapter libui dep

This class will soon become a library used by devices with no support
for HWC2. They will link against libhwc2on1adapter. Drivers should have
no depedencies on libui.

Test:Manual
Change-Id: Iabd2aa89fc3b737a999632a16c4f6c30464787c4
WC2On1Adapter.cpp
WC2On1Adapter.h
iniFence.cpp
iniFence.h
843460d1d8ced54ed224cff2b3fad703b6ea98c4 02-Mar-2017 Chia-I Wu <olv@google.com> surfaceflinger: work around dumpsys lockup

Bug: 35806047
Test: manual
Change-Id: I047ddf0ef9eacd4df7da3c9d91118c3f1592a9eb
WComposer.cpp
WComposer.h
b665cd388c787d750e5b9282c64208d77fbceaf2 27-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adjust traces to diagnostic of HWC2on1Adapter"
af5b6b814119151985d27d6edde7917cfb1e8d45 23-Feb-2017 Fabien Sanglard <sanglardf@google.com> Adjust traces to diagnostic of HWC2on1Adapter

Change-Id: I0110fac372791bec657521522de3e08907f465f7
WC2On1Adapter.cpp
f5eb5e62777e03551af611e799f9b24e473dd065 24-Jan-2017 Chris Phoenix <cphoenix@google.com> hwcomposer HAL uses "default" service name

The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934
Change-Id: I6befd081add61e355bc25dd0c630ac07ea0103c4
omposerHal.cpp
158f9a34c714b850f92f66ca9a5c61b96b224fe1 18-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "move vector math out of libui"
1d77b719d51a01cbd6954a048fb64e79d50a950e 18-Feb-2017 Mathias Agopian <mathias@google.com> move vector math out of libui

created a new header-only static libmath lib

Test: built & ran
Bug: n/a
Change-Id: Ic63ef5f54d9a0de07a9ab9e4d67be01ab6169fc0
WC2.h
06e908a69177e5b2cfe2625f58cae9da9f29e78f 12-Feb-2017 Fabien Sanglard <sanglardf@google.com> Refactor HWC2on1Adapter

- Simply memory allocation with a single, consolidated calloc().
- Remove latch system which did not prove useful.
- Converted { to be before \n.

Change-Id: Id1daec2343225598160395bfecddc86955e2b610
WC2On1Adapter.cpp
WC2On1Adapter.h
310ac5e48a758482273b22b7aa03ef2509248df1 18-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Discard surfaceDamage for HWC1 v < 1.5"
356bcd4144e87f570fe412e2bd31b1af796b429f 18-Feb-2017 Fabien Sanglard <sanglardf@google.com> Discard surfaceDamage for HWC1 v < 1.5

Test: Manual
Change-Id: Ia9193a88dc6df206c8f197adf144466f164afa1c
WC2On1Adapter.cpp
fb94f1db72bd769d4a63e2baf0b5a4ca5da7a86f 17-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Break a dependency of libui on libandroid"
873e2eee781f323a8aa0283cab5924fa4cd7ecfe 17-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Move FloatRect from libgfx to libui"
a9347647eca3101c014be902b713772de3977d87 14-Feb-2017 Mathias Agopian <mathias@google.com> Break a dependency of libui on libandroid

This was only a header dependency, but it still
created a circular dependency, which will cause
problems in another CL.

We fix this by creating a libarect static library
containing only that header. both libui and
libandroid now depend on it and reexport the
header.

We also make sure rect.h ends-up in the right
place.

Test: built and booted device
Bug: 35164655

Change-Id: Iba25b8b801b26b26ec1401c00caf367a06f197ca
ramebufferSurface.cpp
irtualDisplaySurface.cpp
irtualDisplaySurface.h
0ed70ddebe2a392c32b010e00229b9f0e2fd2e09 17-Feb-2017 Romain Guy <romainguy@google.com> Merge "Add RGBA 10:10:10:2 format for surfaces"
5a423eaa86f4c990afcef8c55e3949d0872068b4 16-Feb-2017 Dan Stoza <stoza@google.com> Move FloatRect from libgfx to libui

Moves FloatRect from libgfx (which is being disintegrated) to libui

Test: Builds and sailfish boots
Change-Id: I68c1b7d86a363066fe4d6f0c038ca9d92d7ab9c7
WC2.cpp
WC2.h
WComposer_hwc1.cpp
WComposer_hwc1.h
541f22658ab1617c9d12c98684ab40248df8749b 11-Feb-2017 Romain Guy <romainguy@google.com> Add RGBA 10:10:10:2 format for surfaces

Bug: 2984164
Test: CtsHardwareTestCases
Change-Id: Ifc90e413f414a19ac09e923e48ec7ff45d3e930b
WComposer_hwc1.cpp
abc64f0d096f61f8150dc6f8398a829281fd4dd0 14-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "surfaceflinger: skip buffer cache when BYPASS_IHWC"
3b70dffaa2fee64161ec0445ff9a96a2cb64324e 14-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix unitialized field in HWC2on1Adapter"
0e9b20c2d1fae2a01dc50df98be04cf0f5d8eeff 14-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove magic number usage in SurfaceFlinger"
2bd6f5f365d13770b96804a3d9a1c4e930dac25c 13-Feb-2017 Fabien Sanglard <sanglardf@google.com> Fix unitialized field in HWC2on1Adapter

Bug: 33487853
Test: AUPT
Change-Id: If271eb6b9d357047b41fed19a2079325970132a7
WC2On1Adapter.cpp
406acb8c012f74a881daafaf370b19dec7ecda46 14-Feb-2017 Chia-I Wu <olv@google.com> surfaceflinger: skip buffer cache when BYPASS_IHWC

When SF talks to hwcomposer2 directly, we should skip HWC buffer
cache. The cache works somehow similar to
IGraphicBufferConsumer::acquireBuffer, where buffer is set to
nullptr when it is already seen previously. That confuses
hwcomposer2.

Bug: 35325794
Test: manual
Change-Id: I5306ecc9e7290bc6734091a9884024bf38667628
WComposer.cpp
3cfac28462910d3f976aebac54ac7301aca7e434 06-Feb-2017 Steven Thomas <steventhomas@google.com> Ignore callbacks from the non-active hardware composer

Ignore callbacks from the non-active hardware composer so we don't get
e.g. duplicate vsync callbacks, one from each composer.

Bug: None

Test: Manually confirmed with logs we're now ignoring callbacks on the
non-active composer.

Change-Id: I8b475d6283d86c64ff96b41e78528bce8c6ff1d3
WComposer.cpp
WComposer.h
WComposer_hwc1.cpp
WComposer_hwc1.h
7382ed7f54a253b958a9d24f6d7eff2a94f47660 12-Feb-2017 Fabien Sanglard <sanglardf@google.com> Remove magic number usage in SurfaceFlinger

Test: Manual
Change-Id: I9d4c7e4ec8546314864e0625a832e9a0bb49e95b
WC2On1Adapter.cpp
87670ffe26079eb50b62f698eb0f7bfa8ee51deb 01-Feb-2017 Hendrik Wagenaar <hendrikw@google.com> Allow surfaceflinger to run vrflinger

* Allows surface flinger to switch in and out of vr mode

Bug: None
Test: Manually ran various vr test programs.
Change-Id: I15fbba0eb67cbcffeef41be31429550448a1db9c
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
06d63de03cb2a551ca99608f5aa0c4f3e200b0fc 04-Jan-2017 Chia-I Wu <olv@google.com> surfaceflinger: cache HWC client targets and buffers

Remember HWC client targets and buffers, and make sure we send each
unique slot/handle pair only once. This allows the composer to
clone/register/retain each buffer only once.

Test: builds and boots
Change-Id: Ib485189043a9c132031e82d4d7380ace3bf9453d
omposerHal.cpp
omposerHal.h
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
999a7fdad2a48d0517f515cc6ea6c7324aa28228 03-Feb-2017 Fabien Sanglard <sanglardf@google.com> Fix protected content playback via HWC2on1Adapter

The adapter marked unsupported dataspace layer with HWC_SKIP_LAYER
which prevented HWC to mark protected content with HWC_OVERLAY.

Test: AUPT
Change-Id: Id8c05c7e575ffcc4160cdd8d23b151c4901b4c5c
WC2On1Adapter.cpp
WC2On1Adapter.h
6c97ea6eeff53838fc5e11559946ce3933ed74b2 01-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Set cache dirty on layer creation/destruction"
03be681d485ec5e86052e764a1120a5953e86cdf 31-Jan-2017 Fabien Sanglard <sanglardf@google.com> Set cache dirty on layer creation/destruction

The adapter misses an edge cases where a transaction both destroys and
creates a layer. Under these conditions, assignHwc1LayerIds() is not
called. mHwc1LayerMap contains reference to destroyed layers
and ultimately lead to segfault.

Test: Angler eng device and AUPT.
Change-Id: I96bcbabf74a80cc87df796c0bc84b84e2bda8614
WC2On1Adapter.cpp
16ab8191fee19ed977daf31cf5b460851162fb6d 31-Jan-2017 Fabien Sanglard <sanglardf@google.com> Fix unitialized field in HWC2on1Adapter

Layer acquire fence file descriptor was not always initialized. In
the case of a SolidColor layer, the file descriptor was left set to
value 0 (stdin) which after call to set would be closed by the
adapter leading to system unstability.

Test: Angler eng devices and AUPT

Change-Id: Ic931d8cf9b0c6ca8d56c7a0ed7a7f586bf072505
WC2On1Adapter.cpp
2f5f8a51f5994cf14837030d4b3b252a9d1b950b 20-Dec-2016 Daniel Nicoara <dnicoara@google.com> VR: Add ability to pass layer info through SurfaceFlinger

Updates SurfaceFlinger to connect to the VR HWC service and pass
additional layer information.

For now VR mode is enabled at build time.

Bug: 33297385
Test: Ran on device and verified the IVrComposerClient::setLayerInfo()
call is done successfully.

Change-Id: I9dea2451a3a2aa1919395d3785ae00446ba51f26
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
3c9cbd48a678542f6832168f3f6371c4f717f709 17-Jan-2017 Daniel Nicoara <dnicoara@google.com> Update CommandWriter to CommandWriterBase

Updates dependencies after rename.

Bug: 33297385
Test: Compiled
Change-Id: I99bb972dc591ba8cef4ec5ab7cab07120a9ca739
omposerHal.cpp
omposerHal.h
e0ea99cc4ba89452b9b6b1baa33bddcb11f3351a 12-Jan-2017 Mark Salyzyn <salyzyn@google.com> resolve merge conflicts of a2c2d11f9 to master

Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I84d0ffa430df3beca0dcc6ed205ce220d7be1f87
7823e124e00576e20e47ec717cbe8bc89f0f2bf2 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if possible
- add system includes that are assumed as side effects
- define LOG_TAG first

Test: compile
Bug: 31289077
Bug: 30465923
Change-Id: I8d99b24c333578c9b5aa9f2a01324bd0bba268dd
ramebufferSurface.cpp
WC2On1Adapter.cpp
WComposer.cpp
WComposer_hwc1.cpp
847650b5d89a1667f78fa0fa67429377cd3bf37a 17-Jun-2016 Naseer Ahmed <naseer@codeaurora.org> HWC2: Initialize retire fence to -1

Initializing to zero will cause us to inadvertently close fd 0.
While fd 0 (stdout) isn't used in the surfaceflinger process,
if we close it, the fd becomes available for other usages, such
as fences and ion buffers. Using it becomes problematic for some
drivers which may treat it as an invalid value.

Bug: 28640429
Test: Fixes GPU driver seeing fd of 0 and erroring
Change-Id: Ifa06472d24476edb27a4306d946eb616a15aee7a
WC2.cpp
c8e4c3d7d9f987b84ed307cb78732a34d21d3b5a 05-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Create libgfx, starting with FloatRect"
9d02100650605c62b66ec45d212d6428f42761fe 04-Jan-2017 Steven Moreland <smoreland@google.com> Return<*> getStatus().isOk() -> isOk()

Bug: 31348667
Test: compiles
Change-Id: I8f1fb98732b6e48fc7ef099d5ca85f6e91014921
omposerHal.cpp
71bded513d37a6c1260b4a62c69ecc0d24be95f7 19-Oct-2016 Dan Stoza <stoza@google.com> Create libgfx, starting with FloatRect

Creates libgfx, the future home of everything currently in libui and
libgui, which will be rigorously checked with -Weverything (with a few
common-sense exceptions) and clang-tidy and formatted using the included
.clang-format file.

Starts by moving FloatRect out of services/surfaceflinger since it will
be used by other libgfx primitives later.

Test: m
Change-Id: I5045ac089020e6ee380e81e8735117c500264b37
loatRect.h
WC2.cpp
WC2.h
WComposer_hwc1.cpp
WComposer_hwc1.h
c03d283e8b3f830d76dd94822b2a13872c05c730 28-Dec-2016 Mark Salyzyn <salyzyn@google.com> resolve merge conflicts of 525a5f2 to master

Test: build
Change-Id: Id1c6d3d9dd158fb086b0d8ab74f7838ef0a51af1
67e376d6564f8b9f996a347c9402bdc9da789321 19-Dec-2016 Chia-I Wu <olv@google.com> Replace non-const references by pointers

Use pointers for outputs to be consistent with the rest of
libui/libsurfaceflinger.

Remove assignFromHidlVec now that hidl_vec can be casted to std::vector.

Test: builds and boots
Change-Id: I656367028302e7b877a766eaf6aa2431fe07643b
omposerHal.cpp
omposerHal.h
WC2.cpp
a5e161b1207ef447a51e99856097d69d4a6111e1 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if required
- add system includes that are assumed as side effects of log.h
- modules that use SLOG should use SLOG for all logging (installd)
- define LOG_TAG first
- remove logging infrastructure if not used

Test: build
Bug: 31289077
Change-Id: Iea147a0104c7ab7f12451304131d6500f42141e7
ramebufferSurface.cpp
WC2On1Adapter.cpp
WComposer.cpp
WComposer_hwc1.cpp
owerHAL.cpp
c4c286f30a60ef9ebfc959ea4869d87ceeb831dc 17-Dec-2016 Romain Guy <romainguy@google.com> Merge "Remove RGBX_FP16 format"
8018f22c2ceb97536828787d0a49c320cb9a18e5 17-Dec-2016 Chia-I Wu <olv@google.com> Merge "surfaceflinger: update for IComposer changes"
d3e08d4811e13aefd656e3376e7d56e2d37bb388 16-Dec-2016 Romain Guy <romainguy@google.com> Remove RGBX_FP16 format

Bug: 32984164
Test: compile
Change-Id: I4e0eadc3066717d4644d71cf2684a617bae34a1f
WComposer_hwc1.cpp
e2caadca83c8842bbfe74e21f11b9e2b5aeb4e13 15-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add fp16 pixel and window formats"
cd8d7f08fe26645f74e540365b1a8a38e602088d 16-Nov-2016 Chia-I Wu <olv@google.com> surfaceflinger: update for IComposer changes

The new IComposer introduces IComposerClient to manage resources and
replaces most state changing functions by a "command buffer" to batch
calls.

Test: builds and boots
Change-Id: Idd1060f83fab28330e7119ff0f5a5bda5429811a
omposerHal.cpp
omposerHal.h
WC2.cpp
9698c2f193666ab506a6edf113c5a77d0d0acb3b 15-Dec-2016 Brian C. Anderson <brianderson@google.com> Merge "Use FenceTime to share fence times and reduce open fds."
100a437706d5a2750ab384d79588411f875a13be 15-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Document HWC2to1Adapter"
339607072fbc0ca39e6e13ce197cb720ef971d91 30-Nov-2016 Fabien Sanglard <sanglardf@google.com> Document HWC2to1Adapter

Change-Id: I1ba60143b74e886f132136c7ecc13fd89c349dd4
WC2.h
WC2On1Adapter.h
ff415149dc5a83a4eb5960daf2cb2c310ef89847 14-Dec-2016 Romain Guy <romainguy@google.com> Add fp16 pixel and window formats

Bug: 32984164
Test: compile
Change-Id: I8303afbf857796295a280c0d9438a3c403a11437
WComposer_hwc1.cpp
3d4039d7a291cd9b6f2dd4b46fcdb576f2db3356 24-Sep-2016 Brian Anderson <brianderson@google.com> Use FenceTime to share fence times and reduce open fds.

FenceTimes are created and shared for each Fence that
FrameTimestampHistory and FrameTracker care about.

On the consumer side, the FenceTimes are also added to
shared timelines that are owned by SurfaceFlinger or
unshared timelines owned by Layer. The timelines are
checked at the end of every frame to minimize the number
of file descriptors open.

On the producer side, the FenceTimes are added to
the ConsumerFrameEventHistory instead, since the timelines
that would be tracked by SurfaceFlinger are not shared
with anyone else in the consumer's process. The timelines
are checked just after a frame is queued to minimize
the number of file descriptors open.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: Ifd4301affe1b24705b2bee7608c5a2c09dfb4041
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ec0a9565d866c69efa6d347a76a78add141de57d 13-Dec-2016 Fabien Sanglard <sanglardf@google.com> Fix memory leak in HWC2to1Adapter

SurfaceDamage regions were not freed after receiving response
from HWC1.

Change-Id: Ibcfd3d598874b433e0cd5a4dbe38227fe51b1524
WC2On1Adapter.cpp
11d0fc38ad8d2e5bb5bc0a282336cabe28dbf9d6 02-Dec-2016 Fabien Sanglard <sanglardf@google.com> Rename "retire" to "present" for consistency

The HWC2 model has no concept of retire fence beyond HWC2to1Adapter
All references to "retire" fence should be called "present"

Change-Id: I26540aad9e65f138a4df60a34eaee030f1c17567
ramebufferSurface.cpp
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
426f9bcfcc17e23ac9ae04aaee3766e299169139 04-Dec-2016 Brian C. Anderson <brianderson@google.com> Merge "Update producer's cache of frame events in de/queue"
4a1f8a53aa0d51486f47ca3d2699e600e540a12a 01-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Rename "commit" to use "present" nomenclature"
e89987affd9a40f9616a696a3c0bfbb94274603e 01-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Rename variable disp to displayId for consistency"
a87aa7bb5e44fd4b352e34d3cd745aa7e038d19f 01-Dec-2016 Fabien Sanglard <sanglardf@google.com> Rename "commit" to use "present" nomenclature

We use "present" down the HWC2, commit is a confusing name.

Change-Id: I7b23edaf4aeab807bc523e31dfcb8e716166d849
WComposer.cpp
WComposer.h
df0b7059646db0734f614e0dd651e0ac6ce82211 01-Dec-2016 Fabien Sanglard <sanglardf@google.com> Rename variable disp to displayId for consistency

Change-Id: I5c0dc977e637a76eba44f8a27dac416c98a961d8
WComposer.cpp
WComposer.h
834bccb1f58780d51367ae39598ae68407986252 01-Dec-2016 Brian C. Anderson <brianderson@google.com> Merge "Add displayPresentTime to getFrameTimestamps"
10ec9947b83cfc7c04a4a30a4ade2900ce73842a 30-Nov-2016 Brian C. Anderson <brianderson@google.com> Merge "BQ: Make QueueBufferOutput implement Flattenable"
4143295750e185cd415a4159f6ffbe686471e1f6 30-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Delete HWC2to1Adapter unused code."
601938c35aa5162ac669004aff8c44d8c25345f0 29-Nov-2016 Fabien Sanglard <sanglardf@google.com> Delete HWC2to1Adapter unused code.

HWC2to1Adapter supports forwarding Display requests from device
to client. However hwc1 does not support the request.

Change-Id: Id2e77b18823d319721473b3a8c8838aa20b7daec
WC2On1Adapter.cpp
WC2On1Adapter.h
27efbdb5df135ef6f09f66bf93e4fef31d28dd54 29-Nov-2016 Fabien Sanglard <sanglardf@google.com> Delete unused mutex in HWC2to1Adapter

Change-Id: I2fe5b8b6d35c07fc2243c88d5739a25be5c61686
WC2On1Adapter.h
3828399b9d1d8c4004ef26e82784604cab841be4 23-Nov-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix 5x and 6P crash when using HWC2to1adapter"
eb3db61f914a2469fe632c48b46a0ce60c84c9d9 19-Nov-2016 Fabien Sanglard <sanglardf@google.com> Fix 5x and 6P crash when using HWC2to1adapter

Angler and Bullhead crash when a SolidColor layer is used in
combination with HWC2to1Adapter. This is due to assumptions in
the HWC1 code (non-null handle field = valid pointer). This
assumption is incorrect with a background layer because it will
set the field backgroundcolor...which occupies the same location
as handle field in hwc_layer_1_t.
This patch detects whether the HWC supports BACKGROUND layer and
sets backgroundcolor/handle accordingly to HWC assumption.

Test: Manual on Angler and Bullhead.

Change-Id: Ic5c3366a4a8989f3a82b6367258bad8af25d3990
WC2On1Adapter.cpp
WC2On1Adapter.h
7c5a92fc5d4d62027f09537df978f2c90c9719c5 21-Nov-2016 Martijn Coenen <maco@google.com> Use hidl_handle instead of native_handle_t*.

To ensure 32/64 compatibility.

Bug: 32089785
Test: builds
Change-Id: Ie86e5734c4a66db7dddd9e93f6dd26990f245d71
omposerHal.cpp
7c3ba8aa288755fad78ddbabcee0ad5a0610ac1c 25-Jul-2016 Brian Anderson <brianderson@google.com> Update producer's cache of frame events in de/queue

* Cache is only updated during queue and dequeue if
the getFrameTimestamps is enabled.
* The consumer avoids sending a copy of the acquire
fence back to the producer since the producer
already has a copy.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: I6a8b965ae79441a40893b5df937f9ed004fe7359
irtualDisplaySurface.cpp
irtualDisplaySurface.h
5901fda2c112390f0877ed1a916fe824d36b222b 17-Nov-2016 Chia-I Wu <olv@google.com> Use android.hardware.graphics.common@1.0

Some types in composer@2.1 and allocator@2.0 are now in common@1.0.

Test: builds and boots
Change-Id: Ied8e5d1b555cd6bfd2c0381cec537293900d3ffe
omposerHal.h
b7432cc57cd957fb18f68d7976c5829b3a3a7751 11-Nov-2016 Fabien Sanglard <sanglardf@google.com> Fix HWC2to1Adapter crashing dragon at startup

Some devices such a dragon(ryu) do not start with a valid active
configuration id (e.g: -1). This is unexpected from HWC2to1Adapter
and resulted in crash at startup when switching the device from HWC1
to HWC2 with adapter.

This patch detects this at startup and put the device in an expected
configutation using the first configuration index (0).

Test: Tested on ryu
Change-Id: If2bb258d12636f1b2ebe8c7b167708dbf572fbe8
WC2.cpp
WC2.h
WC2On1Adapter.cpp
WComposer.cpp
069b365163470d2736eb6f591c354d208b5da23b 22-Jul-2016 Brian Anderson <brianderson@google.com> Add displayPresentTime to getFrameTimestamps

Makes HWC1 use displayRetireTime and HWC2 use
displayPresentTime.

Properly takes into account if HWC2On1Adapter is used.

Returns whether present or retire is supported via
eglQueryTimestampSupportedANDROID, which uses a
cached answer in Surface.

Surface::getFrameTimestamps returns with an error
if the caller requests an unsupported timestamp.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: Ib91c2d05d7fb5cbf307e2dec1e20e79bcc19d90b
WComposer.cpp
WComposer.h
baaad32cd582bcc09db89135715717234ea398ea 23-Jul-2016 Brian Anderson <brianderson@google.com> BQ: Make QueueBufferOutput implement Flattenable

It will need to support file descriptors soon.

Also:
* Make it's members public and clean up
inflate/deflate usage.
* Send Fence::NO_FENCE over Binder from dequeue
to indicate lack of fence.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: Ia9e4600424a89ce026ba27e8aaed27a6bab860a4
irtualDisplaySurface.cpp
aab99f576b205114eaa5399c8f97b9e175a1c698 04-Oct-2016 Chia-I Wu <olv@google.com> surfaceflinger: add support for android.hardware.graphics

This adds a new path to HWC2 to use
android.hardware.graphics.composer@2.1::IComposer instead of hwcomposer2.
Which path to use is determined by whether BYPASS_IHWC is set at compile
time. When it is set, the old path, kept for HWC2On1Adapter, is used.
When it is not set, the new path is taken.

BYPASS_IHWC2 is set when TARGET_USES_HWC2 is not.

Test: Maps, Camera, YouTube, etc.
Change-Id: I37aceafd1733fa9f76e7f7db4f59ad4776415306
omposerHal.cpp
omposerHal.h
WC2.cpp
WC2.h
WComposer.cpp
b5ee1789189b52d0dbb96c42d8ff36397b3011b2 05-Oct-2016 Ruchi Kandoi <kandoiruchi@google.com> PowerHAL: Make powerHAL calls compatible with HIDL

Bug: 31177288
Change-Id: Ibce75c770996aa32385dab388baf32abb27792cb
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
owerHAL.cpp
dc782511dcaf46c7fa7488391cc27f0d0be354b0 27-Sep-2016 Colin Cross <ccross@android.com> Rename dump methods to dumpState

The dump methods shadow the IBinder dump method. The warnings were being
hidden by the use of -isystem to include frameworks/native/include.

Bug: 31752268
Test: m -j
Change-Id: Iafc64da43032d5d9d84b64640e70d93fd7051bcf
(cherry picked from commit 3d1d280fa3cbc30700f728a4b13e5308315433d3)
ramebufferSurface.cpp
3d1d280fa3cbc30700f728a4b13e5308315433d3 27-Sep-2016 Colin Cross <ccross@android.com> Rename dump methods to dumpState

The dump methods shadow the IBinder dump method. The warnings were being
hidden by the use of -isystem to include frameworks/native/include.

Bug: 31752268
Test: m -j
Change-Id: Iafc64da43032d5d9d84b64640e70d93fd7051bcf
ramebufferSurface.cpp
3d0becdcec3f27880b345bd05f2120c1f7e668df 23-Sep-2016 Robert Carr <racarr@google.com> Surface: Add force disconnection method. am: 97b9c86338 am: 962b13b9be
am: a9d1c1099d

Change-Id: Iea981cfaddd2be6ecdfebbdfadd9d822f17d682f
a9d1c1099d795d8ccafbbf48ee053d34505fbbde 23-Sep-2016 Robert Carr <racarr@google.com> Surface: Add force disconnection method. am: 97b9c86338
am: 962b13b9be

Change-Id: Ie74482a867c24213a25332650b38c733e183630b
962b13b9be70217fc6f0c8db72891c44629c345c 23-Sep-2016 Robert Carr <racarr@google.com> Surface: Add force disconnection method.
am: 97b9c86338

Change-Id: Ia9f9dbdcbd9527d54dacb2cdc90eda443230e8d9
1bd88fc3350640c028a0f301e6903a2a480f9397 16-Sep-2016 Dan Stoza <stoza@google.com> HWC2On1: Fall back to GLES for SolidColor am: 5df47cb648 am: d946ae67c2
am: 9e718be5fb

Change-Id: I9644bee3005e9d819fa375c41ee36b6f0e04287e
9e718be5fbf6bd89cd734be635fc67c8e631e2f6 16-Sep-2016 Dan Stoza <stoza@google.com> HWC2On1: Fall back to GLES for SolidColor am: 5df47cb648
am: d946ae67c2

Change-Id: I9c866a4cbf23f4e8dcdaf922063c4a26f7da7c51
5df47cb648a6911dd62527901bb209fd65c73bed 16-Sep-2016 Dan Stoza <stoza@google.com> HWC2On1: Fall back to GLES for SolidColor

Even though SolidColor layers map cleanly to HWC_BACKGROUND composition
in HWC1, SurfaceFlinger never used HWC_BACKGROUND, so we can't trust
that HWC1 devices implemented it correctly. To preserve backwards
compatibility, this changes the behavior to fall back to client
composition to minimize incompatibilities with existing devices.

Bug: 30479781
Change-Id: I638339062e03f2c057b3e1624e7157587ddee7ec
WC2On1Adapter.cpp
97b9c86338e2d364d47ea7522c2d81a8014f0e07 08-Sep-2016 Robert Carr <racarr@google.com> Surface: Add force disconnection method.

Add a new method forceScopedDisconnect to Surface. This will
be used by the framework to force disconnection at times where
the underlying GraphicBufferProducer may be about to be reused.
This is scoped by PID to avoid conflicting with remote producers.

Bug: 30236166
Change-Id: I857216483c0b550f240b3baea41977cbc58a67ed
irtualDisplaySurface.cpp
irtualDisplaySurface.h
071b0a64c6dad8eaa1449827e44faae57dba851b 12-Sep-2016 Chih-Hung Hsieh <chh@google.com> Merge "Fix google-explicit-constructor warnings in surfaceflinger." am: 5e703a6ad0 am: 101b4cc9d7 am: 32db2f3c9f
am: 9a9816ad3f

Change-Id: I5766b8b9adb236795cc7c8449d97b6c300512623
9a9816ad3f3e2ee0d52a21e742d9bbdc3ddf25ff 12-Sep-2016 Chih-Hung Hsieh <chh@google.com> Merge "Fix google-explicit-constructor warnings in surfaceflinger." am: 5e703a6ad0 am: 101b4cc9d7
am: 32db2f3c9f

Change-Id: Ie75a9e21c634691243d4f5c972f2f2879c48a76e
32db2f3c9f71da6da5fb5a25623a8dfdbd5e8d49 12-Sep-2016 Chih-Hung Hsieh <chh@google.com> Merge "Fix google-explicit-constructor warnings in surfaceflinger." am: 5e703a6ad0
am: 101b4cc9d7

Change-Id: I02a49f1207899cf0153e1aa9649e105372117e25
342b760763300593cd20b01dac8cef61e7b25b86 01-Sep-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings in surfaceflinger.

* Add explicit keyword to conversion constructors,
or use NOLINT for implicit converters.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: I94f511c3be31dc22022db6466ee9ed0c6be2bc8e
loatRect.h
WC2.h
WC2On1Adapter.h
665490affbfb14d9a15923d2757d133f0089b498 22-Jul-2016 Dan Stoza <stoza@google.com> HWC2: Kill logspam for non-HWC virtual displays am: ec0f717dfd
am: 38f86bcab0

Change-Id: I5234ed58634ef92ec7bb3d194222f6ccd0c98c97
ec0f717dfd3821cbc648198c6d3b98fcc3b53369 21-Jul-2016 Dan Stoza <stoza@google.com> HWC2: Kill logspam for non-HWC virtual displays

Removes some logspam and fixes some non-errors which were reported as
errors when running a virtual display that is not backed by hardware
composer.

Bug: 30022738
Change-Id: Ie966e37d95f53bcc050eef064d24bbe26748b7fd
WComposer.cpp
c75ca51da3b41618c9633ca66f06b05daa98f276 20-Jul-2016 Michael Wright <michaelwr@google.com> Initialize HWC2On1Adapter with android_mode_t

Change-Id: I38726b5930927f9fe55e1433b74a6790f8813ec3
WC2On1Adapter.cpp
c4cba997508820c5ffbbcdca8d4769944a7caacf 20-Jul-2016 Michael Wright <michaelwr@google.com> Merge commit '19cd2f88b6914e2f4c43a9595532e81a697304fe' into fresh-again

Change-Id: I6032eea1ad12960fc1c88582ae295f83c84bb37e
441cf01dcf41862a64d794f845b53a398094cbee 19-Jul-2016 Pablo Ceballos <pceballos@google.com> Merge "Make sure constructors initialize all members"
28f24d0ab481bd9c6fd5618414fee694e837c5c6 12-Jul-2016 Michael Wright <michaelwr@google.com> Color transforms are now color modes.

Rename color transforms to color modes for all interfaces exposed to
surfaceflinger clients. Also split it out to be a separate
configuration value from display modes.

Bug: 29044347

Change-Id: I87e937f7c954a50c946e8e2c606797caa416c5d8
WC2.cpp
WC2.h
WC2On1Adapter.cpp
WC2On1Adapter.h
WComposer.cpp
WComposer.h
WComposer_hwc1.cpp
WComposer_hwc1.h
615e573cae9eca90ffc7f6527393a97914107cdf 15-Jul-2016 Dan Stoza <stoza@google.com> SF/HWC2: Add support for color transforms am: 9f26a9c8be
am: 840dae503c

Change-Id: I64e2d133031c010aa12c5e8c764f4845357b6c42
9f26a9c8be6f00f55cbc30b93adf4895c6a093aa 22-Jun-2016 Dan Stoza <stoza@google.com> SF/HWC2: Add support for color transforms

Adds support for color transforms using the setColorTransform method
of HWC2.

This means that instead of always falling back to client composition
when applying a transform, SurfaceFlinger will allow the device to
make that decision. If all layers fall back to client composition, the
SKIP_CLIENT_COLOR_TRANSFORM capability allows the device greater
control over whether SF should apply the transform or whether it
should allow the device to apply it to the client target buffer.

Bug: 19539930
Change-Id: I47a3d5453a3c47a8dd105ab77cce7f9c9687e925
WC2.cpp
WC2.h
WComposer.cpp
WComposer.h
444230acb5c1207c658e84ddccd2c5672d8c8771 14-Jul-2016 Dan Stoza <stoza@google.com> Merge \\"HWC2: Fix virtual displays\\" into nyc-mr1-dev am: d47c07fe33
am: 8abbfbcd69

Change-Id: I62e9ae529c6c9bacaf89ae6ee40e21656ca09933
d47c07fe3368a4c916475361120c638ead988ffd 14-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HWC2: Fix virtual displays" into nyc-mr1-dev
bd3577ef5bae7d65e54bddc04f90b619330edb89 21-Jun-2016 Pablo Ceballos <pceballos@google.com> Make sure constructors initialize all members

- Add default constructors to Parcelables that didn't have them and
make sure all members are initialized by the constructors.
- Add missing fields to BufferItem flatten/unflatten.

Change-Id: I9aa83b326dc3aee757762e63be499dc96a74df91
WC2On1Adapter.cpp
WC2On1Adapter.h
38628986f2bb3b392dd4b519aacb9354320e409f 14-Jul-2016 Dan Stoza <stoza@google.com> HWC2: Fix virtual displays

Close the output buffer release fence per the contract in
hwcomposer2.h.

Also changes the HWC2 device to hold a weak pointer to the display,
which allows it to properly remove it when it gets torn down.

Bug: 29945684
Change-Id: Ib1b5d81e42a63d0e65b189f7c6c62e661e0ab6ae
WC2.cpp
WC2.h
8305f25b66773e914a3fe1df19d8aa7783df03af 13-Jul-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Merge changes Iea048eaa,I5c246571 into nyc-mr1-dev am: 72d1772eca
am: 340680891a

Change-Id: If71c96930270a5290e066c29477305686e3b1d2d
72d1772eca21cd1d109a7fe6ee927cbda4df64bc 13-Jul-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Merge changes Iea048eaa,I5c246571 into nyc-mr1-dev

* changes:
Add support for multiple color modes
Remove unused DisplayInfo structure
787d72b601fbfa1f410dc8e1bc396cfdf236da95 12-Jul-2016 Pablo Ceballos <pceballos@google.com> Merge \\"BQ: Remove getNextFrameNumber Binder call\\" into nyc-mr1-dev am: f9de6e0d7e
am: 45bb23ad43

Change-Id: I3972481dff062762b914cf3a4d7f4250e4cafae1
fad9d8cd070e94749d8eb5be8f92011c9567a44c 23-Jun-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Add support for multiple color modes

Bug: 29044347
Change-Id: Iea048eaa62f072a9bbefc4f3a6c29a9e593eab69
WComposer.cpp
WComposer.h
1d6c0e979e7e2a490d7403acd7e966da0e642973 22-Jun-2016 Courtney Goeltzenleuchter <courtneygo@google.com> Remove unused DisplayInfo structure

Bug: 29044347
Change-Id: I5c2465719050c8727b0b48ef515ee79a24e3d65d
WComposer.h
bc8c1928e1dbdaf6a2820f6e426c96ed61284043 01-Jul-2016 Pablo Ceballos <pceballos@google.com> BQ: Remove getNextFrameNumber Binder call

- Return the value in queueBuffer instead and cache it in Surface

Change-Id: I10ab112afb03cf0231b047d4a4569cd641827043
irtualDisplaySurface.cpp
irtualDisplaySurface.h
56b8c6418703bc941c415deb668ff610217d82c8 01-Jul-2016 Pablo Ceballos <pceballos@google.com> resolve merge conflicts of 7467665 to nyc-mr1-dev-plus-aosp
am: 6155b40830

Change-Id: If8e7c75a76e410e13424d1a9c173e9cfbedb17bd
0ade247d4b02b81f323480b4ba043927f6b36a73 01-Jul-2016 Pablo Ceballos <pceballos@google.com> resolve merge conflicts of 8e3e92b to nyc-mr1-dev

Change-Id: Ic67f0894e68ea5276eb9187a13cd24f105d55d68
6155b40830e7945e9d4a76fe89af9a6322d4977f 01-Jul-2016 Pablo Ceballos <pceballos@google.com> resolve merge conflicts of 7467665 to nyc-mr1-dev-plus-aosp

Change-Id: I69094217d8f09b44d38fefd48d1717322cfca55d
8e3e92b906db431c4fa822f21242977d4ee99942 28-Jun-2016 Pablo Ceballos <pceballos@google.com> BQ: Add and expose a unique id

Bug 29422927

Change-Id: I80eab94f073ebc378302f00fa86a740c3643657e
irtualDisplaySurface.cpp
irtualDisplaySurface.h
d2b093aa60168b98e337262fd27f7f20962b9926 16-Jun-2016 Dan Stoza <stoza@google.com> Merge \\"HWC2On1Adapter: populateCapabilities: fix virtual display query\\" into nyc-mr1-dev am: 91476a0c20
am: abb745c556

Change-Id: I0f22a1e84655b79319d9e480b3dc1a951ab43e1d
c50c01e0b8a1ef3bac59477cb9ecf946a363c9f8 15-Jun-2016 Fred Fettinger <fettinge@motorola.com> HWC2On1Adapter: populateCapabilities: fix virtual display query

To determine whether a HWComposer implementation supports virtual
displays, HWC2On1Adapter::populateCapabilities() calls
query(HWC_DISPLAY_TYPES_SUPPORTED). However, it incorrectly uses
HWC_DISPLAY_VIRTUAL instead of HWC_DISPLAY_VIRTUAL_BIT. Update the
check to use the correct bitmask.

Change-Id: I1ad95d5222a0353816ee65936cf033e5244c80cc
WC2On1Adapter.cpp
6b5d740d54fd3cf9f0f57098e981141ca0c02d9f 24-May-2016 Dan Stoza <stoza@google.com> Merge "HWC2: Fix breakage from header change" into nyc-dev am: 80bc52aefa am: fce9f9cfce
am: 8827b8a75e

* commit '8827b8a75eb858ae3778fb491b136a4a029107a4':
HWC2: Fix breakage from header change

Change-Id: I282f18bdaccc9c792ec967775bf4779f6d91ed2c
5cf424bc129f01ee12c7a4fbea1664276d29f970 20-May-2016 Dan Stoza <stoza@google.com> HWC2: Fix breakage from header change

Updates the shim and adapter to handle the header changes introduced
by "HWC2: Add format to VD create, surface damage" in libhardware.

Bug: 22767098
Change-Id: I8142301c121d9b5602a4455f3fbadefefd685cf0
WC2.cpp
WC2.h
WC2On1Adapter.cpp
WC2On1Adapter.h
WComposer.cpp
WComposer.h
95b3a64a5f25bea6e0a11d7a1cf581d6aaf24304 05-May-2016 Chih-hung Hsieh <chh@google.com> Merge "Fix google-explicit-constructor warnings."
076ac670262e448c531e6db7727cfade325866ca 14-Mar-2016 Dan Stoza <stoza@google.com> HWC2: Add support for color modes

Adds support for setting color modes through HWC2On1Adapter and the
HWC2 C++ shim

Bug: 22767098
Change-Id: I0b7300093ab427be7105a2535fc9db4953b8af1c
WC2.cpp
WC2.h
WC2On1Adapter.cpp
WC2On1Adapter.h
5df2a86063c6a83813fc1aa3d8938a82f7ff8f14 25-Mar-2016 Dan Stoza <stoza@google.com> HWC2: Hook up setColorTransform/setLayerDataspace

Plumbs the setColorTransform and setLayerDataspace calls through the
HWC2 C++ shim and implements a trivial versions in the adapter,
which drops non-HAL_DATASPACE_UNKNOWN layers to client composition,
and which drops all layers to client composition if a color transform
is applied.

Bug: 22767098
Change-Id: Ifffd19b77cf3b33ec86fde3f72257f6b97b4dd79
WC2.cpp
WC2.h
WC2On1Adapter.cpp
WC2On1Adapter.h
c406791ead6d864ec693ad01a80c5f471bdc2a7a 03-May-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: I7e061f68acdde368a3b63c029b928133646ebff2
WC2On1Adapter.cpp
WComposer_hwc1.cpp
1a61da5e28fa16ad556a58193c8bbeb32a5f636d 28-Apr-2016 John Reck <jreck@google.com> Return the transform to apply in getLastQueuedBuffer

Bug: 28428955
Change-Id: Id48f7d3bf3f5deb074cf0a6a52a41caac875db41
irtualDisplaySurface.cpp
irtualDisplaySurface.h
50101d02a8eae555887282a5f761fdec57bdaf30 08-Apr-2016 Dan Stoza <stoza@google.com> libgui: Add getLastQueuedBuffer to BufferQueue

Adds the ability to get the last buffer queued to a BufferQueue plus
its acquire fence.

Bug: 27708453
Change-Id: Iee39475740b40c854a5f46178b2934fd930e61b8
irtualDisplaySurface.cpp
irtualDisplaySurface.h
12402e34ad453f58e2c9d39fa65772f6cb09a0b6 15-Apr-2016 Dan Stoza <stoza@google.com> Merge "SF: Fix the delivery of visible and damage rects to HWC" into nyc-dev
f5abc7801eb008708d31c8f349d4301881c51c89 15-Apr-2016 Gary Smith <gary.k.smith@intel.com> SF: Fix the delivery of visible and damage rects to HWC

The storage space for the visible and damage regions was inside the
HWCLayerVersion1 class, which is temporarily allocated while using
an iterator. As such, the storage has been deleted by the time the
HWC gets a pointer to it sometime later and hence the HWC reads
garbage in all layers.

This commit moves the storage into the DisplayData structure and hence
it persists until the next frame.

Bug 28200888

Change-Id: If7cc8d2de49e3e66e9d17cc45934d8e544576026
WComposer_hwc1.cpp
WComposer_hwc1.h
8bf556ec85af8d4d47aad5a19a0633cf8b0fa17e 15-Apr-2016 Dan Stoza <stoza@google.com> Merge "HWC2: Change version detection scheme" into nyc-dev
355f60461b1ec4f0035fcb5e73d36e662352cd18 14-Apr-2016 Dan Stoza <stoza@google.com> HWC2: Change version detection scheme

SurfaceFlinger now checks hardware composer module numbers by looking
at device.version, the high byte of which corresponds to the HWC
major version (0x01... for HWC 1.x and 0x02... for HWC 2.0).

Bug: 28161397
Change-Id: I4560bf60c35bdb97629fda1aa1256b03122688ad
WComposer.cpp
09e7a27fabde3da99ba6dfd2fd20be7d1425a9ad 14-Apr-2016 Dan Stoza <stoza@google.com> HWC2: Check SidebandStream capability on load

Checks whether the HWC2 device has the SidebandStream capability
before attempting to load the corresponding function pointer

Bug: 28161394
Change-Id: I6407d61a1b23138781e57213bcb868be46609018
WC2.cpp
WC2.h
c4f471e75a8ec64ec34e3f2944a5a756215d0bec 24-Mar-2016 Dan Stoza <stoza@google.com> Plumb HDR capabilities up to SurfaceComposerClient

Plumbs HDR capabilities up from HWC2 through SurfaceFlinger and
ISurfaceComposer to SurfaceComposerClient.

Bug: 25684127
Change-Id: I0f07043ff42bfc7a159f785fee3e84936dc3c280
WComposer.cpp
WComposer.h
7d7ae7345abfb91be55c4aed6c9be9d09a144e4c 16-Mar-2016 Dan Stoza <stoza@google.com> HWC2: Add getHdrCapabilities to C++ shim

Adds support for the getHdrCapabilities call to the HWC2 C++ shim.

Bug: 25684127
Change-Id: Ib4635ee437a06b48945e7f0328492c1e74e27aaa
WC2.cpp
WC2.h
ed40eba4c1264806a1b795bf45b0dea366ee9975 16-Mar-2016 Dan Stoza <stoza@google.com> HWC2: Add getHdrCapabilities stub to adapter

Adds a minimal getHdrCapabilities stub to the HWC2On1Adapter, which
always returns 0 supported HDR types (as per the HWC2 spec).

Bug: 25684127
Change-Id: I472ad9f08d1b97d5de69d044790badf3af60da72
WC2On1Adapter.cpp
WC2On1Adapter.h
59d12e90ae09171fc8b50fd8fd02e3247c04840c 28-Mar-2016 Pablo Ceballos <pceballos@google.com> Merge "Rename single buffer mode to shared buffer mode" into nyc-dev
40845df1285b387bcbf8f43ac72228eee2606d80 26-Jan-2016 Pablo Ceballos <pceballos@google.com> SF: Add FenceTracker

FenceTracker tracks all fences in SurfaceFlinger. These timestamps
could be used for debugging, profiling, or be exposed to the
application.

Change-Id: I4297a661c0a7530e744168ac7a2a66c4bca92fd5
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
3559fbf93801e2c0d9d8fb246fb9b867a361b464 17-Mar-2016 Pablo Ceballos <pceballos@google.com> Rename single buffer mode to shared buffer mode

Change-Id: Id43d0737d9367981644e498942ebc0077d61038c
irtualDisplaySurface.cpp
irtualDisplaySurface.h
9e56aa0fdb5f7121b9b975c6c16db103ea4d2fe9 02-Nov-2015 Dan Stoza <stoza@google.com> Switch SurfaceFlinger to HWC 2.0

Enables SurfaceFlinger to speak to version 2.0 of the Hardware Composer
HAL instead of version 1.x (also removing support for the framebuffer
HAL). By default, however, this functionality is disabled. In order to
enable it, USE_HWC2 must be set to true in Android.mk.

Change-Id: I4589e02ac2165236b10ff2f7cb772f87e0d3daab
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
WComposer_hwc1.cpp
WComposer_hwc1.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
fc4e202b33d33b5e11181f09a2229d3ef7ae925a 23-Feb-2016 Dan Stoza <stoza@google.com> HWC2On1Adapter: Initialize variables and fix mutex

Initializes a few variables that had been missed before, and switches
the Adapter state mutex to be recursive, since it is held during the
call into HWC1 prepare, which can call back into the Adapter to perform
an invalidate.

Change-Id: Id300e8b23403f5339562fd860c2ce9d0f2b72f27
WC2On1Adapter.cpp
WC2On1Adapter.h
a4c2c3ba1ed2d741edfa652bf8f2bab229389e8e 23-Feb-2016 Dan Stoza <stoza@google.com> Merge changes I8cc3ce7d,Ie1a7bfd2,Id472ed4e into nyc-dev

* changes:
libgui: Allow for pending releases in GLConsumer
SF: HWC2 C++ shim
SF: HWC2On1Adapter
651bf314a6a1a77e4cbb66ffb81221200f918290 24-Oct-2015 Dan Stoza <stoza@google.com> SF: HWC2 C++ shim

Provides an object-based C++ interface to the HWC 2.0 HAL

Change-Id: Ie1a7bfd2f6faa548bc45da845a4f50f1915b5806
loatRect.h
WC2.cpp
WC2.h
c6998d2391e6e54cf0664bb664e0fba2f2fce1da 25-Sep-2015 Dan Stoza <stoza@google.com> SF: HWC2On1Adapter

This provides an adapter from HWC 2.0, which SurfaceFlinger will be
converted to speak, to HWC 1.x, which all current implementations
support. It requires at least HWC 1.1.

Change-Id: Id472ed4eef0f816403cdf2d40a56177cc7f65930
WC2On1Adapter.cpp
WC2On1Adapter.h
ff95aabbcc6e8606acbd7933c90eeb9b8b382a21 14-Jan-2016 Pablo Ceballos <pceballos@google.com> Add interface for controlling single buffer auto refresh

- Adds a boolean to BufferQueue that controls whether or not auto
refresh is enabled in SurfaceFlinger when in single buffer mode.
- Adds plumbing up to ANativeWindow.
- When enabled, it will cache the shared buffer slot in Surface in
order to prevent the Binder transaction with SurfaceFlinger.

Bug 24940410

Change-Id: I83142afdc00e203f198a32288f071d926f8fda95
irtualDisplaySurface.cpp
irtualDisplaySurface.h
127fc63e8a15366b4395f1363e8e18eb058d1709 30-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add dequeue/attach timeout

Adds the ability to specify the timeout when dequeueBuffer or
attachBuffer block due to the lack of a free buffer/slot. By default,
these will block indefinitely (which is signified by a timeout of -1).

When a timeout (other than -1) is specified, non-blocking mode is
disabled and the given timeout will be used instead.

Bug: 25196773
Change-Id: I17fdbeebccb7c8d878703d758ac1209608258e61
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ccdfd60d79a8b7f1ed6401d0f2e8e29166a10584 08-Oct-2015 Pablo Ceballos <pceballos@google.com> BQ: Add support for single buffer mode

- Adds a single buffer mode to BufferQueue. In this mode designate the
first dequeued buffer as the shared buffer. All calls to dequeue()
and acquire() will then return the shared buffer, allowing the
producer and consumer to share it.
- Modify the buffer slot state tracking. Add a new SHARED state for
the shared buffer in single buffer mode. Also track how many times
a buffer has been dequeued/queued/acquired as it's possible for a
shared buffer to be both dequeued and acquired at the same time, or
dequeued/acquired multiple times. This tracking is needed to know
when to drop the buffer out of the SHARED state after single buffer
mode has been disabled.
- Add plumbing for enabling/disabling single buffer mode from Surface.

Bug 24940410

Change-Id: I3fc550c74bacb5523c049a227111356257386853
irtualDisplaySurface.cpp
irtualDisplaySurface.h
b0c8d787040974128dc7c7c2e484da66a2437815 29-Oct-2015 Rob Carr <racarr@google.com> Merge "Support SurfaceView synchronization."
7dde599bf1a0dbef7390d91c2689d506371cdbd7 22-May-2015 Dan Stoza <stoza@google.com> Support SurfaceView synchronization.

Add API for fetching the next frame number to be produced by
a given buffer producer. Add an API to SurfaceComposer to
defer execution of the current transaction until a given frame number.
Together these may be used to synchronize app drawing and surface
control updates.

Change-Id: I8e0f4993332ac0199c768c88581a453fefbaff1d
irtualDisplaySurface.cpp
irtualDisplaySurface.h
f133d003aaac80a0932a2d8f9efd8493e56f7814 23-Oct-2015 Pablo Ceballos <pceballos@google.com> SF: Connect the VDS scratch surface producer

- VirtualDisplaySurface has a BufferQueue for producing scratch
buffers when doing mixed composition for a virtual display.
- Connect/disconnect the producer end of this BufferQueue in the
VirtualDisplaySurface constructor/destructor to avoid using it in a
disconnected state.

Bug 24733179

Change-Id: I87dab9ff4f46d422b7796670b0b4d17b7fd09165
irtualDisplaySurface.cpp
567dbbb6dd42be5013fcde0dadb3316d85f2fa0d 27-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: get rid of async in producer interface

- Get rid of the async flag in dequeueBuffer, allocateBuffers,
waitForFreeSlotThenRelock, and QueueBufferInput.
- Instead use the persistent flags mDequeueBufferCannotBlock and
mAsyncMode to determine whether to use the async behavior.

Bug 13174928

Change-Id: Ie6f7b9e46ee3844ee77b102003c84dddf1bcafdd
irtualDisplaySurface.cpp
irtualDisplaySurface.h
583b1b32191992d6ada58b3c61c71932a71c0c4b 04-Sep-2015 Pablo Ceballos <pceballos@google.com> BQ: Prevent operations on disconnected BQs

- Update unit tests to match

Bug 23763412

Change-Id: I77e59bf6b57b328433c3835450455f80a8fa454b
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ff12cba77b5b88f3978070bb970d7721225271ee 16-Sep-2015 Pablo Ceballos <pceballos@google.com> Merge "BQ: Modify consumer buffer count interfaces"
e1b63cc6d4e92b95d9d5e504035a44e3cb40b722 14-Sep-2015 Pablo Ceballos <pceballos@google.com> Merge "Remove usage of SharedBuffer"
4aa427b964f22e3cf10381f8fc27e7042c322b9c 14-Sep-2015 Pablo Ceballos <pceballos@google.com> Merge "native: Rename mBuf to mSlot"
d814cf2a3e3a2fdb73efa80539fe8af0a93da1db 11-Sep-2015 Pablo Ceballos <pceballos@google.com> Remove usage of SharedBuffer

- Remove getSharedBuffer() from Region
- Don't use SharedBuffer for memory management in HWCLayerVersion1,
instead keep shallow copies of the Regions.

Bug 23962051

Change-Id: I8fa17beed57936648c7b4defc9219dff1d5b337f
WComposer.cpp
71b2947cfd1be2795a2e1313f4b799c5588c3430 04-Sep-2015 Dan Stoza <stoza@google.com> am afdbddbe: am e5ce0db8: am f090d598: am 3e4c8ccc: Merge "SF: Add colorTransform to DisplayInfo" into mnc-dr-dev

* commit 'afdbddbef57b3ffafa5b6a2107f37fda06dec9d4':
SF: Add colorTransform to DisplayInfo
19e3e06e3c65a7c001a6fe0971744ba5ff536515 20-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: Modify consumer buffer count interfaces

- Rename setDefaultMaxBufferCount() to setMaxBufferCount(). Modify it
to be hard maximum on the number of buffers that can't be overwritten
by the producer.
- Enforce the maximum buffer count in setMaxAcquiredBufferCount(),
setMaxDequeuedBufferCount(), and setAsyncMode().
- Remove mOverrideMaxBufferCount as it's no longer needed since
overriding is no longer possible.
- Expose setMaxAcquiredBufferCount() in GLConsumer.
- Remove disableAsyncBuffer(), it was only being used for single buffer
mode. Single buffer mode is now achievable with setMaxBufferCount().

Bug 13174928

Change-Id: Ia33799f42751272a711fbd8559f7602ce9f18e4f
ramebufferSurface.cpp
irtualDisplaySurface.cpp
f2699fc3a8c12b2bf95120c068801e050168bd96 31-Aug-2015 Dan Stoza <stoza@google.com> SF: Add colorTransform to DisplayInfo

Adds the colorTransform field, which defines a vendor-specific color
transform (e.g., wide gamut, sRGB, etc.) to the DisplayInfo class, and
populates it from the HWC interface.

Bug: 20853317
Change-Id: I153edc36a361407656f3eb5082b96c2da2ecbec7
WComposer.cpp
WComposer.h
e5b755a045f4203fdd989047441259893c6fbe2d 14-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: Get rid of setBufferCount

- Remove setBufferCount from BufferQueueProducer and
IGraphicsBufferQueueProducer.
- Get rid of the unit tests for it.
- In Surface, convert setBufferCount calls into calls to
setMaxDequeuedBufferCount.
- Change mOverrideMaxBufferCount to a boolean since it can now be
derived from mMaxAcquiredBufferCount, mMaxDequeuedBufferCount, and
mAsyncMode.

Bug 13174928

Change-Id: Ia0adc737fae9e13f186df832b8428a0829041bf9
irtualDisplaySurface.cpp
irtualDisplaySurface.h
fa455354557f6283ff3a7d76979e52fd251c155f 13-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: add setMaxDequeuedBufferCount

Adds the new setMaxDequeuedBufferCount() function to
BufferQueueProducer. This will eventually replace setBufferCount.

Also add setAsyncMode.

Bug 13174928

Change-Id: Iea1adcd5d74a75f67d8e9dde06d521695628ad5a
irtualDisplaySurface.cpp
irtualDisplaySurface.h
47650f4f66a49e1815ad08ca4fb12a661d133abc 05-Aug-2015 Pablo Ceballos <pceballos@google.com> native: Rename mBuf to mSlot

Remove the union in BufferItem.

Bug: 19769719
Change-Id: I4e496b5aafce0fc5206dc7551a741f9c262c2cd0
ramebufferSurface.cpp
irtualDisplaySurface.cpp
53390e1e8c33ebee5bb8100e846f5263ba05ff73 04-Aug-2015 Pablo Ceballos <pceballos@google.com> libgui/SF: Fix some code warnings

A couple of fixes to satisfy the Eclipse static code analysis tool.
- Initialize all members in constructors
- Remove unused forward declarations
- Add parentheses when combining logical and bitwise operators
- Fix a case statement with no break (it was intentional)

Change-Id: Icecb8cc98c6f58b97ab33fffb621f0edc33a7d3c
loatRect.h
e04e4edcd1a852058775caa34cf73e2c20dc1066 11-Jun-2015 Manoj Kumar AVM <manojavm@codeaurora.org> sf: Fix incorrect state reporting in dumpsys

Dumpsys utility accesses layer compositionType variable
with out proper protection. These variables are modified
during hwc_prepare call. Existing HAL lock protection is not
sufficient to address this issue. Failure to do this will
result in incorrect state reporting in dumpsys.

A new displayLock mutex in HWComposer will be used in both
dumpsys and draw calls to ensure correct state is accessed.

Change-Id: I8a57de59525adc0e089b3bed95c067c01e42b666
(cherry picked from commit e54506b81a3b81683056ad48294e37d6b4b4e36b)
WComposer.cpp
WComposer.h
c6f30bdee1f634eb90d68cb76efe935b6535a1e8 08-Jun-2015 Dan Stoza <stoza@google.com> libgui/SurfaceFlinger: Add getConsumerName

Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
irtualDisplaySurface.cpp
irtualDisplaySurface.h
812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2 03-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add generation numbers to BufferQueue

This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.

It also plumbs the setGenerationNumber method through Surface, with the
additional effect that any buffers attached to the Surface after
setting a new generation number will automatically be updated with the
new number (as opposed to failing, as would happen on through IGBP).

Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
irtualDisplaySurface.cpp
irtualDisplaySurface.h
10613dc3b565e95d3d5f459ec70fd2f6a77f807a 13-May-2015 Michael Lentine <mlentine@google.com> Add hotplug support for primary display.

When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
WComposer.cpp
4e3e30c2d5a2a6f7dc4ee8696b1ac2a52dffd5dc 03-May-2015 Ajay Dudani <adudani@codeaurora.org> surfaceflinger: Fix range check for getFormat

Fix potential buffer overflow error in getFormat with indices
greater than MAX_HWC_DISPLAYS.

Change-Id: I5e5b69d8d043e900f5e33ca9a62e94ae5f857b68
WComposer.cpp
9de7293b0a1b01ebe6fb1ab4a498f144adc8029f 17-Apr-2015 Dan Stoza <stoza@google.com> libgui: Allow an IGBProducer to disable allocation

Adds a new method IGBP::allowAllocation, which controls whether
dequeueBuffer is permitted to allocate a new buffer. If allocation is
disallowed, dequeueBuffer will block or return an error as it
normally would (as controlled by *ControlledByApp).

If there are free buffers, but they are not of the correct dimensions,
format, or usage, they may be freed if a more suitable buffer is not
found first.

Bug: 19801715
Change-Id: I0d604958b78b2fd775c2547690301423f9a52165
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ee44edd0acccbf5eaa918d75737c3b65ee04fff7 23-Mar-2015 Dan Stoza <stoza@google.com> SurfaceFlinger: Pass surface damage to HWC

Passes the surface damage from the incoming SurfaceFlingerConsumer
BufferQueue down to the hardware composer HAL interface, if the
HWC version number is 1.5 or greater.

Bug: 11239309
Change-Id: Ic4305210593874a8d6deba3319055b2b8c57e926
WComposer.cpp
WComposer.h
11611f9be590480d7ea27bf0153558573ddcded2 12-Mar-2015 Dan Stoza <stoza@google.com> DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItem

Switches all uses of IGraphicBufferConsumer::BufferItem (and
BufferQueue::BufferItem) to the BufferItem in libgui. Depends on
frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9.

Cherry pick of I187b3a7d05196b6289596afac8fb9a9d4aebff76

Change-Id: I5bc79fb96b6cba6021af64b20890967aa3b7fcbf
ramebufferSurface.cpp
irtualDisplaySurface.cpp
82c6bcc9705eabcaf5b9e45bc81867b0e2d61a02 20-Feb-2015 Eino-Ville Talvala <etalvala@google.com> DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.

- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace

Cherry pick of I070bd2e7c56506055c419004c29e2e3feac725df

Change-Id: I461952389c18051176c6b75e664f20ad369f5760
WComposer.cpp
irtualDisplaySurface.cpp
3be1c6b60a188dc10025e2ce156c11fac050625d 18-Nov-2014 Dan Stoza <stoza@google.com> libgui: Enable -Weverything and -Werror

Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

Cherry pick of I034abec27bf4020d84af60d7acc1939c59986dd6 plus a
couple of minor changes to CpuConsumer.cpp to make it work with a
prior change:
Uncomment CC_LOGV on line 46
Change C-style cast to static_cast on line 71

Change-Id: Iaec610477ea0122317b0578fb74caf2383d4cf08
irtualDisplaySurface.cpp
irtualDisplaySurface.h
753011461964c5a610c12d4dfc9ab85ab20b6977 05-Dec-2014 Dan Albert <danalbert@google.com> am 5588d900: Merge "Enable clang for libui/libgui/surfaceflinger"

* commit '5588d9000cd1ef217185c9001d6b5ecd84db9741':
Enable clang for libui/libgui/surfaceflinger
01049c8321aab30cd431e2febeddd79242ae5a4f 11-Nov-2014 Dan Stoza <stoza@google.com> Enable clang for libui/libgui/surfaceflinger

Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
(cherry picked from commit f10c46ef855b6410b20ebd8b1351d4d78d8eca8e)
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
4037c458a7594cb3cd81a14e7e974abc28180187 13-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 07dffa18 to lmp-mr1-dev-plus-aosp

Change-Id: I42d8bc291f4f48f3098754b076889159c4b20e41
89fd4f7fa6bd17ce5400979c3b9e5ba0bf7e919e 13-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/native: Wall Werror in surfaceflinger

Turn on -Wall -Werror in services/surfaceflinger. Fix warnings.

Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
ramebufferSurface.cpp
irtualDisplaySurface.h
8dc55396fc9bc425b5e2c82e76a38080f2a655ff 04-Nov-2014 Dan Stoza <stoza@google.com> Add a BufferItem parameter to onFrameAvailable

Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents. Also
adds an onFrameReplaced callback, which is necessary if the consumer
wants to do anything more than simple queue length tracking.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
ramebufferSurface.cpp
ramebufferSurface.h
7cd85979e81cd632c37852f7ca716089dc52e899 08-Aug-2014 Jesse Hall <jessehall@google.com> surfaceflinger: fix -Wunused-parameter warning

warning: unused parameter 'mustRecompose' [-Wunused-parameter]

Change-Id: I6b8c671189639d851bfa5548742de988d6fa2687
(cherry picked from d2e514f71709e6af3dbc754e59686129737f2300)
ramebufferSurface.cpp
1495ceb88594bf3c5963ef65ee12953dc0354546 08-Aug-2014 Jesse Hall <jessehall@google.com> surfaceflinger: fix -Wmismatched-tags warnings

warning: struct 'HWComposer' was previously declared as a class
[-Wmismatched-tags]

warning: class 'DisplayInfo' was previously declared as a struct
[-Wmismatched-tags]

Change-Id: I13db9f8aab3a957ce8ff8d64598dae1807d6fe7e
(cherry picked from commit 646f54105018e99ef4a30ee41f01f7d1ab66c38e)
WComposer.h
2a8ae4ef70f2a3e0239a4df9bf33b4ff141594fe 29-Sep-2014 Jesse Hall <jessehall@google.com> am bacc28ef: surfaceflinger: Use landscape resolution for default dpi

* commit 'bacc28ef1df329f4dc21bae44b09a6c5018af908':
surfaceflinger: Use landscape resolution for default dpi
bacc28ef1df329f4dc21bae44b09a6c5018af908 28-Sep-2014 Jesse Hall <jessehall@google.com> surfaceflinger: Use landscape resolution for default dpi

When HWC doesn't provide DPI values for a display, we pick a default
DPI based on resolution. The intent was that 1080p and higher displays
would get XHIGH density, and lower resolutions would get TV density.
In KK (and possibly forever) we had a bug that we'd always use TV
density. That was fixed in L, but that fix exposed a pre-existing bug
that we always used the display's height in its native orientation,
rather than in landscape orientation. So an 800x1280 tablet like N7v1
started getting XHIGH density instead of the intended TV density.

Bug: 17461633
Change-Id: Ia57fa49e61f36bdda63ce283ef62c9953297222c
WComposer.cpp
5746f1497814e105352214f1bba242317856605a 10-Sep-2014 Dan Albert <danalbert@google.com> am fb017a4c: Merge "Fix clang warnings about struct vs. class."

* commit 'fb017a4c3b23741f737093c3fcb78087bbe5e73c':
Fix clang warnings about struct vs. class.
aeb8ab8c34343bd64a4b2247615ea3da97fa02f6 10-Sep-2014 Dan Albert <danalbert@google.com> Fix clang warnings about struct vs. class.

Change-Id: I9f26cd01ac3153efa6d77a4133686842e2d63203
WComposer.h
4d407a0f05ad9ba3c232ff5b6742495660c0e4ab 25-Aug-2014 Jesse Hall <jessehall@google.com> surfaceflinger: Trace HW vsync enable

This makes it possible to tell whether two HW vsync signals are too
far apart because one was late, or because we turned HW vsync off
briefly between them.

Bug: 17259382
Change-Id: If4fba2a8a6013568349949ce87c5c36f0468d2a2
WComposer.cpp
eb21986df0429d63f5e9678741730f07f17dcbad 22-Aug-2014 Michael Lentine <mlentine@google.com> Merge "Update currentConfig variable when active display is changed." into lmp-dev
d3e6914ceaafebaee09b0095aad6d001b75e787a 21-Aug-2014 Michael Lentine <mlentine@google.com> Update currentConfig variable when active display is changed.

Bug: 17182607
Change-Id: I8631c105a9e0fa402a7d9670717becc9857af935
WComposer.cpp
949ea0868de1df7e2f28a32d777cc41f901d6770 20-Aug-2014 Naseer Ahmed <naseer@codeaurora.org> sf: Clear display configs when hot pluggable display is disconnected

Display configs for external displays are stored in the framework
everytime we receive a hot plug to connect. However, since the
configs are not cleared on disconnect, framework will just assume
that the configs are valid. This does not work for use cases when
you connect/disconnect external displays with different resolutions.

e.g. 1080p to 4K and vice-versa

With this change we clear the display configs and repopulate when
we receive a hot plug to connect.

Change-Id: I2eeab186a8d8668a53390a2413b2ce5e044a1845
Acked-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
WComposer.cpp
b54ee7704e46529e02386cf39eba93a34a527c61 07-Aug-2014 Michael Lentine <mlentine@google.com> Change output format to not throw warning on volantis.

Change-Id: Id66eb61bdb1ceccfb7aefa0aa70793dac807c257
WComposer.cpp
258ee43fbcbc752cb08c134a12c08d5d99c4a866 31-Jul-2014 Michael Lentine <mlentine@google.com> Build fix for printf with int64 and size_t

Change-Id: I642584cce7dd43e6d491a49228b0bce047d53354
WComposer.cpp
fd9d183cd8c859ab8480dea572430398438ba8b5 31-Jul-2014 Michael Lentine <mlentine@google.com> Build fix to use the correct source.

Change-Id: If36710be600dd0e15c31682e0343f281baa55627
irtualDisplaySurface.cpp
47e45405d1533aa73307014f7bf371e118695cf3 19-Jul-2014 Michael Lentine <mlentine@google.com> Allow for resizing of Virtual Displays.

Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual
display is used. Add functionality in VirtualDisplaySurface to resize the
buffers aquired in the QueueBufferOutput. Add transaction support in
SurfaceFlinger for resize. Add the modification of the size in DisplayDevice.

Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b
Tested: None
isplaySurface.h
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
6c9e34a98a63033b80bd1c24c7aa1304f912f10a 14-Jul-2014 Michael Lentine <mlentine@google.com> Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.

This can be used to change the current display mode of the device.

Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb
Tested: None
(cherry picked from commit 2651fa94635a96d653038fb389a0dd827338f8d3)
WComposer.cpp
WComposer.h
03414a1cfe6c1222fd7723949bd622f9cba145aa 01-Jul-2014 Riley Andrews <riandrews@google.com> Turn on support for async cursor update in surfaceflinger.

If available, surfaceflinger will use the hwc setCursorPositionAsync()
api to change the position of supported cursor layers outside of
the usual prepare/set loop.

Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
WComposer.cpp
WComposer.h
24cd98eef88ac93f80c327f8d74f0a1ae0aceee4 13-Jul-2014 Jesse Hall <jessehall@google.com> Compile libsurfaceflinger with Clang and -std=c++11 [DO NOT MERGE]

This is necessary to use C11/C++11 stdlib atomics, which the next
change will do. This change also fixes a couple bits of syntax that
both GCC and Clang refuse to compile in -std=c++11 mode.

Change-Id: Ia14d9d6b537a3bb106c23e19a277e48be180754c
irtualDisplaySurface.cpp
dc56bf721a9f29621fd57e1d861142fa9b2d3663 30-Jun-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Add allocateBuffers method"
29a3e90879fd96404c971e7187cd0e05927bbce0 20-Jun-2014 Dan Stoza <stoza@google.com> BufferQueue: Add allocateBuffers method

This adds an allocateBuffers method to BufferQueue, which instructs
it to allocate up to the maximum number of buffers allowed by the
current configuration. The goal is that this method can be called
ahead of render time, which will prevent dequeueBuffers from blocking
in allocation and inducing jank.

This interface is also plumbed up to the native Surface (and, in
another change, up to the Java Surface and ThreadedRenderer).

Bug: 11792166
Change-Id: I4aa96b4351ea1c95ed5db228ca3ef98303229c74
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ef472ec40a0fbb0ef96b79bef846f20b73da4971 02-Apr-2014 Ruchi Kandoi <kandoiruchi@google.com> SurfaceFlinger: send VSYNC power hints to IPowerManager

VSYNC power hints are now sent via binder to IPowerManager.
SurfaceFlinger no longer loads a second copy of the PowerHAL.
VSYNC power hints are sent in batches and not on per frame basis.

Change-Id: Ia5a839ab3c857cffae7089f810b4315d4ed23fcf
owerHAL.cpp
owerHAL.h
2c9b11f0291210c9b9513a1a0cce6afebd361b3b 25-May-2014 Prashant Malani <pmalani@google.com> surfaceflinger: Replace blank/unblank with setPowerMode

We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.

Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.

Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL

HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.

If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.

As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.

We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.

Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>
WComposer.cpp
WComposer.h
f0058ca0e592485ac9e5a4aedb0dd8fa187625ef 20-May-2014 Andy McFadden <fadden@android.com> Add IMPLEMENTATION_DEFINED to dump

The "dumpsys SurfaceFlinger" output shows pixel formats in
human-readable form now. Add IMPLEMENTATION_DEFINED.

Change-Id: If567e34dad4b940fbfb4d0b70c65f6ab8cd5f5e7
WComposer.cpp
dd02391756dff240c178f7cba21d73d62821007e 06-May-2014 Dan Stoza <stoza@google.com> Merge "Enable changing display configuration"
7f7da32569f8e0b3d383a40b95f8ac1d55afd801 03-May-2014 Dan Stoza <stoza@google.com> Enable changing display configuration

This allows querying and switching display device configurations
through the ISurfaceComposer/SurfaceComposerClient interface.

Bug: 14320401
Change-Id: I8c22165698950e5da32204c1c4da92122f91a715
WComposer.cpp
WComposer.h
98e1ebc026726ba045cea69b1b8c371d95db9893 02-May-2014 Andy McFadden <fadden@android.com> Merge "Improve SurfaceFlinger PTS estimation"
41d67d7ab4da1c393497a620a116a854b3c618e7 26-Apr-2014 Andy McFadden <fadden@android.com> Improve SurfaceFlinger PTS estimation

Get the next refresh time from DispSync instead of guessing based
on the current time.

Change-Id: I8dc72a3217bfd4e9b4c905034194d1a298cad69a
WComposer.cpp
WComposer.h
0b63cd105cae094c21aafaa2bac8322427e75827 30-Apr-2014 Jesse Hall <jessehall@google.com> Handle failed requestBuffer after successful dequeueBuffer

If the virtual display consumer disconnects after the
VirtualDisplaySurface dequeues a buffer but before it requests it, the
request will fail. Previously the error was ignored, and the caller
would get a success result but a NULL buffer. Now the dequeued buffer
is cancelled and the error propagated to the caller.

Bug: 14140551
Change-Id: I91547885c2cf6063dc7a8f02d97f2df282cdde2c
irtualDisplaySurface.cpp
466954565be8cac018e86e3bddad4e1f4850fa70 25-Apr-2014 Andy McFadden <fadden@android.com> Merge "Update HWC dump format"
4df87bd1f6f68126e5e9081fc1365ae500e375db 22-Apr-2014 Andy McFadden <fadden@android.com> Update HWC dump format

Shortens a few fields. Displays the format as a string.

Change-Id: Ib471f05603763e250bad165db610f8e173e8423a
WComposer.cpp
fb39827ebce4637dcba03770f6644cf67e932e06 21-Apr-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Increase max slots from 32 to 64"
febd4f4f462444bfcb3f0618d07ac77e3fc1f6ad 10-Apr-2014 Dan Stoza <stoza@google.com> BufferQueue: Increase max slots from 32 to 64

Increases NUM_BUFFER_SLOTS from 32 to 64 and changes the mask
returned by IGBC::getReleasedBuffers from 32 to 64 bits.

Bug: 13174352
Change-Id: Ie8ef0853916cfb91f83881c7241886bb1950f01a
irtualDisplaySurface.cpp
irtualDisplaySurface.h
d9822a3843017444364899afc3c23fb5be6b9cb9 28-Mar-2014 Dan Stoza <stoza@google.com> BufferQueueProducer: add detachNextBuffer

Adds a new method, IGBP::detachNextBuffer, that effectively does
dequeue + request + detach in a single call, but does not need to
know anything about the dequeued buffer, and will not block on
dequeue. This is mostly for the upcoming StreamSplitter to use in
its onBufferReleased callback.

Change-Id: Ie88a69de109003acebaa486a5b44c8a455726550
irtualDisplaySurface.cpp
irtualDisplaySurface.h
4098f03d5c9fb8522279ca04da70bec6793b2caa 05-Apr-2014 Ruchi Kandoi <kandoiruchi@google.com> Revert "SurfaceFlinger: send VSYNC power hints to IPowerManager"

This reverts commit d469a1c3285b974cf2637517cc25727da8f82668.
owerHAL.cpp
owerHAL.h
d469a1c3285b974cf2637517cc25727da8f82668 02-Apr-2014 Ruchi Kandoi <kandoiruchi@google.com> SurfaceFlinger: send VSYNC power hints to IPowerManager

VSYNC power hints are now sent via binder to IPowerManager.
SurfaceFlinger no longer loads a second copy of the PowerHAL.
VSYNC power hints are sent in batches and not on per frame basis.

Change-Id: Icc2eee5df56135bd24dc244a84e7c12dd5511fec
owerHAL.cpp
owerHAL.h
f0eaf25e9247edf4d124bedaeb863f7abdf35a3e 21-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Add producer buffer-released callback

Add a callback to the producer side, onBufferReleased, which will be
called every time the consumer releases a buffer back to the
BufferQueue. This will enable a buffer stream splitter to work
autonomously without having to block on dequeueBuffer.

The binder object used for the callback replaces the generic IBinder
token that was passed into IGraphicBufferProducer::connect to detect
the death of the producer. If a producer does not wish to listen for
buffer release events, it can pass in an instance of the
DummyProducerListener class defined in IProducerListener.h, if it even
cares about death events (BufferQueue doesn't enforce the token being
non-NULL, though perhaps we should).

Change-Id: I23935760673524abeafea2b58dccc3583b368710
irtualDisplaySurface.cpp
irtualDisplaySurface.h
b9b088375d33a87b201cdbe18be71802e2607717 13-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
irtualDisplaySurface.cpp
irtualDisplaySurface.h
993146092f8205d9747f082ccd63c09b536caa4e 14-Mar-2014 Mark Salyzyn <salyzyn@google.com> am d4dabf87: am cdbf28b3: Merge "native frameworks: 64-bit compile issues"

* commit 'd4dabf872ac0a12e12aebae9032f7d62762c2aeb':
native frameworks: 64-bit compile issues
73ed82f809a40560fd3a6d53d18e5c846362d764 13-Mar-2014 Jesse Hall <jessehall@google.com> Merge "Add sideband streams to BufferQueue and related classes"
92dc3fc52cf097bd105460cf377779bdcf146d62 12-Mar-2014 Mark Salyzyn <salyzyn@google.com> native frameworks: 64-bit compile issues

- Fix format (print/scanf)
- Suppress unused argument warning messages (bonus)

Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728
ramebufferSurface.cpp
WComposer.cpp
88a459a9b37f3b4eb3c9a044ad7af30616ad66c9 12-Mar-2014 Dan Stoza <stoza@google.com> VirtualDisplaySurface: no attach/detach support

Change-Id: I630dd6e352940318c33a4e072d2f33a6ec58c556
irtualDisplaySurface.cpp
399184a4cd728ea1421fb0bc1722274a29e38f4a 04-Mar-2014 Jesse Hall <jessehall@google.com> Add sideband streams to BufferQueue and related classes

Sideband streams are essentially a device-specific buffer queue that
bypasses the BufferQueue system. They can be used for situations with
hard real-time requirements like high-quality TV and video playback
with A/V sync. A handle to the stream is provided by the source HAL,
and attached to a BufferQueue. The sink HAL can read buffers via the
stream handle rather than acquiring individual buffers from the
BufferQueue.

Change-Id: Ib3f262eddfc520f4bbe3d9b91753ed7dd09d3a9b
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
9f3053de78630815d60cf48a2cf2348cc5867c45 07-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Allow detaching/reattaching buffers

Adds detachBuffer and attachBuffer calls to both the producer and
consumer sides of BufferQueue. Buffers may be detached while dequeued
by the producer or acquired by the consumer, and when attached, enter
the dequeued and acquired states, respectively.

Bug: 13173343
Change-Id: Ic152692b0a94d99e0135b9bfa62747dab2a54220
irtualDisplaySurface.cpp
irtualDisplaySurface.h
7143316af216fa92c31a60d4407b707637382da1 05-Feb-2014 Dan Stoza <stoza@google.com> Fix virtual display nesting

This fixes the cycling rendering loop caused by nesting virtual
displays by preventing them from recomposing if their contents
haven't changed.

Bug: 12101046
Change-Id: I600365c0fd5d3ad93e04295d26cf9de177ffc79b
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ef11a6c887891be04c4ca9cc60bcad8d022189b3 28-Jan-2014 Jesse Hall <jessehall@google.com> am ade9a911: am f65ebc3b: am f5bcb391: Merge "SurfaceFlinger: mFbProducerSlot initailization"

* commit 'ade9a911d04dbd4bfbd3e80a917ea67a581b4797':
SurfaceFlinger: mFbProducerSlot initailization
fdfde88d0bcd0b293c9deb37f49254bdd97e4dac 23-Jan-2014 mayank parshar <mayankp@broadcom.com> SurfaceFlinger: mFbProducerSlot initailization

b/12487813

SurfaceFlinger crash is observed during simulation of
Secondary display

Note: change 14e8b01a761180250671f3d6494532d8bd04fa8e
removed the initialization leading to the crash when
simulating secondary display. Restore the initialization
to solve the problem.

Change-Id: Iae5845fb82735e01de5cc0dc582d13c27e3c614f
Signed-off-by: mayank parshar <mayankp@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
irtualDisplaySurface.cpp
467113c6fcb1f4714d84d6d097c5525ae0130d00 26-Jan-2014 Jesse Hall <jessehall@google.com> am 25f75c36: am 8c303f7e: am fcf9c1ba: Merge "SurfaceFlinger: mFbFence initialization"

* commit '25f75c361098086ffa2b87dcc3f22ac5f64c05be':
SurfaceFlinger: mFbFence initialization
b988f85fc44efd24f11f2e5ab8fb9b653916f666 10-Jan-2014 mayank parshar <mayankp@broadcom.com> SurfaceFlinger: mFbFence initialization

MobC00383030
b/12487813

SurfaceFlinger crash is observed while connecting
to Wi-Fi display.

Note: change 14e8b01a761180250671f3d6494532d8bd04fa8e
removed the initialization leading to the crash when
running through the HWC composition path. Restore the
initialization to solve the problem.

Change-Id: I581defc7135ac512080c0da06a62b1dae7d218c4
Signed-off-by: mayank parshar <mayankp@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
irtualDisplaySurface.cpp
524672571f1df138eb913e672aaa74e0257aa8c0 03-Jan-2014 Jesse Hall <jessehall@google.com> am 03691218: am e5f7bf74: am b6c21004: Merge "Implement per-display EGLConfig and configless EGLContext"

* commit '03691218ada2fb7e084ad4ae7ddd54f9b28d5611':
Implement per-display EGLConfig and configless EGLContext
19e872912af66c53a4350afcc333bbafaf6a2294 24-Dec-2013 Jesse Hall <jessehall@google.com> Implement per-display EGLConfig and configless EGLContext

Bug: 12230666
Change-Id: Icca608b108cbdcab9cf01a9236d8cdbda000a836
Signed-off-by: Jesse Hall <jessehall@google.com>
WComposer.cpp
324c69b542cf051e86cead592ff6a103ce1dbb34 08-Nov-2013 Jesse Hall <jessehall@google.com> am 1ee45c2d: am 14e8b01a: Don\'t change the framebuffer target until we render a new one

* commit '1ee45c2d2d816ee912624d81ff1b0aaa98e8fa74':
Don't change the framebuffer target until we render a new one
14e8b01a761180250671f3d6494532d8bd04fa8e 07-Nov-2013 Jesse Hall <jessehall@google.com> Don't change the framebuffer target until we render a new one

Continuing to send the last-rendered framebuffer to HWC on subsequent
frames allows the HWC to read partially-composed regions that haven't
changed, instead of re-composing from scratch.

Bug: 11573910
Change-Id: I8829877d2a06001f1e1b3f168cbba71c7b217b2d
irtualDisplaySurface.cpp
ad78055746c9b1b3f0563133971800812bfed1f6 07-Nov-2013 Jesse Hall <jessehall@google.com> am 2d32aa59: am 356c2386: Merge "Provide virtual display output buffer to HWC in prepare" into klp-dev

* commit '2d32aa5918de1c12c54a32e8eb28bbc96d430796':
Provide virtual display output buffer to HWC in prepare
356c23865d588659f1eea55bbe7e2b16b9cff08e 07-Nov-2013 Jesse Hall <jessehall@google.com> Merge "Provide virtual display output buffer to HWC in prepare" into klp-dev
45c9c0477de6d376019d458fbe17c07cf64f72ca 06-Nov-2013 Jesse Hall <jessehall@google.com> am f111ee13: am 49318631: Merge "Don\'t use implementation-defined format with CPU consumers" into klp-dev

* commit 'f111ee13a6f5d8606c5dc7a5cc07cedf929e69a8':
Don't use implementation-defined format with CPU consumers
f7a675837bdad03d398c9b6f0f593b9c51c679b5 06-Nov-2013 Jesse Hall <jessehall@google.com> Provide virtual display output buffer to HWC in prepare

We were already making sure the HWComposer class had the handle before
prepare, but it wasn't passing the handle along to HWC as intended.

Partial fix for bug: 11430248
Change-Id: I25f672c4fdfaa6a81fe0acb24d9ad05153ee17dc
WComposer.cpp
497ba0e08503806571b52ebe27cc7eee4c0e71a7 05-Nov-2013 Jesse Hall <jessehall@google.com> Don't use implementation-defined format with CPU consumers

If the virtual display surface is being consumed by the CPU, it can't
be allowed with HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED since there is
no way for the CPU consumer to find out what format gralloc chose. So
for CPU-consumer surfaces, just use the BufferQueue's default format,
which can be set by the consumer.

A better but more invasive change would be to let the consumer require
a certain format (or set of formats?), and disallow the producer from
requesting a different format.

Bug: 11479817
Change-Id: I5b20ee6ac1146550e8799b806e14661d279670c0
irtualDisplaySurface.cpp
irtualDisplaySurface.h
45cb6ec7158939964f96a2a7ff6dc7591ebf9bb5 25-Oct-2013 Jesse Hall <jessehall@google.com> am 96002be4: am c354effe: Fix handling of undefined TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS

* commit '96002be4bd4b8bbfecba2cc45bdf0b47f06464bc':
Fix handling of undefined TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS
c354effe97be26638618e3bc0da81a3f8b384b20 25-Oct-2013 Jesse Hall <jessehall@google.com> 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
irtualDisplaySurface.cpp
6fdaaf5c7cf7c511a5e3cea8aaafdad7ff12e596 24-Oct-2013 Jesse Hall <jessehall@google.com> am a54a8b63: am 93fcb823: Merge "Add a boardconfig to force HWC composition of virtual displays" into klp-dev

* commit 'a54a8b63d191d2c1c4669f89b32c4b8a9c04cd31':
Add a boardconfig to force HWC composition of virtual displays
014dd9f0f28c3992f9fae62a62fa7e8bfe750a06 24-Oct-2013 Jesse Hall <jessehall@google.com> am 48775386: am c5807f90: Merge "Use implementation-defined format when HWC writes to output buffer" into klp-dev

* commit '487753868aa86902f723dbdedd7083783701188d':
Use implementation-defined format when HWC writes to output buffer
6a968462f9ce4d93d81fcc13672073e3e6eb2e0f 04-Oct-2013 Naseer Ahmed <naseer@codeaurora.org> 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
irtualDisplaySurface.cpp
1e27ba234c5bfd4f6535ee221a6c20407a50f868 27-Sep-2013 Jesse Hall <jessehall@google.com> 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
irtualDisplaySurface.cpp
irtualDisplaySurface.h
adbb3062e1a3d675531367c055572664fc46280d 15-Oct-2013 Jesse Hall <jessehall@google.com> am a04fd39c: am 8e26b28b: Filter out vsync events from HWC with duplicate timestamps

* commit 'a04fd39cb88bb6df5f639464f70795f58cd0aefa':
Filter out vsync events from HWC with duplicate timestamps
8e26b28be62e7c0e093900540db5e5cdcf52a0ff 14-Oct-2013 Jesse Hall <jessehall@google.com> Filter out vsync events from HWC with duplicate timestamps

Bug: 11220224
Change-Id: I4efe0b66ea8969bf0ec3c4fcb325d354c8a0c315
WComposer.cpp
b85d2cf0a20e46261db8fee4839840f0ef715c68 09-Oct-2013 Jamie Gennis <jgennis@google.com> resolved conflicts for merge of 790b6d09 to master
faf77cce9d9ec0238d6999b3bd0d40c71ff403c5 31-Jul-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: SW-based vsync events

This change adds the DispSync class, which models the hardware vsync event
times to allow vsync event callbacks to be done at an arbitrary phase offset
from the hardware vsync. This can be used to reduce the minimum latency from
Choreographer wake-up to on-screen image presentation.

Bug: 10624956
Change-Id: I8c7a54ceacaa4d709726ed97b0dcae4093a7bdcf
WComposer.cpp
fee52e20b9fc9a02dbeeb75458972c14682c5400 02-Oct-2013 Jesse Hall <jessehall@google.com> am f3fa0712: am 93573e91: Merge "Treat composition frames with no layers as using GLES composition" into klp-dev

* commit 'f3fa0712282e760c316f44cba05f884f9399b98f':
Treat composition frames with no layers as using GLES composition
10a9ca1c6934092132bb7d5f0073dec68c017294 02-Oct-2013 Jesse Hall <jessehall@google.com> am 72d270c5: am b716e570: Set the outbuf acquire fence after we actually have it.

* commit '72d270c5f0918d1dc7a6a1774b80469c9f28b7ea':
Set the outbuf acquire fence after we actually have it.
93573e91c22ba8329222c69cd7f099f5703fb444 02-Oct-2013 Jesse Hall <jessehall@google.com> Merge "Treat composition frames with no layers as using GLES composition" into klp-dev
b716e57048e945d5bceda33c2434c65d06464dba 02-Oct-2013 Jesse Hall <jessehall@google.com> Set the outbuf acquire fence after we actually have it.

In GLES-only mode, we don't have the outbuf acquire fence until after
GLES composition is done for the frame. We were setting the fence in
HWC's state immediately after dequeueing the buffer from the consumer,
before GLES had started. This fence got passed through HWC and on to
the consumer, so the consumer was reading the buffer before GLES was
done writing to it.

Now we update HWC's state just before set(), when we know we have the
right fence.

Bug: 11000763
Change-Id: Iea9db4c69634c352dc2d600f0bdb6bef2a432636
irtualDisplaySurface.cpp
d05a17fbb3772051d287f1f8830a7f00964f7ec2 01-Oct-2013 Jesse Hall <jessehall@google.com> Treat composition frames with no layers as using GLES composition

When there are no window layers for a display, SurfaceFlinger clears
the undefined region using GLES. Some of the places that check for
GLES composition weren't considering this special case, in particular:

- We were skipping the eglSwapBuffers() on these frames.
- We were putting VirtualDisplaySurface in HWC-only composition mode.

This change centralizes the logic for this special case.

Bug: 10957068
Change-Id: I2deaf2ed101e8ea76708862a6bb67751b6078794
WComposer.cpp
ff98f3e598cc5ccf8daaf18ba93600b5b1a61a26 26-Sep-2013 Mathias Agopian <mathias@google.com> am 338acd68: am 86206b41: Merge "fix initialization of framebuffer target crop rect on hwc 1.3" into klp-dev

* commit '338acd6869532f2684cbd1e4f273eaffc6d4ef6d':
fix initialization of framebuffer target crop rect on hwc 1.3
2b3d0c407987f6f47ccc2e9ebd6c61dbd0c37306 26-Sep-2013 Mathias Agopian <mathias@google.com> am 0ff4b283: am 6da15f46: fix crashers with wifi/virtual displays

* commit '0ff4b28396d77a0ed2f191836895a891108a8b5b':
fix crashers with wifi/virtual displays
86206b41b2ff000e086301c6bafb8da577e563b2 26-Sep-2013 Mathias Agopian <mathias@google.com> Merge "fix initialization of framebuffer target crop rect on hwc 1.3" into klp-dev
8f63c2049b93819c41d390fc4222b9307e3a61c7 26-Sep-2013 Mathias Agopian <mathias@google.com> fix initialization of framebuffer target crop rect on hwc 1.3

Bug: 10936771
Change-Id: If283e5e231ca34b93e0b1784bb4e8e4c7bfd75de
WComposer.cpp
6da15f46f5f8b38e31384d641f8d3db2c3c6ea30 26-Sep-2013 Mathias Agopian <mathias@google.com> fix crashers with wifi/virtual displays

Bug: 10647742
Change-Id: I4b8ed9da52ef95af3a3b3a04b98514a3776a674d
irtualDisplaySurface.cpp
6de9653ac876a4cae03d32c1134c56c795b1b11c 20-Sep-2013 Christopher Ferris <cferris@google.com> Merge "Remove unnecessary include."
d142f4b787abae7a5c392ded0dd2741574a0bce2 20-Sep-2013 Christopher Ferris <cferris@google.com> Remove unnecessary include.

All these files are including utils/CallStack.h, but none of the code
uses any CallStack objects.

Change-Id: I38c3a346a3bd0ddbff368d0f7f8b3f3d78fc0432
WComposer.cpp
365857df8b94c959dea984a63013f6e7730ef976 12-Sep-2013 Mathias Agopian <mathias@google.com> Make sure do disconnect from a BQ when its client dies.

Bug: 5679534

Change-Id: If447e8673df83fe0b1d6210641e0a48522501a53
irtualDisplaySurface.cpp
irtualDisplaySurface.h
8db92553e9e6263cd41eaf1a1ebc9e3f88f92b5f 30-Aug-2013 Jesse Hall <jessehall@google.com> Force async behavior for the virtual display output BufferQueue

Bug: 10551087
Change-Id: I40bbb2b87d64420939a0ea309254f281437dab56
irtualDisplaySurface.cpp
irtualDisplaySurface.h
bef42c50ebda2d63400f92611e1dd857c03bb38c 22-Aug-2013 Mathias Agopian <mathias@google.com> handle several vsync signal correctly

Change-Id: I34935d2197ce8e914fef2f110896e47b44225ad2
WComposer.cpp
WComposer.h
028dc8f2d72bc7cd4fbe7808781443125a742f78 21-Aug-2013 Jesse Hall <jessehall@google.com> Provide HWC prepare with a valid output buffer

We weren't dequeing and setting the output buffer until just before
set(). This didn't allow HWC to make decisions in prepare() based on
the output buffer format, dimensions, etc.

Now we dequeue the output buffer at the beginning of the composition
loop and provide it to HWC in prepare. In GLES-only rendering, we may
have to cancel the buffer and acquire a new one if GLES requests a
buffer with properties different than the one we already dequeued.

Bug: 10365313
Change-Id: I96b4b0a851920e4334ef05080d58097d46467ab8
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
353ddc6e77816352107537c215dc8302f6e8587a 21-Aug-2013 Jesse Hall <jessehall@google.com> Fix HWComposer dumping of float source crops

Change-Id: I45a9344b5fab17ccb54bebd01382d738a03860e6
WComposer.cpp
90f59bf9eba79b27629505bc2709d84e7c811c8b 19-Aug-2013 Andy McFadden <fadden@android.com> Merge "Re-enable frame dropping for non-auto timestamps" into klp-dev
3c25621ad7d13f64d3ab95a27fa970fbc9998f73 16-Aug-2013 Andy McFadden <fadden@android.com> Re-enable frame dropping for non-auto timestamps

This change adds an entire field to note whether the timestamp was
auto-generated by Surface or supplied by the application.

The value is used when deciding whether or not to drop frames based
on buffer presentation timestamps. If a desired presentation time
was set explicitly, BufferQueue will use that value to decide if a
frame should be dropped. If the timestamp was generated by Surface
at the time the buffer was queued, the timestamp is ignored.

Bug 10151804

Change-Id: Ibd571a7578351063b813cbdad2ddbeed70655ba5
irtualDisplaySurface.cpp
9e663de4fe1dcc872373ee530c60a375624671c3 16-Aug-2013 Jesse Hall <jessehall@google.com> Use new HWC display type/count constants.

Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
WComposer.cpp
WComposer.h
db89edc94bd2a78226b407f9f7261e202e7fa325 02-Aug-2013 Mathias Agopian <mathias@google.com> All consumers now take an IGraphicBufferConsumer instead of a BufferQueue

this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ad678e18b66f495efa78dc3b9ab99b579945c9e2 24-Jul-2013 Mathias Agopian <mathias@google.com> single buffer mode for BufferQueue

Bug: 9891035
Change-Id: Id1ab5f911a6dc4c1d8235e65775b3d3635231ad4
ramebufferSurface.cpp
7cdd786fa80cf03551291ae8feca7b77583be1c5 19-Jul-2013 Mathias Agopian <mathias@google.com> Make ANW.setSwapInterval(0) work again

we can now queue/dequeue a buffer in asynchrnous mode by using the
async parameter to these calls. async mode is only specified
with those calls (it is not modal anymore).

as a consequence it can only be specified when the buffer count
is not overidden, as error is returned otherwise.

Change-Id: Ic63f4f96f671cb9d65c4cecbcc192615e09a8b6b
irtualDisplaySurface.cpp
irtualDisplaySurface.h
595264f1af12e25dce57d7c5b1d52ed86ac0d0c9 17-Jul-2013 Mathias Agopian <mathias@google.com> BufferQueue improvements and APIs changes

this is the first step of a series of improvements to
BufferQueue. A few things happen in this change:

- setSynchronousMode() goes away as well as the SynchronousModeAllowed flag
- BufferQueue now defaults to (what used to be) synchronous mode
- a new "controlled by app" flag is passed when creating consumers and producers
those flags are used to put the BufferQueue in a mode where it
will never block if both flags are set. This is achieved by:
- returning an error from dequeueBuffer() if it would block
- making sure a buffer is always available by replacing
the previous buffer with the new one in queueBuffer()
(note: this is similar to what asynchrnous mode used to be)

Note: in this change EGL's swap-interval 0 is broken; this will be
fixed in another change.

Change-Id: I691f9507d6e2e158287e3039f2a79a4d4434211d
ramebufferSurface.cpp
irtualDisplaySurface.cpp
irtualDisplaySurface.h
bce7611e8e4514026bf12f96baaf9168f6d5894e 16-Jul-2013 Jesse Hall <jessehall@google.com> Fix build -- update for function signature change

Change-Id: I9c2448d5853c69ec7e962847fdaba9a99906cc42
irtualDisplaySurface.cpp
3bc38408882487dc2a63ba036394addd839b0695 16-Jul-2013 Jesse Hall <jessehall@google.com> Merge "Rewrite VirtualDisplaySurface"
38efe86d9459cf5c96a24a34cc5cbf31fdba7e19 07-Apr-2013 Jesse Hall <jessehall@google.com> Rewrite VirtualDisplaySurface

The previous implementation assumed that the HWC could read and write
the same buffer on frames that involved both GLES and HWC composition.
It turns out some hardware can't do this. The new implementation
maintains a scratch buffer pool to use on these mixed frames, but on
GLES-only or HWC-only frames still does composition directly into the
output buffer.

Bug: 8384764
Change-Id: I7a3addb34fad9bfcbdabbb8b635083e10223df69
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
irtualDisplaySurface.cpp
irtualDisplaySurface.h
c33f9a76b5dff1a9b4e4d0c76459c0d5b36a0d74 11-Jul-2013 Andy McFadden <fadden@android.com> Merge "Pay attention to buffer timestamps"
1585c4d9fbbba3ba70ae625923b85cd02cb8a0fd 28-Jun-2013 Andy McFadden <fadden@android.com> Pay attention to buffer timestamps

When acquiring a buffer, SurfaceFlinger now computes the expected
presentation time and passes it to the BufferQueue acquireBuffer()
method. If it's not yet time to display the buffer, acquireBuffer()
returns PRESENT_LATER instead of a buffer.

The current implementation of the expected-present-time computation
uses approximations and guesswork.

Bug 7900302

Change-Id: If9345611c5983a11a811935aaf27d6388a5036f1
ramebufferSurface.cpp
6b44267a3beb457e220cad0666c039d3a765cdb2 10-Jul-2013 Mathias Agopian <mathias@google.com> fix SF buffer cropping

When a buffer had a crop (meaning its content is scaled to the window size)
and a window crop was defined, the resulting crop couldn't be expressed
properly because h/w composer's API was limited to integers, since
this is fixed in h/w composer 1.3, we take adventage of this to
make sure we get the correct crop.

this bug could result in the buffer being scaled by an incorrect ratio and
be slightly offset; moreover, it would produce different results from the
GL code path, which is always correct.

Change-Id: I8e20e00b6e26177d14f4ab4d2cd581e26c818892
loatRect.h
WComposer.cpp
WComposer.h
c5d7b7d323bba8772a9005f7d300ad983a04733a 03-May-2013 Lajos Molnar <lajos@google.com> BufferQueue: track buffer-queue by instance vs. by reference

Instead of representing the buffer-queue as a vector of buffer
indices, represent them as a vector of BufferItems (copies).
This allows modifying the buffer slots independent of the queued
buffers.

As part of this change, BufferSlot properties that are only
been relevant in the buffer-queue have been removed.

Also, invalid scalingMode in queueBuffer now returns an error.

ConsumerBase has also changed to allow reuse of the same
buffer slots by different buffers.

Change-Id: If2a698fa142b67c69ad41b8eaca6e127eb3ef75b
Signed-off-by: Lajos Molnar <lajos@google.com>
Related-to-bug: 7093648
ramebufferSurface.cpp
2381033ad001960c606d13e3a4198e5da3672ec7 17-May-2013 Mathias Agopian <mathias@google.com> am e6eef6c1: am ea74d3b7: make the warning timout of Fence::waitForever() implicit and longer

* commit 'e6eef6c136b007f3a7e1e19884875b855c0c5f95':
make the warning timout of Fence::waitForever() implicit and longer
ea74d3b78d607cde17790a7bb83e6f68ffd34cfd 17-May-2013 Mathias Agopian <mathias@google.com> make the warning timout of Fence::waitForever() implicit and longer

- timeout is now 3 seconds instead of 1
- simplifies the API a bit
- allows us to change/tweak this timeout globaly

Bug: 8988871

Change-Id: I8d3c6ec43a372f602fb3f29856710339f86c0ec9
WComposer.cpp
c0db61966a172c953b4259bd0501c9b6781f0f31 09-May-2013 Jesse Hall <jessehall@google.com> am dda42952: am 64f3b2fd: Merge "Remove experimental HWC virtual display support" into jb-mr2-dev

* commit 'dda4295221f831560ca9d554cd9b7be1c672d0b6':
Remove experimental HWC virtual display support
e737c11cd83a449d9a544c5c6d4e0dfd42250a56 07-May-2013 Jesse Hall <jessehall@google.com> Remove experimental HWC virtual display support

Bug: 8384764
Change-Id: I97b52ed83ad85466bd91cb9291308994048568a1
ufferQueueInterposer.cpp
ufferQueueInterposer.h
WComposer.cpp
irtualDisplaySurface.cpp
irtualDisplaySurface.h
74d211ae26a0257c6075a823812e40b55aa1e653 22-Apr-2013 Mathias Agopian <mathias@google.com> clean-up/simplify all dump() APIs

remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
1df59c93fea8bec21b8084c34aface086f1e0896 06-Apr-2013 Jesse Hall <jessehall@google.com> Merge "Tell HWComposer the dimensions of virtual displays" into jb-mr2-dev
d5e345b0cf5c1c5aaa5c10a1a4c759e74d77fb37 06-Apr-2013 Jesse Hall <jessehall@google.com> Merge "Actually set the virtual display output buffer." into jb-mr2-dev
1c569c4d45f89ec05abf8f8fe3a560e68bf39a8e 05-Apr-2013 Jesse Hall <jessehall@google.com> Tell HWComposer the dimensions of virtual displays

HWComposer queries the HWC for dimensions of physical displays, but
can't do that for virtual displays. The dimensions are used to set the
display frame of the framebuffer target layer passed to HWC, and
implicitly the dimensions of the virtual display.

Bug: 8316155
Change-Id: I9cbd2530d2fa878f86128a1472def520b5d694a5
WComposer.cpp
WComposer.h
6d5b8e600e77164d3b5e51b89bf9c940fd7b4ea2 05-Apr-2013 Jesse Hall <jessehall@google.com> Merge "Clean up HWC state when releasing a DisplayDevice" into jb-mr2-dev
2ba647e9f5249d9ed97739d29d879064e31ba34a 04-Apr-2013 Jesse Hall <jessehall@google.com> Actually set the virtual display output buffer.

Bug: 8316155
Change-Id: Ida1ac47e5a932fdaad3ec862e121cfe55d255699
irtualDisplaySurface.cpp
33ceeb32582739dd74e404593d9ddf8adf5100bb 02-Apr-2013 Mathias Agopian <mathias@google.com> Fix include paths

Change-Id: If5350a3de995cc0cb1afea067e7ce168bc00d3f5
ramebufferSurface.cpp
WComposer.cpp
02d86567d95b99e1142941ed7ec23a4465822813 25-Mar-2013 Jesse Hall <jessehall@google.com> Clean up HWC state when releasing a DisplayDevice

DisplayDevices can be released when DisplayManager removes them from
the display list, or (for virtual displays) when the surface is set to
NULL. We were only cleaning up HWC resources associated with the
display in the first case.

Bug: 8384764
Change-Id: Id3d226dd7178fbe6d0a2ac4e2660b864ee073de3
WComposer.cpp
ffe1f19ca9707f84cb9fdb06209bf36cd8c2ef0a 22-Mar-2013 Jesse Hall <jessehall@google.com> Fix virtual displays for HWC<=1.1

If we're using a HWC that doesn't support virtual displays, or we have
more virtual displays than HWC supports concurrently, the
VirtualDisplaySurface should simply be a passthrough from source
(GLES) to sink.

This change also tries to distinguish between display types and HWC
display IDs a little better, though there's more to do here. Probably
needs a higher-level rethink; it's too error-prone now.

Bug: 8446838
Change-Id: I708d2cf262ec30177042304f174ca5b8da701df1
irtualDisplaySurface.cpp
irtualDisplaySurface.h
851cfe834295224cd64bdd499872b95b19c4de8c 20-Mar-2013 Jesse Hall <jessehall@google.com> Isolate knowledge that fb target == output buffer

HWComposer didn't allow the virtual display output buffer to be set
directly, instead it always used the framebuffer target buffer.
DisplayDevice was only providing the framebuffer release fence to
DisplaySurfaces after a commit.

This change fixes both of these, so both HWComposer and DisplayDevice
should continue to work if VirtualDisplaySurface changes to use
separate framebuffer and output buffers. It's also more correct since
VirtualDisplaySurface uses the correct release fence when queueing the
buffer to the sink.

Bug: 8384764
Change-Id: I95c71e8d4f67705e23f122259ec8dd5dbce70dcf
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
afaf14b9fbfe8943d845e2f01e8a401ad7a4d854 20-Mar-2013 Jesse Hall <jessehall@google.com> Use descriptive aliases instead of HWC_NUM_DISPLAY_TYPES

Bug: 8384764
Change-Id: Ia2563fab19dbc6e4a95bed03445e609334841cca
WComposer.cpp
13f01cbdbd34779a234bc674df79e23672fd5c0b 20-Mar-2013 Jesse Hall <jessehall@google.com> Pass sp<Fence>s around instead of file descriptors

Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
8d8c75976171d194ca8f94727b22e3bf7676b9dd 22-Mar-2013 Jesse Hall <jessehall@google.com> Merge "Release virtual display buffer immediately after HWC set" into jb-mr2-dev
70a6e88dbd52605f35f290eba52a05bdc6fc8042 22-Mar-2013 Mathias Agopian <mathias@google.com> initialize planeAlpha (to 0xFF) for the FB_TARGET

Bug: 8422625
Change-Id: I7b72456c2e01ed92e675cc1bfa0cfd0d2ce5064e
WComposer.cpp
7414965606f82ac2bcace5d3e2c8a4810517bf1e 20-Mar-2013 Jesse Hall <jessehall@google.com> Release virtual display buffer immediately after HWC set

Previously we only queued a virtual display buffer to the sink when
the next frame was about to be displayed. This may delay the "last"
frame of an animation indefinitely. Now we queue the buffer as soon as
HWC set() returns and gives us the release fence.

Bug: 8384764
Change-Id: I3844a188e0f6ef6ff28f3e11477cfa063a924b1a
ufferQueueInterposer.cpp
ufferQueueInterposer.h
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
ef64b75a936ffd194673dbce6766995f86b42ba9 18-Mar-2013 Jesse Hall <jessehall@google.com> Don't log an error on HWC1.1+ devices with no FB HAL

Change-Id: I015e5a1a1f926181e51f82525f69beff71bd70cd
WComposer.cpp
WComposer.h
80e0a397a4712666661ecc629a64ec26e7f6aac3 15-Mar-2013 Jesse Hall <jessehall@google.com> Add BufferQueueInterposer and use it for virtual displays

BufferQueueInterposer allows a client to tap into a
IGraphicBufferProducer-based buffer queue, and modify buffers as they
pass from producer to consumer. VirtualDisplaySurface uses this to
layer HWC composition on top of GLES composition before passing the
buffer to the virtual display consumer.

Bug: 8384764
Change-Id: I61ae54f3d90de6a35f4f02bb5e64e7cc88e1cb83
ufferQueueInterposer.cpp
ufferQueueInterposer.h
WComposer.cpp
WComposer.h
irtualDisplaySurface.cpp
irtualDisplaySurface.h
99c7dbb24994df2f3e175f7b25dd2c9dd92a72f0 14-Mar-2013 Jesse Hall <jessehall@google.com> Add DisplaySurface abstraction

DisplayDevice now has a DisplaySurface instead of using
FramebufferSurface directly. FramebufferSurface implements
DisplaySurface, and so does the new VirtualDisplaySurface class.
DisplayDevice now always has a surface, not just for virtual displays.

In this change VirtualDisplaySurface is just a stub; buffers still go
directly from GLES to the final consumer.

Bug: 8384764
Change-Id: I57cb668edbc6c37bfebda90b9222d435bf589f37
isplaySurface.h
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
irtualDisplaySurface.cpp
irtualDisplaySurface.h
7adb0f8a9fdb961692ffd2f0c65cacb155143f64 07-Mar-2013 Jesse Hall <jessehall@google.com> Minor cleanups/fixes before virtual display refactoring

None of these should change behavior, except for removing some
incorrect log messages when using a virtual display.

- HWComposer::getAndResetReleaseFenceFd() checks the HWC version, so
no need to do that in the DisplayDevice::onSwapBuffersCompleted().
However, it should check that mFramebufferSurface is not NULL like
it is for virtual displays.
- Comment that FramebufferSurface::dump() overrides the non-virtual
ConsumerBase::dump(), and fix it so the right thing happens
regardless of the static type of the pointer/reference the callee
has. FramebufferSurface::dump() could be removed right now, but I'd
need to bring it back in a later change.
- Use the right enum for validating display type ids.
- Don't try to send hotplug events for virtual displays.
- Mark virtual displays as connected so HWComposer::prepare() doesn't
think something is wrong when it gets a non-NULL layer list.
- Remove unused FramebufferSurface methods.

Bug: 8384764
Change-Id: Id28a2f9be86b45f4bb7915fdf7752157035f4294
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
13127d8921356dff794250e04208c3ed60b3a3df 06-Mar-2013 Mathias Agopian <mathias@google.com> Get rid of LayerBase.

The functionality of LayerBase and Layer is folded
into Layer. There wasn't a need for this abstraction
anymore.

Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
WComposer.cpp
WComposer.h
a9a1b006e48320f5c501473e51e6c4a5f7a17b88 28-Feb-2013 Jesse Hall <jessehall@google.com> Initialize DisplayData fences to NO_FENCE, not NULL

Also fix another place that was checking for NULL fence rather than
Fence::isValid().

Bug 8283950

Change-Id: Ie06db327eb416828d8dac139171d96d4470b2e35
WComposer.cpp
WComposer.h
e3c697fb929c856b59fa56a8e05a2a7eba187c3d 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
ramebufferSurface.cpp
WComposer.cpp
1df8c345854155cbbcb9f80de9d12d66ea70ac08 20-Dec-2012 Jamie Gennis <jgennis@google.com> libgui: disallow NULL Fence pointers

This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required. Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.

Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
WComposer.cpp
5fe58b8ba6c5d78481730874236a1be48a90d61d 08-Feb-2013 Mathias Agopian <mathias@google.com> only disable hwc when alpha < 1.0

Bug: 8149181
Change-Id: Ib3c7a44f04871e020adceeae16d002141ac758d4
WComposer.cpp
9f8386e1118c10dd4927f62637ec7162569bdbdc 30-Jan-2013 Mathias Agopian <mathias@google.com> Add support for plane-alpha in HWC

Change-Id: I218e7dd5f23de535aabce61e993002ab6cb46cdd
WComposer.cpp
WComposer.h
51d22007386f171e1c696786ddce957e78fc4a03 14-Jan-2013 Jesse Hall <jessehall@google.com> Remove unused HWCLayer::setPerFrameDefaultState()

Bug: 7977590
Change-Id: Ic49c4e38ef2ee6beaeb268c406347c882135bdf0
WComposer.cpp
WComposer.h
800856a7b7f8d89c1a64955f152549b8f42cd3e0 14-Jan-2013 Jesse Hall <jessehall@google.com> am f3e9d5bd: am cbe51356: Merge "Remove support for legacy HWC version encoding"

* commit 'f3e9d5bde57a41593a7dbc15e6f1fdb1ea64ea74':
Remove support for legacy HWC version encoding
f3e9d5bde57a41593a7dbc15e6f1fdb1ea64ea74 14-Jan-2013 Jesse Hall <jessehall@google.com> am cbe51356: Merge "Remove support for legacy HWC version encoding"

* commit 'cbe5135610cd3c919e6334fada72cc52238bb8b0':
Remove support for legacy HWC version encoding
8f06a8c2c80491465e8742c1bf45315dab7017e3 11-Jan-2013 Andy McFadden <fadden@android.com> Reduce C++11 warnings

A few typecasts to fix "narrowing conversion" complaints.

Change-Id: Ib2118079a2ca33959c748d03d8c6f1722d62e8fe
WComposer.cpp
7296051995fbaea919480a6cc2dabb729dabc95b 11-Jan-2013 Jesse Hall <jessehall@google.com> Remove support for legacy HWC version encoding

Change-Id: If03ae1ebf10d15777310e1449a57473021390582
WComposer.cpp
dd9d192287bcd54b5aef68f201dacca26cfa850e 20-Nov-2012 Mathias Agopian <mathias@google.com> workaround: don't reset compositionType to HWC_FRAMEBUFFER

This workaround a HWC HAL issue in Nexus 7, which causes videos and live
wallpapers to animate slowly.

Bug: 7563862
Change-Id: I87803aaad9751b1fd8392b9732304d4bccec659a
WComposer.cpp
2adaf04fab35cf47c824d74d901b54094e01ccd3 18-Dec-2012 Andy McFadden <fadden@android.com> Rename ISurfaceTexture and SurfaceTexture

The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
ramebufferSurface.h
392edd88cb63d71a21a86a02cf9c56ac97637128 30-Nov-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Move GraphicBufferAlloc to libgui

This change moves the GraphicBufferAlloc class from SurfaceFlinger to libgui.

Change-Id: Idf31d2004efa2651b60590733f73c4a7b831e8a9
ramebufferSurface.cpp
raphicBufferAlloc.cpp
raphicBufferAlloc.h
e64b38fad2cc6686fb6691aaf65c735f505a49a5 20-Nov-2012 Jamie Gennis <jgennis@google.com> Merge "SurfaceFlinger: track the HWC retire fences"
3e095b251503d71bea04d6b707e8188cd30034e2 20-Nov-2012 Mathias Agopian <mathias@google.com> workaround: don't reset compositionType to HWC_FRAMEBUFFER [DO NOT MERGE]

This workaround a HWC HAL issue in Nexus 7, which causes videos and live
wallpapers to animate slowly.

Bug: 7563862
Change-Id: I16ad85317e3e7f47f005e7397357c14186b0a13d
WComposer.cpp
2ec3e0748bff8d75baade2ddda9fbfa21a3b7d3f 12-Nov-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: track the HWC retire fences

This change adds functionality to the HWComposer class to track the retire
fences returned by each hwc set call. It adds the HWComposer::getDisplayFence
method to allow other parts of SurfaceFlinger to get a fence that will signal
when the most recent flip takes effect on a display.

Change-Id: I676e0f98440fc58ed70908aa1a1e2ee3e7bf9eb2
WComposer.cpp
WComposer.h
ee932d0ad1a16cc93b4bd9eaf9cb3cc756fb2dfc 14-Nov-2012 Mathias Agopian <mathias@google.com> Reset compositionType to HWC_FRAMEBUFFER before calling prepare()

Honor the documentation. this broke in JB-MR1.

Change-Id: I841a93b409fc940374bc748c4e143d82a192669c
WComposer.cpp
WComposer.h
620685c2e684082c82657732d1e35cefd0c79006 19-Oct-2012 Andy McFadden <fadden@android.com> Fix emulator vsync

The code that reserves display IDs was only run when a hardware
composer was present. The eventControl() function, which handles
enabling of vsync, was ignoring the request because the primary
display didn't appear in its set of allocated IDs. This moves
reservation of IDs for built-in displays outside the HWC-only block.

Also, added a couple of warnings in eventControl().

Bug 7376568

Change-Id: I185ccdf817a25499b5c2668f8f6d594afb8c1568
WComposer.cpp
cdbaecb54152ce98789823420d426077d72aa1e7 12-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: make the num FBs a board config

Bug: 7283132
Change-Id: I38116f39fc18212f2daab94bbfc3daaf89439fc4
ramebufferSurface.cpp
ramebufferSurface.h
9e9689c11148521d2c16a121a0b87b062be0714c 11-Oct-2012 Andy McFadden <fadden@android.com> Fix HDMI unblank behavior

Two issues:

(1) We were announcing the hotplug event before we were ready to
handle blank/unblank events, so we were losing the initial unblank
that power manager sends us when HDMI is first plugged in. This
left the display blank until you toggled the device power off/on.

(2) We were retaining fbTargetHandle for HDMI after the display was
disconnected. The value didn't get updated when HDMI was reconnected
because the display was blank, so we didn't go through that code
path. So, when HDMI was re-connected, we passed stale data into
the HWC.

Bug 7323938

Change-Id: I2335d24fd7b0f00bb23fc63aa7bcf44cb8857c73
WComposer.cpp
cb55857bbde34a06c19dde3db5064d1717a0173e 05-Oct-2012 Mathias Agopian <mathias@google.com> fix dumpsys Layer name when using multiple displays

Bug: 7288401
Change-Id: I14beeef58fac5270cef3b611e18c163060efe6c3
WComposer.cpp
WComposer.h
5a8f9012ee8bb9dc1ad14432b96a821f08802ee3 05-Oct-2012 Andy McFadden <fadden@android.com> Tone down a fatal assert

The new disconnectDisplay function doesn't handle virtual displays,
but it may be called for them. Return without doing anything.

Bug 7281786

Change-Id: I62607f2ae6073fa66b393f55932604aeb8e03566
WComposer.cpp
81cd5d3b94d21253a0be925f4ae58cc7f4afeef7 04-Oct-2012 Mathias Agopian <mathias@google.com> make sure we don't call into the HWC HAL when not needed

when enabling/disabling vsync we now make sure to
not call into the HAL if the state wouldn't change.

Bug: 7274951

Change-Id: Ie24a6d68888a51b577acf9c2a973d85437cbacaf
WComposer.cpp
WComposer.h
27ec5739bc05330e08b02f25b62a8f597bad897a 03-Oct-2012 Andy McFadden <fadden@android.com> Fix crashes after HDMI disconnect

The display was being removed from SurfaceFlinger's list before we
had a chance to reset HWComposer's layer list, so we were passing
stale data into the hardware composer (which has its own per-display
data). This resulted in "invalid gralloc handle" complaints.
We now clear the layer list immediately after removing the display.

The display was being removed while its EGLSurface was still
"current", resulting in "cancelBuffer: BufferQueue has been
abandoned" complaints. We now call makeCurrent on the primary
display before removing the external display.

Bug 7274254

Change-Id: Ia59e3a61d7ec46488b96bf93ec5e4ed3488b70e4
WComposer.cpp
WComposer.h
ba607d53c6a94ea8c4c12571980c4ad159af308b 01-Oct-2012 Jesse Hall <jessehall@google.com> Add Fence::waitForever which logs a warning timeout, and use it

Bug: 7217641
Change-Id: If0c1a613ead307c4045a47824174bf40c72bc7d7
WComposer.cpp
d30b36d1fd0c7ab80553e784a155266be9703e47 01-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: reset the FB_TGT acquire fence

This change makes SurfaceFlinger reset the acquire fence fd to -1 after each
call to HWComposer::commit. The HWComposer implementation is resonsible for
closing the fd, so SurfaceFlinger should make sure not to pass it to HWC
multiple times.

Change-Id: I79554d9f6d6ef2b77d632d40251516c1f5b16ddb
Bug: 7258954
WComposer.cpp
c01a79d77b829e7de86ef137694e8ad708470ca1 28-Sep-2012 Andy McFadden <fadden@android.com> Pass display arg to blank/unblank

This allows us to blank and unblank displays other than the built-in
display (e.g. HDMI).

Bug: 7240511
Change-Id: I89ea13f9e497be74c3e1231d0c62fb558e93e0f8
WComposer.cpp
WComposer.h
9e2463e71796964cfaa06bf09a880875ac3537bc 22-Sep-2012 Mathias Agopian <mathias@google.com> add/remove displays properly on hotplug events

Bug: 7191563
Change-Id: I8f0fbf3b29658c9479443141798e6f288a1f2d52
WComposer.cpp
b4d18ed34e3513f3a14ea0876c7e330bee72a529 21-Sep-2012 Mathias Agopian <mathias@google.com> fix an issue where hotplug events were not dispatched

Change-Id: I527eec77f338cd6f1a9021aa4c9d384dbddd6d2a
WComposer.cpp
38e623bc5c2d7224ebd5b82efaea401bc8e5367a 21-Sep-2012 Mathias Agopian <mathias@google.com> fix a typo preventing pre hwc-1.1 devices from booting

Change-Id: Icf01254689633d04967872749ac947a671e47ed8
WComposer.cpp
f5a33928349bebc8eebc9f466618997e98c24e68 20-Sep-2012 Mathias Agopian <mathias@google.com> we now correctly set-up connected screens during boot

Change-Id: Ie8b1a3b97ad1821cc970e43abe96c8cec7135b66
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
148994e5f33ce240ff24ceb5bc0500b7f2001959 20-Sep-2012 Mathias Agopian <mathias@google.com> We now report hotplug events to the framework

Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
WComposer.cpp
WComposer.h
1604f777d11c40daae8ec91d8ea75625996bfbac 19-Sep-2012 Mathias Agopian <mathias@google.com> one more step toward HDMI support

getDisplayInfo() now returns proper information for
HWC managed displays.

hotplug is sitll not supported; so this is not fully correct
as the information returned will be bogus if the HDMI screen
is not plugged in.

Bug: 7191563
Change-Id: If55d8e829fae0443571548155007f486cdf9bc9f
WComposer.cpp
WComposer.h
f33e4b6f13bc3ee2d2a4e1abd1ada171c70d3492 21-Sep-2012 Mathias Agopian <mathias@google.com> GraphicBufferAlloc class was declared twice

this was confusing because the one in FramebufferSurface
wasn't in fact being used

Change-Id: Ied45aec20d804cfbe52440f9b2f2852a85c757cf
ramebufferSurface.cpp
raphicBufferAlloc.cpp
raphicBufferAlloc.h
6ab93290aeed63f139b0e77819ea889bbce9ec8b 18-Sep-2012 Mathias Agopian <mathias@google.com> suppress superfluous log

Change-Id: I838f2de4cf99e885833c4f42e2a69d6e3bb8eea5
WComposer.cpp
d3d35f18345c3ef93217313a583ace473b5a47ad 18-Sep-2012 Jesse Hall <jessehall@google.com> Check that HWC exists before trying to use it

Bug: 7185810
Change-Id: I1271d6ba397f3abf0ef166b8d03b9b26b72e28d7
WComposer.cpp
da27af9832a0170f1fc40ef3f21371c4d30d21b3 14-Sep-2012 Mathias Agopian <mathias@google.com> add support hwc 1.1

Bug: 7124069

Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
cde87a3b9d3f8dc15232d927b56ee9e5e520f58d 13-Sep-2012 Mathias Agopian <mathias@google.com> refactor things a bit

- decouple GL and main display initialization
- ensure that each "supported" display has its own FramebufferSurface
- onScreenAcquired/Released now takes a display

Change-Id: If34a05f3dea40f6c79db77f4dde283a2580daac4
WComposer.cpp
WComposer.h
ae2cfb5746e87f1bf17c446e20274c41ce0a57ce 13-Sep-2012 Andy McFadden <fadden@android.com> Minor tweaks

A couple of minor cleanups I stumbled over while looking at other
things.

Change-Id: I385ecfe1afefd577afbc59d7ef1d98d868073651
WComposer.cpp
db27621e22559a1b16414f890677ef04242fbc3b 07-Sep-2012 Jesse Hall <jessehall@google.com> Initialize new HWC 1.2 fields

Also rename resolution* to width/height.

Change-Id: Ia5f0c50d3f0a349160f314a3257c3b985e13ef1d
ramebufferSurface.cpp
WComposer.cpp
WComposer.h
babba1868773eba5edf8a8e335b8e109a32292e0 12-Sep-2012 Andy McFadden <fadden@android.com> Fix emulator

Emulator has no HWC.

Change-Id: I7810b27034f6772823142e5bf877681db1c8ee49
WComposer.cpp
43601a2dc320a271ff8c3765ff61414a07221635 12-Sep-2012 Andy McFadden <fadden@android.com> Reduce failure uncertainty

This adds a trivial workaround for a one-shot boot time crash, plus
an explicit check and abort for a failure condition that currently
presents as a less obvious failure.

Bug: 7145521, 7147557
Change-Id: I548f6a9caa9f0bd5710aaecea0e1c6c7c8f2f281
WComposer.cpp
b0d1dd36f104c0b581674adc7f830cbf44b7db06 10-Sep-2012 Andy McFadden <fadden@android.com> Reshuffle FramebufferSurface

FramebufferSurface no longer speaks directly to the FB HAL. Now
everything goes through HWComposer (which may or may not be
connected to a hardware composer).

Added display index arg to some query methods.

Change-Id: Id3e157d2d4e3555d33afbb703e518b6e92e2d6d5
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
b27254154642575dfb4bbfa79fbedde7d7ee23dd 06-Sep-2012 Jamie Gennis <jgennis@google.com> libgui: move fence handling into ConsumerBase

This change moves some common fence handling code into the base class for
BufferQueue consumer classes. It also makes the ConsumerBase class initialize
a buffer slot's fence with the acquire fence every time a buffer is acquired.

Change-Id: I0bd88bc269e919653b659bfb3ebfb04dd61692a0
ramebufferSurface.cpp
55882dea1b1b305f15192b96ff7814f18babb212 06-Sep-2012 Mathias Agopian <mathias@google.com> fix a problem where all hwc layers would have the SKIP flags set

the problem was that LayerBase::setPerFrameData() was always setting
this flag. in fact there was no reason to do this at that point since
the layer is initialized to a default state in setGeometry().

Bug: 7111259
Change-Id: Ib37b0dd7391a6163070e9aca025512159c1705f9
WComposer.cpp
e25d005d91344c500450f01d4a258ca9c3676627 05-Sep-2012 Jesse Hall <jessehall@google.com> Always reset layer acquireFenceFd after commit

If SurfaceFlinger needs to refresh the screen but the dirty region is
empty, it won't set the layer acquire fences, and stale file
descriptors will be passed to HWC commit(). Now we make sure to clear
the stale file descriptors for each layer right after commit().

Bug: 7078301
Change-Id: I6953ff91fc5488f105b30b07306f9c45a4c3f780
WComposer.cpp
c39736088398a9b4367b30fc307ed7de96ac342e 01-Sep-2012 Mathias Agopian <mathias@google.com> the visible region sent to HWC was garbage

we used to have a visibleRegion object per layer, but now
it's per screen; so at somepoint the code got changed to
calculate the per-screen visible region on the stack and that's
what got passed to HWC.

we're now setting the visibleRegionScreen at each frame and
freeing at after the HWC set() call. We use the underlaying
SharedBuffer so that in most cases we don't have to allocate,
free or copy memory around.

Bug: 7089478
Change-Id: I24fa556c76613a225d9fe7a6c6b727bb476144d8
WComposer.cpp
WComposer.h
f90883d6a50688081642855bba43bef0693d5020 31-Aug-2012 Jesse Hall <jessehall@google.com> Merge "HWC 1.1: hook up hotplug event, use new display config queries" into jb-mr1-dev
1bd20e0f9ecd27cc5ad2bdf08b01837ecc10c357 29-Aug-2012 Jesse Hall <jessehall@google.com> HWC 1.1: hook up hotplug event, use new display config queries

Change-Id: I2fd359e5fc7e1948072c6bc6b6fe47ea5e8025c1
WComposer.cpp
WComposer.h
72f096fb1ad0a0deadbfac5f88627461905d38e8 28-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: use max acquired buffer count

This change makes BufferQueue derive the min undequeued buffer count from a max
acquired buffer count that is set by the consumer. This value may be set at
any time that a producer is not connected to the BufferQueue rather than at
BufferQueue construction time.

Change-Id: Icf9f1d91ec612a079968ba0a4621deffe48f4e22
ramebufferSurface.cpp
2b9776982360a234803665cb79e8abcfeb0e3c79 31-Aug-2012 Jamie Gennis <jgennis@google.com> Merge "BufferQueue: clean up buffer counting" into jb-mr1-dev
31a353da225af5329735451c761b430d82dfda1b 25-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: clean up buffer counting

This change is a clean up of some of the handling of the maximum number of
buffers that are allowed at once. It mostly renames a few member variables and
methods, but it includes a couple small refactorings.

Change-Id: I9959310f563d09583548d4291e1050a7bbc7d87d
ramebufferSurface.cpp
9eb1eb5bb55740982ceae9966fc536824edc302a 29-Aug-2012 Jesse Hall <jessehall@google.com> Handle new device api version encoding

Change-Id: I3d36058bd5d31c23b3cc4a7eb5aa033b6f3c1955
WComposer.cpp
13a082e160c2d1d8006b93a555a57035213d568b 24-Aug-2012 Andy McFadden <fadden@android.com> Added display initialization method

The primary display device was being configured to "blank" by
default, which prevented the boot animation from appearing
(unless you got lucky with the hardware composer state).

Bug 6975688

Change-Id: I0fa52e9e719c6e997c5725a7baf15d9718461b78
WComposer.cpp
f435863467ab407f2a482604beed5fa6f0144c62 23-Aug-2012 Mathias Agopian <mathias@google.com> teach HWC about multiple displays

Change-Id: I5e72a83d419a729835cb0e1ec45557b4d3fb56b1
WComposer.cpp
WComposer.h
30bcc61431d8e3bef779472dd52a7b156dcaba09 23-Aug-2012 Mathias Agopian <mathias@google.com> remove support for HWC < 1.0

Change-Id: If7e676a6e3524afeb9af3875125d2131d95db38b
WComposer.cpp
WComposer.h
e60b0687c8d49871d0c8786cabe6851f7a7783b5 22-Aug-2012 Mathias Agopian <mathias@google.com> HWComposer now has its own concept of display IDs

HWComposer can now create IDs representing a display
it can deal with. IDs MAIN and HDMI are reserved.
SurfaceFlinger associate HWComposer IDs with a
DisplayDevice and uses that when it talks to HWComposer.

A DisplayDevice doesn't have to have a HWComposer ID,
in that case it just can't use h/w composer composition.

Change-Id: Iec3d7ac92e0c22bf975052ae2847402f58bade71
WComposer.cpp
WComposer.h
bbd164a3c790a0649dffd2f015e6f47692c72e1c 21-Aug-2012 Jesse Hall <jessehall@google.com> Update for cleanups in hwc interface

Change-Id: I363fd8b085167a1af6c14b68012bda5c62bfe59f
WComposer.cpp
WComposer.h
8f971ff6661c875e7adb3f14731e1579c3c80c62 22-Aug-2012 Jesse Hall <jessehall@google.com> Pass the correct number of displays based on HWC version

Change-Id: I27372f5d3102ad56f6d67722d631ae18d37f8330
WComposer.cpp
WComposer.h
5f20e2d4462da3471f59152b32cd8640fa4a21da 11-Aug-2012 Mathias Agopian <mathias@google.com> reimplement wifi display hack with new external display SF framework

fix a few bugs with external displays

- HWComposer doesn't really handle multiple displays yet
so there is a lot of ugliness there

- We also need to make sure that external displays are not
blanked by default

- due to some EGL limitations surfaces being swapped need
to be current

Change-Id: I82bff05b43bcebd8da863c7c76b4edbc3bc223a9
WComposer.cpp
8b736f138cfd9b239a2c7073347a13c489534ae1 14-Aug-2012 Mathias Agopian <mathias@google.com> xdpi / ydpi were reported as 0

Bug: 6975723
Change-Id: Ia7fa37ec11e2308804f5034959a37e508d292d31
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.cpp
WComposer.h
748f3df66f6695681cde44461e2548e6e1dbc1bb 10-Aug-2012 Mathias Agopian <mathias@google.com> avoid crashing when we don't have an h/w composer

should fix the emulator

Bug: 6956162
Change-Id: I38247b59d276b8db078c4dc2caba7d3fb545912c
WComposer.cpp
1e26087493ac0e7d7dc6dea8ad85cfef08b3271f 09-Aug-2012 Mathias Agopian <mathias@google.com> Add a display parameter to HWComposer where needed

- also replace C casts with C++ casts
- only the interface is changed, HWComposer still doesn't
fully handle multiple displays

Change-Id: I48eb89bff2edb76bf1d4d41f46802b9b2a7166a8
WComposer.cpp
WComposer.h
b685c542836b93c99cd85053e07696406ea37adb 31-Jul-2012 Jesse Hall <jessehall@google.com> Changes to support multi-display HWC

Change-Id: I07efff54f2980dcb013935747b03e099b8f1181b
WComposer.cpp
WComposer.h
1a4d883dcc1725892bfb5c28dec255a233186524 03-Aug-2012 Jamie Gennis <jgennis@google.com> surfaceflinger: refactor FrambufferSurface

This change refactors the FramebufferSurface class to inherit from the new
ConsumerBase class.

Bug: 6620200
Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
ramebufferSurface.cpp
ramebufferSurface.h
WComposer.h
888c822c4cb6976aab9256c58bae9e17e3e55c5c 05-Aug-2012 Mathias Agopian <mathias@google.com> remove a dependency of DisplayDevice on the refresh rate

this remove a dependency (not all) on FramebufferSurface

Change-Id: Ie07ce70760cdcedfb41b5b41bea8da45637bf474
WComposer.cpp
WComposer.h
d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3 02-Aug-2012 Mathias Agopian <mathias@google.com> cleanups in preparation of bigger changes

- fix typo drawForSreenshot misspelled
- get rid of DisplayDeviceBase
- removed unused or unneeded code
- always pass a DisplayDevice to Layer methods that are called
on a per-display basis (to make it clear that this could be
called more than once per composition).

Change-Id: Id948b7e09fe5c06db0e42d40d6ed75dd095c7f44
isplayDeviceBase.cpp
isplayDeviceBase.h
WComposer.cpp
WComposer.h
0f2f5ff75b7b48ceb64270655ee6b62d09bf4d00 01-Aug-2012 Mathias Agopian <mathias@google.com> rename DisplayHardware to DisplayDevice

Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
isplayDeviceBase.cpp
isplayDeviceBase.h
isplayHardwareBase.cpp
isplayHardwareBase.h
34a09ba1efd706323a15633da5044b352988eb5f 30-Jul-2012 Jesse Hall <jessehall@google.com> Move eglSwapBuffers out of HWComposer

Commit 8630320 moved the eglSwapBuffers fallback (for devices with no
HWC implementation) from DisplayHardware to HWComposer. But HWComposer
only knows about the framebuffer EGL display and surface handles if
there is a HWC, so it was always passing bogus handles.

This change moves the eglSwapBuffers fallback up to SurfaceFlinger,
which has access to the framebuffer EGL handles.

Bug: 6886613
Change-Id: Iad3f5ff7c90ee48d7053999e6a4548d6794b6ebd
WComposer.cpp
WComposer.h
028508cad5ef63ef9fbd42c14e76658e4fd9ebf2 26-Jul-2012 Mathias Agopian <mathias@google.com> hopefully fixe a race condition in sf initialization

if we received a vsync event during SF init, we could crash
as not all objects were ready to go.

Change-Id: Ie11b46e3eb1b37a709dd8757843d444f93dd0189
WComposer.cpp
8630320433bd15aca239522e54e711ef6372ab07 25-Jul-2012 Mathias Agopian <mathias@google.com> split HWComposer out of DisplayHardware

we will only ever have a single instance of HWComposer, so
it's now an attribute of SurfaceFlinger, instead of being part
of DisplayHardware.

DisplayHardware now just represents a "display" (it should be renamed).

Change-Id: Iec191e57686868e1df6daa8b880a286c9fefde56
WComposer.cpp
921e6ac4b7610a178285898d191eb0e3afe906c0 24-Jul-2012 Mathias Agopian <mathias@google.com> SurfaceFlinger cleanup

mostly refactored SurfaceFlinger.h, but also removed dead code.
cleaned-up a few includes as well.

Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
isplayHardwareBase.cpp
isplayHardwareBase.h
WComposer.cpp
WComposer.h
a49126087b4494f4ef50873f3a3f6727265f6621 12-Jul-2012 Mathias Agopian <mathias@google.com> factor EGL/GL and surface creation out of DisplayHardware

Change-Id: Icd85a6a4caad06f056578008af3e21666fa8b1f4
ramebufferSurface.cpp
ramebufferSurface.h
10fbdb6059755f009e02f0ccc2b9d289beb6b086 13-Jul-2012 Colin Cross <ccross@android.com> surfaceflinger: call into hardware composer to blank screen

Call into the new HWC blank operation to blank or unblank the screen.
Legacy systems may have already blanked the screen via early suspend,
and can choose to not implement the blank operation in their hardware
composer implementation.

Change-Id: Ib403c8c0e36367a2cfef3e1d124872fcfeb9e7cb
WComposer.cpp
WComposer.h
dc5b485f74edf2d2f31c62054eb6c180421a3ade 30-Jun-2012 Jesse Hall <jessehall@google.com> Pass fence to HWC on first use of buffer

Also do a CPU-wait on the fence before using it for GL composition.

Change-Id: I0f645a42a44803276cae11b904e5a26d65871562
WComposer.cpp
WComposer.h
b42b1ac1587aebda5e2f334d95b620271fafba4e 28-Jun-2012 Jesse Hall <jessehall@google.com> Return fence from acquireBuffer

Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
ramebufferSurface.cpp
1b03149f3533db04e72e088d3fdd09d0087ca594 21-Jun-2012 Mathias Agopian <mathias@google.com> get rid of GraphicPlane

its functionality is now folded into DisplayHardware
there will be more changes in that area.
isplayHardware.cpp
isplayHardware.h
3094df359d1e6e2ae8ca4e935cc093f563804c96 19-Jun-2012 Mathias Agopian <mathias@google.com> First prototype atttempting to support an external display

both API and implementation will change, this is just a prototype
intended to show feasability.

SurfaceFlinger is passed an ISurfaceTexture through a new
callback, it is in turn used to create an EGLSurface which
surfaceflinger will draw into in addition to the main screen.

Change-Id: Id0bbb0b854bb7bae44d57246a90b65d4567f9a21
isplayHardware.cpp
isplayHardware.h
ef19414bd8b77a26f5751f3845be79025a8263fe 14-Jun-2012 Jesse Hall <jessehall@google.com> Transfer HWC release fences to BufferQueue

After a HWC set, each SurfaceFlinger Layer retrieves the release fence
HWC returned and gives it to the layer's SurfaceTexture. The
SurfaceTexture accumulates the fences into a merged fence until the
next updateTexImage, then passes the merged fence to the BufferQueue
in releaseBuffer.

In a follow-on change, BufferQueue will return the fence along with
the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the
fence to signal before returning.

The releaseFence default value for BufferQueue::releaseBuffer() is
temporary to avoid transient build breaks with a multi-project
checkin. It'll disappear in the next change.

Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
ramebufferSurface.cpp
WComposer.cpp
WComposer.h
549646d29fccfb2366cc9ca4d894d39c55351fae 19-Jun-2012 Jesse Hall <jessehall@google.com> Merge "Add support for HWC_DEVICE_API_VERSION_1_0"
d3076aca0f6106dbc6c5a1588f560c62567752a4 16-Jun-2012 Mathias Agopian <mathias@google.com> Merge "Implement SurfaceFlinger's ANW on top of BufferQueue"
5880cc573823148237eac9ab7bc586b8e4eb7160 06-Jun-2012 Jesse Hall <jessehall@google.com> Add support for HWC_DEVICE_API_VERSION_1_0

The acquire and release fences aren't yet used; this is just support
for the new version and temporary backwards compatibility for older
versions.

Change-Id: Ia5ccc05a97c86f649042b9a35e11042fa0187e84
WComposer.cpp
WComposer.h
3e8b853d67c737abdb363f9c978e7d83eac4d888 14-May-2012 Mathias Agopian <mathias@google.com> refactor HWComposer to break dependency with the HAL headers

HWComposer must abstract the HWC HAL entirely, so that the
HAL can continue to evolve (and break binary compatibility)
without breaking SurfaceFlinger. The HWC data structure had
leaked outside of HWComposer, this is now fixed.

We now have an abstract interface that provide all the
needed functionality, HWCompose provides concrete
implementations of it based on the the HWC version.

Change-Id: I40c4676dc986b682ede5520a1c60efe64037b0bb
WComposer.cpp
WComposer.h
3e87601170141229d661df93e2f59e1ced73474b 08-Jun-2012 Mathias Agopian <mathias@google.com> Implement SurfaceFlinger's ANW on top of BufferQueue

SF now has its own implementation of ANW for the
framebuffer and it uses BufferQueue. FramebufferNativeWindow
is now only used by stand-alone apps.

Change-Id: Iddeb24087df62bd92b0f78e391dda9b97ddc859c
isplayHardware.cpp
isplayHardware.h
ramebufferSurface.cpp
ramebufferSurface.h
8e533069e5721e55cb9768e140e16546c3a4a8b6 07-Jun-2012 Colin Cross <ccross@android.com> surfaceflinger: replace early suspend with binder call from PowerManager

SurfaceFlinger will no longer directly synchronize with early suspend.
Instead, PowerManagerService will synchronize with SurfaceFlinger to
ensure that a black frame has been drawn on the display, and then
trigger all early suspend handlers.

Change-Id: I07acdd628440d23fdb69db94319ec5d65d3f4919
isplayHardwareBase.cpp
06e51a0aaf76fe53cef20c3345cf1ebda2b3461e 27-Apr-2012 Mathias Agopian <mathias@google.com> don't actuate vsync hint when not needed

Change-Id: I61c43dd76041816ab8cbe9aeaa55c11c1479ed03
owerHAL.cpp
owerHAL.h
03e407270c7ad76632f982c886d0776bed9e9b4c 27-Apr-2012 Mathias Agopian <mathias@google.com> set vsync power hint

Change-Id: I28c2faf9ff584df3e74392712971cbcf75eb9e98
isplayHardware.cpp
isplayHardware.h
WComposer.cpp
WComposer.h
owerHAL.cpp
owerHAL.h
a2f4e56fec0fb36c4a370eb23d6e9dc57f250b59 16-Apr-2012 Mathias Agopian <mathias@google.com> get rid off preserve backbuffer optimization in SF

this optimization didn't improve performance and in fact
seemed to hurt more than anything else. it also made
things a lot more complex as it introduced edges cases
when switching to/from h/w composer.

Change-Id: Iaafc235e175f5740cd98bff914d706e02ab88bb8
isplayHardware.cpp
isplayHardware.h
22ffb117b0c2a906bd04aef9738a52223cdd1dce 11-Apr-2012 Mathias Agopian <mathias@google.com> make sure to disable VSYNC while screen is off

Change-Id: If1894c43b0a39a2851e1280a35ae77bccd6d9abd
WComposer.cpp
b60314a12f3336b27d73920805ab07cbc498d857 11-Apr-2012 Mathias Agopian <mathias@google.com> rework screen on/off code

Change-Id: I13f71e850592a588bbd4805b1830c503bd4decb4
isplayHardwareBase.cpp
isplayHardwareBase.h
e2c4f4ec23b735dd2a03f4ea8b08b288a1bb04e8 11-Apr-2012 Mathias Agopian <mathias@google.com> Added vsync debugging information in dumpsys log

Change-Id: I20ef05a73d89caaf6a70dc9ca25ada6e6a1f6ff9
WComposer.cpp
WComposer.h
3a77871383bc1a03cc866686d81628493d14de7c 09-Apr-2012 Mathias Agopian <mathias@google.com> start VSYNC thread when HWC doesn't handle it

Change-Id: I853a822ea9ec13870ae25af55a89ad9a8cc3936a
WComposer.cpp
2965b26022f95051f65b09d7eac47cbe923855c9 09-Apr-2012 Mathias Agopian <mathias@google.com> VSYNC handling cleanup

Change-Id: I1376bf864c4e03c11fb6d1333a8b7cfdda08c9e4
WComposer.cpp
WComposer.h
1a3bf41b7165ba294af46bc32483eaad61e707ea 06-Apr-2012 Erik Gilling <konkers@android.com> Fix SurfaceFlinger crash in HWC::eventControl

eventControl was not checking if there was a hwc before callingi
hwc->eventControl

Change-Id: I4d739fc9c0d47da131f4ffc5d50e274de156d012
WComposer.cpp
3eb38cb33e41ce40dd1094bdec850f0fca9f8a53 04-Apr-2012 Mathias Agopian <mathias@google.com> SurfaceFlinger now uses the new VSYNC HAL API.

If h/w composer doesn't support vsync (version < 0.3) we
"fake" it with a timer.

Change-Id: I1e3be79f43c9631d1293ad7d6cf52f9bfc42d65b
isplayHardware.cpp
isplayHardware.h
WComposer.cpp
WComposer.h
SyncBarrier.cpp
SyncBarrier.h
31d2843b45ebdb69ec3355111b7567363fd2a6b7 04-Apr-2012 Mathias Agopian <mathias@google.com> Add HWC vsync hook. Currently unused.

Change-Id: I849d56f375813a044c5e2d0b25f791476a60fa01
WComposer.cpp
WComposer.h
b5dd9c0fee3b3d6d35035dfb992951ebea3e0e4e 22-Mar-2012 Mathias Agopian <mathias@google.com> rewrite density calculation code so it's understandable

Change-Id: I1016cd5fd75355abe4ab879d04f4849bd2dd4122
isplayHardware.cpp
6fc0a9bd4bdd3ae4a09ae033f68c04fecfc35991 22-Mar-2012 Dima Zavin <dima@android.com> displayhardware: fix not obeying ro.sf.lcd_density when specified

Change-Id: I71efd6aebfdb0323b07327f5e448a5cb5eb0fad6
Signed-off-by: Dima Zavin <dima@android.com>
isplayHardware.cpp
1b15e1e26b3d410b6bd51feeb7077251a464fee0 15-Mar-2012 Dima Zavin <dima@android.com> surfaceflinger: use display dpi if not forced with ro.sf.lcd_nensity

Change-Id: I52c4b872e0f2c088c2a6ada7a5bb15db071f0002
Signed-off-by: Dima Zavin <dima@android.com>
isplayHardware.cpp
90ac799241f077a7b7e6c1875fd933864c8dd2a7 26-Feb-2012 Mathias Agopian <mathias@google.com> fix libgui header location

Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
isplayHardware.cpp
isplayHardware.h
870b8aa15cb5c722b5d8eb7726eaa5f1a7c23d69 25-Feb-2012 Mathias Agopian <mathias@google.com> remove libui dependency on libEGL

Change-Id: I1194f04085637d5c384e134967249430cc43b6ee
isplayHardware.cpp
f6de1c04ffc2c7a739578b7612944fddb7011ab7 05-Feb-2012 Mathias Agopian <mathias@google.com> fix a crasher when starting SF with the screen off

SF could end-up in an infinite crash-loop during startup if it
was stopped while the screen was off. This happened because
the thread that manages screen blanking was started before
other important pieces of SF were initialized.

Change-Id: I0dded11dbf2395fdd57b673859a7aa0fa9eb32b6
isplayHardwareBase.cpp
isplayHardwareBase.h
67016af1e480a5f338555355638fc2a23e15c746 03-Feb-2012 Mathias Agopian <mathias@google.com> fix an issue where SF would spin if /sys/power/wait_for_fb_xxx don't exist

we now exit the Display thread on any error happening on these files.
also refactor the code and remove a lot of unused stuff.

Change-Id: I8d080c35b211890ca20ae09fa36fbdccdf5669a8
isplayHardwareBase.cpp
isplayHardwareBase.h
82d7ab6c7e0cf971e515134ccf072682dd1a2cdb 20-Jan-2012 Mathias Agopian <mathias@google.com> improve SurfaceFlinger dumpsys

It is now possible to say:

dumpsys SurfaceFlinger --latency

to print latency information about all windows

dumpsys SurfaceFlinger --latency window-name

to print the latency stats of the specified window

for instance: dumpsys SurfaceFlinger --latency SurfaceView

The data consists of one line containing global stats, followed by
128 lines of tab separated timestamps in nanosecond.

The first line currently contains the refresh period in nanosecond.
Each 128 following line contains 3 timestamps, of respectively
the app draw time, the vsync timestamp just prior the call to set and
the timestamp of the call to set.

Change-Id: Ib6b6da1d7e2e6ba49c282bdbc0b56a7dc203343a
isplayHardware.cpp
isplayHardware.h
55ef343331f5efbfe3e01bc9993d94faea236048 07-Jan-2012 Mathias Agopian <mathias@google.com> remove dead/usnused code

Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
isplayHardware.cpp
isplayHardware.h
e6f43ddce78d6846af12550ff9193c5c6fe5844b 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
isplayHardware.cpp
WComposer.cpp
32397c1cd3327905173b36baa6fd1c579bc328ff 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
isplayHardware.cpp
isplayHardwareBase.cpp
WComposer.cpp
a19954ab377b46dbcb9cbe8a6ab6d458f2e32bca 04-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
isplayHardware.cpp
9d4536835248525f32f1504a3d28d5bbfa0a2910 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
isplayHardwareBase.cpp
d0566bc26fcf6ca396118701fa11900b627f2c09 18-Nov-2011 Mathias Agopian <mathias@google.com> Add support for sending VSYNC events to the framework

use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: Ia720f64d1b950328b47b22c6a86042e481d35f09
isplayHardware.cpp
isplayHardware.h
SyncBarrier.cpp
SyncBarrier.h
439cf8576d3b846c0aa0944d84372259bf075d51 29-Nov-2011 Mathias Agopian <mathias@google.com> Fix build.

Revert "Add support for sending VSYNC events to the framework"

This reverts commit f3918c5bd4bc9f02f74da42995564150ca2dd382.

Change-Id: I998e3e1aa3fa310829ae973b64fe11b01f6f468f
isplayHardware.cpp
isplayHardware.h
461afeb9fde149f9455acbadf1257d08d33e8eb3 18-Nov-2011 Mathias Agopian <mathias@google.com> Add support for sending VSYNC events to the framework

use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: If4126023fc9c067e56087ec7d16a8fd542ce1794
isplayHardware.cpp
isplayHardware.h
4b9511c16195a646242eff833b0af212933b6eca 14-Nov-2011 Mathias Agopian <mathias@google.com> rework a bit how we manage EGL extensions

- don't advertise extensions that are not supported
by any implementation

- remove EGL_ANDROID_swap_rectangle which is not
implemented by anybody and confuses people

- add some comments about mandatory extensions

Bug: 5428001
Change-Id: Id8dc48116ac1d1eb79ec9ef55d03e29d4257c1f3
isplayHardware.cpp
385977f6d6c4e76379df384d50695a10cb3757f2 05-Nov-2011 Mathias Agopian <mathias@google.com> workaround to set the WM refresh rate to 48 Hz for tuna devices only

this is TEMPORARY until we can do this properly.

Bug: 5572464
Change-Id: I6537706d636a83a4a50e2900d6b829dd89b6f245
isplayHardware.cpp
f7cdd053fe1fee093f6b0973ad5723765f98a48d 11-Oct-2011 Mathias Agopian <mathias@google.com> fix an issue where the screen could stay off

this would happen when toggling on/off/on very fast, the screen
could stay black (while the panel is on).

Bug: 5429724
Change-Id: Ic8aa6aff066e6267923c0d47ef65e314e7bb6d41
isplayHardwareBase.cpp
isplayHardwareBase.h
e2c2f9213f936f98db604dc9c126ff22f725a824 06-Oct-2011 Mathias Agopian <mathias@google.com> Force a repaint when hwc invalidate hook is called

without this prepare() would be called but not set() since the
dirty region is empty.

Change-Id: I038acfbdad4c16015357ccde4d1949391d6f989d
WComposer.cpp
aebac5f34a098f733f887c993bd617a393e10db8 30-Sep-2011 Mathias Agopian <mathias@google.com> improve hwc log output

we now print the handle of each buffer

Change-Id: I70884ae458a9dcf10cfc403258d48eaa4618b7f4
WComposer.cpp
fc60b94db9081adb4835bd44eacdd0573fc4d644 23-Sep-2011 Mathias Agopian <mathias@google.com> fix dumpsys wording for h/w composer

Change-Id: Iaa1094964f2fb83da491e23b9309f7690079c17e
WComposer.cpp
9c6e297271ec9af9d974242d89cfa08cb6ceaa0a 21-Sep-2011 Mathias Agopian <mathias@google.com> fix transition from full overlays to fb

we need to clear the whole framebuffer in that situation because
we can't trust the content of the FB when partial (fb preserving)
updates are used.

Bug: 5318492

Change-Id: I3f0e01b0fb665a34e44d88ad9f0f54a5d990060b
isplayHardware.h
WComposer.cpp
WComposer.h
fb4d5d5726c172adbe62341d99a2148685a98379 21-Sep-2011 Mathias Agopian <mathias@google.com> improve hwc dumpsys

we now log the buffer's format

Change-Id: I9d3ad8018e884240a153de3baefb6331cb014d0f
WComposer.cpp
22da60c3e64cd57535cbba063c07127814a2b52f 09-Sep-2011 Mathias Agopian <mathias@google.com> Improve SF dumpsys output wrt HWC

Change-Id: Ibdb7930fa3b521bfd3f44750ed98cfd75f9a01fe
WComposer.cpp
WComposer.h
7ee4cd5556cef1878e1d4729f1b389f186311027 02-Sep-2011 Mathias Agopian <mathias@google.com> fix a bug that caused the off animation to not show sometimes

this happened when the overlays were in use, since the animation
is rendered in the FB and the FB is not used.

we now have a way to turn hwc off temporarily.

Change-Id: I3385f0c25bb9cc91948e7b26e7cd31ed18c36ace
WComposer.cpp
WComposer.h
c7d14e247117392fbd44aa454622778a25c076ae 02-Aug-2011 Mathias Agopian <mathias@google.com> Add a h/w composer API to allow the HAL to trigger a redraw

This is useful in various situations, for instance if the HAL
wants to change its compositing strategy.

Bug: 4488017
Change-Id: I5afc14e5917c6db7926d7417d48677d5aba50caa
isplayHardware.cpp
isplayHardware.h
isplayHardwareBase.h
WComposer.cpp
WComposer.h
6163091a2c366f8311fc3ee627dc7deb9681236e 07-Jul-2011 Mathias Agopian <mathias@google.com> Fix EGLUtils::selectConfigForPixelFormat()

- renderscript now calls EGL directly instead of relying on this function
- surfaceflinger also does its own EGLConfig selection
- selectConfigForPixelFormat stays for legacy reason (many tests use it) but
it now only tries to match the alpha channel of the format rather than the
format itself.

this will allow implementations who don't support the exact formats
defined in the HAL to work properly.

Bug: 4998223

Change-Id: Ic664dfc14d5072a514b6f77a115d1521bfc1578f
isplayHardware.cpp
1f339ff3875afad128a8e16ee6395c5fad295826 02-Jul-2011 Mathias Agopian <mathias@google.com> don't kill surfaceflinger when system process dies

Change-Id: I2d3ed87b590f9ccea3fa4af41d92911de070b315
isplayHardware.cpp
d9071ad304b20e6d0ddf8473bc1f12ce3d7feb11 20-Apr-2011 Mathias Agopian <mathias@google.com> Merge "remove support for console in SurfaceFlinger"
3d031507e9fe249ca9f51314fe9613ff5ed262bf 19-Apr-2011 Mathias Agopian <mathias@google.com> remove support for console in SurfaceFlinger

the only supported screen management api now is
/sys/power/wait_for_fb_{sleep|wake}

Change-Id: I6c7d8d54843da4980b1b38ee3d46cf19be275240
isplayHardwareBase.cpp
isplayHardwareBase.h
3d64e738b91b2a4a9d81fae1991e6f6eae9ac8c8 19-Apr-2011 Mathias Agopian <mathias@google.com> fix memory corruption when retriving GL_MAX_VIEWPORT_DIMS

Change-Id: I2e0b1eac6dbc6a4ecbbaf31013aa02cf2369fce2
isplayHardware.cpp
isplayHardware.h
a5529c8778c2f407f482fc12165aeb76c0f505c2 08-Dec-2010 Mathias Agopian <mathias@google.com> remove support for PUSH_BUFFER surfaces and overlays

the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
isplayHardware.cpp
isplayHardware.h
1d21a9cafc534c34a2f28c985c4c7aa176d0e67b 02-Dec-2010 Erik Gilling <konkers@android.com> surfaceflinger: add support for gralloc dump hooks

Change-Id: Ib6f539ed0132b70d040d653c03d52cc04249ac3c
isplayHardware.cpp
isplayHardware.h
WComposer.cpp
47a79466a72715d57934016a3cad19444dad0642 21-Oct-2010 Mathias Agopian <mathias@google.com> am fb31036f: am 583fefc8: Merge "Use the context_priority extension when present." into gingerbread

Merge commit 'fb31036fd844444c395a2ae9c97439eec9f774e4'

* commit 'fb31036fd844444c395a2ae9c97439eec9f774e4':
Use the context_priority extension when present.
3c85e4ad5a14a49fffcd458886cf7519276daed5 21-Oct-2010 Mathias Agopian <mathias@google.com> Merge "Use the context_priority extension when present." into gingerbread
e33a35f02576b482a5ac4891a78f6e72fb4c0dea 15-Oct-2010 Mathias Agopian <mathias@google.com> am 5bfa3a34: am 011b5bcc: Merge "implement part of [3094280] New animation for screen on and screen off add support for screen on animation" into gingerbread

Merge commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f'

* commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f':
implement part of [3094280] New animation for screen on and screen off
503d2d4a08370209dc83330bd00997ba9512f46f 14-Oct-2010 Joe Onorato <joeo@google.com> am 9a12a3c8: am ba799098: Merge changes I76513387,I335fb671 into gingerbread

Merge commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96'

* commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96':
Remove dead code, and make the animation a setting.
turn off the electron beam
9daa5c9b9dd286cbbf5d43f7e45a5e9e4048e855 13-Oct-2010 Mathias Agopian <mathias@google.com> implement part of [3094280] New animation for screen on and screen off
add support for screen on animation

Change-Id: If50cf52ae04b95b42da7d74cf7fa96d5cb54d238
isplayHardwareBase.cpp
59119e658a12279e8fff508f8773843de2d90917 11-Oct-2010 Mathias Agopian <mathias@google.com> turn off the electron beam

Change-Id: I335fb6719f1d5a3f1c6f37a046fd1c2c4ed2bbc6
isplayHardwareBase.cpp
isplayHardwareBase.h
67226814e1b6d1c02079635608444e73ec658837 12-Oct-2010 Mathias Agopian <mathias@google.com> Use the context_priority extension when present.

Change-Id: I12eadf1e32d576de5d811fba44afa73263e13eef
isplayHardware.cpp
58959343dbdb6157fa5f5463262d4842b8954353 07-Oct-2010 Mathias Agopian <mathias@google.com> Fix a null dereference

Change-Id: I3df446b90c1607782778749de7ba0f8c00698c33
WComposer.cpp
8372785879d329f592f6883620b5a32d80d74691 24-Sep-2010 Mathias Agopian <mathias@google.com> dump HWC state in dumpsys

Change-Id: Ifbb38ca1ac9685776250e01c8d02021b35af72cf
WComposer.cpp
WComposer.h
c479e18db0216f7096fefe85ffa71ab00329aef3 15-Sep-2010 Mathias Agopian <mathias@google.com> resolved conflicts for merge of 48a86240 to master

Change-Id: I2305fef9f4dd46183337217d822df3c675b6b6e5
35b48d10bc9e064201d3d54d2d476314684a7a05 14-Sep-2010 Mathias Agopian <mathias@google.com> Add logging of various important graphics events

There are 16 events logged in the event log:
SF_APP_DEQUEUE_BEFORE
SF_APP_DEQUEUE_AFTER
SF_APP_LOCK_BEFORE
SF_APP_LOCK_AFTER
SF_APP_QUEUE

SF_REPAINT
SF_COMPOSITION_COMPLETE
SF_UNLOCK_CLIENTS
SF_SWAP_BUFFERS
SF_REPAINT_DONE

SF_FB_POST_BEFORE
SF_FB_POST_AFTER
SF_FB_DEQUEUE_BEFORE
SF_FB_DEQUEUE_AFTER
SF_FB_LOCK_BEFORE
SF_FB_LOCK_AFTER

all events log the buffer conserned and a timestamp in microseconds.

by default the logging is not enabled, to turn it on:
adb shell service call SurfaceFlinger 1006 i31 1
adb shell setprop debug.graphic_log 1

The effect is immediate in SurfaceFlinger, but applications need to be
restarted.

Change-Id: Ifc2e31f7aed072d9a7dede20ff2ce59231edbec1
isplayHardware.cpp
isplayHardware.h
f5f2712854599b4970643c6000fe6ae950a08ba9 09-Sep-2010 Antti Hatala <ahatala@nvidia.com> surfaceflinger: give hwcomposer a chance to release buffers

Change-Id: I605fa779702022865dd58df3b36f37c2644ade36
isplayHardware.cpp
WComposer.cpp
WComposer.h
000ca8fa9a1a92aa2f132ba41d11ece6d01cdadd 18-Aug-2010 Mathias Agopian <mathias@google.com> revert hwcomposer HAL changes. DO NOT MERGE.

This reverts commit:
94364b91a2894bf037b8beb027132fbb812e1434
f8e705dea48f77f1c2532fdbadd4997dd1851af0
b59beb5ca68d0228f60dda60d85e2d0226b33215
e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20
isplayHardware.cpp
isplayHardware.h
WComposer.cpp
WComposer.h
45721773e1a68e96da4b6cc04cef276bae7ca3e9 13-Aug-2010 Mathias Agopian <mathias@google.com> Fix a couple issues with the new hwcomposer HAL

- we now clear the framebuffer upon request from the HAL
- the HAL list size could get out of sync with reality
- there was also an issue where sometime we could run past the list

Change-Id: Ic3a34314aed24181f2d8cc787096af83c046ef27
WComposer.cpp
WComposer.h
f1352df47fe20aed23c216a78923c7d248f2bb91 12-Aug-2010 Mathias Agopian <mathias@google.com> should fix sim build, hopefully

Change-Id: I5390bd34dcca36fef43b5169386fff1b04cc842b
WComposer.cpp
a350ff98692b3a50cad5cc93f9f83221242ca86a 11-Aug-2010 Mathias Agopian <mathias@google.com> call into hwcomposer HAL when present

Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
isplayHardware.cpp
isplayHardware.h
WComposer.cpp
WComposer.h
81bac09fa6b01dd1495644d9c825c3666762fced 15-Jul-2010 Mathias Agopian <mathias@google.com> move native services under services/

moved surfaceflinger, audioflinger, cameraservice

all native services should now reside in this location.

Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8
isplayHardware.cpp
isplayHardware.h
isplayHardwareBase.cpp
isplayHardwareBase.h