History log of /frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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)
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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)
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
94e35b93537c7f9da018688ac8a8ba87f4689915 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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
49cdc635a222a495b5b5e17962c31a308003e23d 22-Jun-2017 Chia-I Wu <olv@google.com> Merge "surfaceflinger: discard stale commands" into oc-dev
am: f8ca9a0875

Change-Id: Ief69f6fcf0c738612b14b94d65b3ae1555973d6c
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
d8ac4fd17a71b8b523121186b8a03212cd5122fe 25-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Delete SurfaceFlinger BYPASS codepath" into oc-dev
5b3cf0576d91358cb850945d89382938ff8dc5ed 04-May-2017 Fabien Sanglard <sanglardf@google.com> Delete SurfaceFlinger BYPASS codepath

Test: AUPT, Manual
Change-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
Merged-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
831d48ed282e7e5095895c8d1896881ff36947f7 04-May-2017 Fabien Sanglard <sanglardf@google.com> Delete SurfaceFlinger BYPASS codepath

Test: AUPT, Manual
Change-Id: I8d6139fbb8a3ec113d7cb973420a5874d3e31030
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp
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
/frameworks/native/services/surfaceflinger/DisplayHardware/HWC2.cpp