History log of /frameworks/native/services/surfaceflinger/SurfaceFlinger.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
515dc9c538b8206b746eeb4906ac0b8aed1fb497 15-Jun-2017 Chia-I Wu <olv@google.com> surfaceflinger: Layer::getParent requires state lock held

We rely on mStateLock to synchronize accesses to
Layer::mCurrentParent.

Bug: 38505866
Test: manual stress test
Change-Id: I5f8ec358ed7e35df28f8c6aec31ae6ee51cb5b93
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b1e2f8deb38353e4bcc9d3ef06bc15bd5e417425 09-Jun-2017 Jorim Jaggi <jjaggi@google.com> Properly run window animations at vsync-sf (2/2)

- Add new Choreographer instance that runs on vsync-sf
- Use this new Choreographer for WindowAnimator, and remove all
the hacks around it

Test: Open apps and close apps, notice no stutter
Test: Screen zoom animations
Test: go/wm-smoke
Bug: 36631902
Change-Id: I72a8b39709303a38fc077100229b8a81a153ba3e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
412903fce3a93f411c85c54375a1851bfb370400 27-Apr-2017 Dan Stoza <stoza@google.com> SurfaceFlinger: Select which layer state to visit

Modifies the traverseIn[Reverse]ZOrder methods to also take an enum
value specifying whether to traverse the current state or the drawing
state.

This has the effect of fixing a bug where we weren't performing
transactions on a child layer because its parent was only visiting its
drawing layers (rather than its current layers) and was thus skipping
the child, which had not yet been moved from current to drawing.

Bug: 36858924
Test: ChildLayerTest.Bug36858924 doesn't hang
Change-Id: I1959f40bc07e77864ba024511d429592a398a67a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
5c34de2c12ab2638fd6b16f1b77dedd0ffa3ab27 10-Apr-2017 Ian Elliott <ianelliott@google.com> Only enumerate display_timing when present timestamp supported

Test: CTS and cube demo.
Bug: 36887025

Vulkan should only enumerate the VK_GOOGLE_display_timing extension if
the device supports reliably returning the present timestamp. Vulkan
will determine this by reading a property that SurfaceFlinger will set
(based on the HWC2::Capability::PresentFenceIsNotReliable capability).

Change-Id: I6025be5f9120a8f02f228b8437b64be4ff8cfb17
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
21d072ac4a4f67b89c465121ace7a9764872aef0 12-Apr-2017 Brian C. Anderson <brianderson@google.com> Merge changes from topic 'presentFenceNotReliable' into oc-dev

* changes:
egl: Use reserved values for eglGetFrameTimestamps
egl: Differentiate pending vs invalid timestamps.
egl: Avoid use of retire as present
6b376713907086c9642e7b7e66e51ddfa531b003 04-Apr-2017 Brian Anderson <brianderson@google.com> egl: Avoid use of retire as present

Retire fences from HWC1 are implemented inconsitently,
so present emulation doesn't always work well.

This patch disables present for all HWC1 based devices.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*
Bug: 36730849, 36887025

Change-Id: I1eba2f8490c2f6feced2a36d1efc4cd66be7da40
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
80c02320c49f5f6e1cb2651620fa31de551502a7 10-Apr-2017 Polina Bondarenko <pbond@google.com> Revert "Avoid a potential race condition on mDisplays"

This reverts commit 5576a555a14edd8c76addce2cee37b9b9ced2c3f.

Change-Id: I5d5889fccd94acacfbfef29847e4b65ef2543c75
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f3b2de10caa2a96e65f3e8ebecb2730ff28aeeb1 27-Mar-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Dump info about wide-color

Test: adb shell dumpsys SurfaceFlinger
Look for section titled "Wide-Color information:"
Bug: 29940137

Change-Id: I2bd642aa026b49bbb9effd5cb1687c7a36dae684
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
5d94389241cc651e6bd327ab80eba3ad476f3724 22-Mar-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Add wide-color support to SurfaceFlinger

Test: manual testing
Bug: 29940137

Change-Id: I9358b3c982e0205e598fd20cbf8d2e956591b3ac
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
bc7552874052ee33f1b35b4474e20c003d216391 31-Mar-2017 Cody Northrop <cnorthrop@google.com> surfaceflinger: Generate unique layer names

Add a counter to layer names to make it clear when there are duplicates.

layer foo#0
layer foo#1
layer bar#0
layer bar#1
layer bar#2

Bug: b/32543755
Test: Build, install, run game with duplicate layers, see unique names.

Change-Id: I915531d7adbdc506c429b86a685665fb6c56d25e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1971b63aa4d82db37794f19e0eb01feb1826e422 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use max acquired buffer setting to configStore

Change-Id: I48454243bcac12f5a83d080cd9115686f9f728ca
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4d8f53906fa71ab3850e0fbdb62573b7b1f90deb 21-Mar-2017 Steven Thomas <steventhomas@google.com> Merge "Revert "Revert "Tie vr flinger to persistent vr mode"""
d8ab4396a858a9c929a1bb3cadf7705fb8061574 21-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "egl: Remove retire event."
050b2c83304bd16ec3a838da08b6ba6acf6a3af4 06-Mar-2017 Steven Thomas <steventhomas@google.com> Revert "Revert "Tie vr flinger to persistent vr mode""

This reverts commit 7480c060cb3466d97ec3125d61bbace153f534c8.

Transfer display control to vr flinger when persistent vr mode is
entered, rather than when vr mode is entered. This allows cardboard
apps, which will invoke vr mode but not persistent vr mode, to work as
in N.

This activates vr flinger at device boot for Daydream ready devices,
which fixes an issue where an app would attempt to create a surface
before vr flinger was running, which would hang indefinitely.

The VrManager listener for persistent vr mode is put in vr flinger
instead of surface flinger. This is cleaner since the vr interaction
with the rest of the device is now consolidated in vr flinger.

While testing I encountered a problem where vr flinger was given control
of the display but vsync was turned off, causing vr flinger's post
thread to hang. I changed the vr flinger logic to give control over
vsync and other display settings to the post thread, and took the
opportunity to further simplify and improve vr flinger's thread
interactions.

Bug: 35885165

Test: Manually confirmed that when persistent vr mode is not invoked we
get the N-based render implementation, and when persistent vr mode is
invoked we get vr flinger.

Change-Id: I3b5ad599cc0748e38b861c714c4cc3118f854acf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
7480c060cb3466d97ec3125d61bbace153f534c8 21-Mar-2017 Jin Qian <jinqian@google.com> Revert "Tie vr flinger to persistent vr mode"

This reverts commit f43d13e4e35ae7d3cdafc4b97c819669d42cef78.

Change-Id: Ib67db8e51b7ea2dbbe6faccce36962bf5b44a6e2
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f43d13e4e35ae7d3cdafc4b97c819669d42cef78 06-Mar-2017 Steven Thomas <steventhomas@google.com> Tie vr flinger to persistent vr mode

Transfer display control to vr flinger when persistent vr mode is
entered, rather than when vr mode is entered. This allows cardboard
apps, which will invoke vr mode but not persistent vr mode, to work as
in N.

This activates vr flinger at device boot for Daydream ready devices,
which fixes an issue where an app would attempt to create a surface
before vr flinger was running, which would hang indefinitely.

The VrManager listener for persistent vr mode is put in vr flinger
instead of surface flinger. This is cleaner since the vr interaction
with the rest of the device is now consolidated in vr flinger.

While testing I encountered a problem where vr flinger was given control
of the display but vsync was turned off, causing vr flinger's post
thread to hang. I changed the vr flinger logic to give control over
vsync and other display settings to the post thread, and took the
opportunity to further simplify and improve vr flinger's thread
interactions.

Bug: 35885165

Test: Manually confirmed that when persistent vr mode is not invoked we
get the N-based render implementation, and when persistent vr mode is
invoked we get vr flinger.

Change-Id: Ieeb8dabc19e799e3179e52971f3b63f5a8f54b3b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
757b4ec4b453cd8e58b4d67d8ac79a73a1046bbd 18-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix getFrameTimestamp test flakes."
cbf153bedf2eafc1443bbc97c4e74f97e7973edd 11-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use hasSyncFramework value from configStore

Change-Id: I41c6b1a26001eb6ba08cbc419dc8a683f5722aa3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c8e387edfcead55b6e6fb1d05db279c264b644fa 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use configStore for maxVirtualDisplay Size

Test: Manual and AUPT
Change-Id: I17ec13f782a7c7c693d84d11c9b5e87624ee71d0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8c02341c732956b282f11744501cc6a97ac165dc 17-Mar-2017 Fabien Sanglard <sanglardf@google.com> Revert "Use configStore for maxVirtualDisplay Size"

This reverts commit 56a5dbd3b050cbfd324308d224c7d12f4aec3320.

Change-Id: I66224bb48d3146846200ff7f2d5a66d1d8ff5cf7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
56a5dbd3b050cbfd324308d224c7d12f4aec3320 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use configStore for maxVirtualDisplay Size

Test: Manual and AUPT
Change-Id: Iefc09b06ab473c4029756279920135761547dd65
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a34ed639c3057b99da0fb703beb12827e30aa508 14-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use forceHwcCopyForVirtualDisplay in configStore

Test: Manual
Change-Id: Ie6f816cf8f48b1cca41d51f40e9f0ae49aef2908
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d001058145c2186f454a3fb043388d6d9b84c9d8 07-Mar-2017 Brian Anderson <brianderson@google.com> Fix getFrameTimestamp test flakes.

This fixes both the dEQP CTS flakes relating to
compositor timing and the lib_gui test flakes that
don't initialize properly.

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

Change-Id: If8e59f0dc9a916bab28bd1a36190cef9a56cb64f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f9e6033ea896e43d962a81c13d2b65d952955450 16-Mar-2017 Romain Guy <romainguy@google.com> Merge "Revert "Get rid of IGraphicBufferAlloc""
f8b4ca51111cd2e566d1774ac464da859db78976 16-Mar-2017 Romain Guy <romainguy@google.com> Revert "Get rid of IGraphicBufferAlloc"

This reverts commit 78491c9f694cb0767996503c629776a8eda950d7.

Change-Id: I78d5c0a30ab80265f697f681387872b6763b2d1e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d4639b1eae0d934ad47b260315416fb7b8026a50 16-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Get rid of IGraphicBufferAlloc"
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c45a7d9dfdefa07512c5acc07bcbee5362b34e3d 14-Mar-2017 Fabien Sanglard <sanglardf@google.com> [SF] Use presentTimeOffset from configStore

Change-Id: If9c872c565e68e8abe552ee11d2c7d48f44aec4b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
bd7ba140b3898f2a3a671311744600fb60b40053 15-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[SurfaceFlinger]Use configStore useContextPriority"
c93afd54a05497c4ae42db99ea0310ee69cca492 13-Mar-2017 Fabien Sanglard <sanglardf@google.com> [SurfaceFlinger]Use configStore useContextPriority

Change-Id: I329b5da0e92822eb0878c8866c8ab87ea13f7e07
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4e67f0f8c13c4777bccbcd527ff18584c3ccc93a 10-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[SurfaceFlinger] Use sf phase offset from CS"
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0cc1938871edd6659d6783404a3523abc6b98d92 06-Mar-2017 Fabien Sanglard <sanglardf@google.com> [SurfaceFlinger] Use sf phase offset from CS

If present, use sf phase offset from the config Store.

Test: Manual
Change-Id: I2dd7ecf984b7484f6b447699680f54c7c8e221a0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3a8f794471815e6419caefe254adf2bbb19a8a53 03-Mar-2017 Mark Urbanus <urbanus@google.com> Tie VR mode support to a property

Bug: 35854545
Test:
- Validate VR mode is not supported when ro.boot.vr is unset
- Validate VR mode is supported when ro.boot.vr is set

Change-Id: I26f7e851766eab0d8a5a2f9fb4d72bfcee0c42f3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
77c073bdbe1b24a332056e1194a6162b7717a848 01-Mar-2017 Rob Carr <racarr@google.com> Merge changes from topic 'surfaceview-without-wm'

* changes:
Add detachChildren transaction.
Add deferTransaction variant taking GraphicBufferProducer.
6961b6bc1f6f172745deee98e7dcb34a3668e4e6 01-Mar-2017 Mathias Agopian <mathias@google.com> Remove unneeded references to IMemory

Test: compiled & run
Bug: cleanup
Change-Id: Ifef6695275f244a420df574b3bc49adb99c93fbf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9524cb3b37a91b5741790c77ff24fd825b02bca7 13-Feb-2017 Robert Carr <racarr@google.com> Add detachChildren transaction.

Add SurfaceControl#detachChildren for use by the WindowManager.
This method is used in cases where the WM would previously preserve
windows the client tried to destroy. For example, when becoming invisible
(in the activity lifecycle sense, not in the SurfaceFlinger sense)
an app will destroy its child surfaces. Previously the WM would keep child
windows alive until the animation finishes to prevent glitches. The new
scheme for this is the WM will detach the children at this point,
at which point the parent layer becomes the owner of the children and the WM
can control the lifecycle as it wishes. I also included a test for reparentChildren
as I realized I had forgotten that.

Test: New test in Transaction_test.cpp
Change-Id: I79c22b2ccccceb9bdcc37b70c491bdf33dcf83d2
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0d48072f6047140119ff194c1194ce402fca2c0b 11-Jan-2017 Robert Carr <racarr@google.com> Add deferTransaction variant taking GraphicBufferProducer.

For SurfaceView using child layers, the client framework
will not have access to the Handle* for the parent surface,
but still needs a way to defer transactions to it's frames.

Test: Tested with corresponding SurfaceView modifications and existing tests.
Change-Id: I6f01c360e85a95ff0ab08db406741221152e5d5c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9f02435fd44c0651c85e9bd4dc7307bc6b1a85fa 15-Feb-2017 Brian C. Anderson <brianderson@google.com> Merge "EGL: Add eglGetCompositorTimingANDROID."
0a61b0c813f5991bf462e36a2314dda062727a10 07-Dec-2016 Brian Anderson <brianderson@google.com> EGL: Add eglGetCompositorTimingANDROID.

Exposes the composite deadline, composite interval, and
the composite to present latency.

A history of composite and present fences are stored.
When the present fence's timestamp becomes known,
the composite to present latency is updated with
sampling jitter removed.

The values are updated in the producer when timestamps
are enabled and on queue and dequeue.

The deadline is snapped to the next expected deadline
based on the current systemTime().

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

Change-Id: I406814258613b984b56488236632494f2f61ff2e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
bb5afada05e597b8a74e3888863319c319c3c944 10-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Disable Virtual Display by default in SF"
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/SurfaceFlinger.h
642b23d70f7b513e88680c1d8400c1c1cfe6edd3 09-Feb-2017 Fabien Sanglard <sanglardf@google.com> Disable Virtual Display by default in SF

These should be enabled by default once b/30022738 is resolved.

Change-Id: I70a48a0bcf98ca984a28aa130170270d16e708bf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b254fa3a9eccd5ad7d853d687cf50a68dd8ee41c 01-Feb-2017 Wei Wang <wvw@google.com> SurfaceFlinger: Set property in separate thread in init

By setting property in a separate thread, the CL aims to
avoid slow initilization in SurfaceFlinger::init where
SurfaceFlinger is waiting on property_service.

Bug: 34499826
Test: on marlin
Change-Id: I91afad3cbc9a2b31aa89ae9cc752ad491cc9d8e4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
479c60c85c40fd3536b0c88036e838dc1a4c56a0 27-Jan-2017 Albert Chaulk <achaulk@google.com> Refactor how layer metadata for use by VR is propagated
from WindowManager based on feedback in frameworks/base.

Since windowType and ownerUid are immutable, they are sent
on creation instead of separate IPC.

Bug: 30984984
Test: built locally

Change-Id: I380b3cdcf6aec471fc23f1e27846ab80492e8add
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1db73f66624e7d151710483dd58e03eed672f064 21-Dec-2016 Robert Carr <racarr@google.com> SurfaceFlinger: Add support for non-privileged clients.

Allow clients without privilege to create child layers through scoped
connections. We enable this in preparation for allowing SurfaceView
to bypass the WindowManager. We include support for reparenting of
all of a layer's children for the WindowManager to use in cases where
one surface is replacing another (while keeping its children around).

Test: Tested with corresponding SurfaceView modifications.
Change-Id: I9920e6730d719113522a68788e63fb59f70d3406
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1f0a16a5d7cd00ba7fda82e7d315afa1fd1303b9 25-Oct-2016 Robert Carr <racarr@google.com> SurfaceFlinger and libgui: Support for child layers.

Add support for parenting Layers in a tree. Layers
follow scene-graph style rules, that is to say:
1. A child is cropped to the final bounds of the parent.
2. A child inherits the parent's transform (including position)
3. A child's Z ordering is relative to the parent and bounded between
the parents siblings.
4. A childs lifetime is bounded by it's parents lifetime.

Test: New tests in Transaction_test plus manual testing with later branches.
Change-Id: I96f8ad863665b9a70b6f845561344c297b7e6eff
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2047fae0cfed99c425dc7333f31d309e5b8ee1ba 28-Nov-2016 Robert Carr <racarr@google.com> SurfaceFlinger: Use traversal functions to iterate LayerList.

In preparation for the Layer hierarchy. There we will need
to use such a style to traverse the tree of layers.

Test: Just a refactoring. SurfaceFlinger still works.
Change-Id: I84dcd82e713f1bdbe911658793ce11460267a956
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ae0608381b2b4699218febd6d45ad9d307544d55 28-Nov-2016 Robert Carr <racarr@google.com> SurfaceFlinger and libgui: Switch Z-order to signed type.

In preparation for SurfaceFlinger child layers. In that model
children's Z order will be relative to their parent. We need
negative Z values to represent children stacking below their
parent (e.g. SurfaceView). Java side already uses signed types
strangely enough.

Test: Basically a refactoring. SurfaceFlinger still works.
Change-Id: Ifcece69f6f9d917cbf5238a59f8e5de1e8ba6a25
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
63a5fcd2aa55c8eb0ccba621517a4215d8504df6 30-Dec-2016 Fabien Sanglard <sanglardf@google.com> Move TARGET_DISABLE_TRIPLE_BUFFERING to property

As part of the migration to Soong, Android.mk environment variables
must be moved to property which are checked at runtime.

Tests: Angler and Sailfish
Change-Id: I7c620656c6778b36fea78c3087fbd5d33cea96f8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c8251eb7a6ecfdd16b3e4cfbfb442aa4c789c039 07-Dec-2016 Fabien Sanglard <sanglardf@google.com> Delete unused mask eTransactionMask parameter

Change-Id: I1f9dafb014bb3090186443ef1049b7dd53a9a697
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b52cfec8ded83ebb36a41851c01f0e5666a25a39 05-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Rename hw to displayDevice for consistency"
830b84704b0f33030d0e391a0ea2e7faa5646e2e 01-Dec-2016 Fabien Sanglard <sanglardf@google.com> Rename hw to displayDevice for consistency

Change-Id: I8bdb9be9c0e024d74a5aacc1f78c553cc1bc5ab4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3890c3995c4a52439844faeb80b5503d42b977d8 25-Jul-2016 Brian Anderson <brianderson@google.com> Cache frame event history producer-side.

* Producer maintains a recent history of frames.
* Producer only does a binder call if requested
informatiVon doesn't exist in the cache.
* Consumer sends fences to the producer, which
can be queried for timestamps without a
binder call.

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

Change-Id: I8a64579407cc2935f5c659462cb227b07ba27e43
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d6927fb1143398370c0885844bfb58923ef740b7 24-Jul-2016 Brian Anderson <brianderson@google.com> Track frame events incrementally and per layer.

* Replaces FenceTracker, which was owned by SurfaceFlinger,
with FrameEventHistory, which is owned by Layer.
* Updates FrameEventHistory as events occur.
* Changes SurfaceFlinger flag "--fences" to
"--frame-events".

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

Change-Id: I868c2ef93964656d7e41848243433499e7f45fe7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6e8e98a23592c2522396b673145814a4bbee69db 28-Oct-2016 Fabien Sanglard <sanglardf@google.com> Refactor SurfaceFlinger::onTransact

Reduce length of SurfaceFlinger::onTransact by moving credential
code to dedicated function.

Change-Id: I0fa30439443295b4a807e0eeae4f113d7b0534c4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9d96de49673cb6c916bfb797aad4f4e024ea73ca 11-Oct-2016 Fabien Sanglard <sanglardf@google.com> Revert "Delete HWC1"

This reverts commit 90f923493fa053655a203c34ea491086aeb07602.

Change-Id: If9da49e3bc85f8ff21ac1bd22a6bab97e9aa3103
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
90f923493fa053655a203c34ea491086aeb07602 03-Oct-2016 Fabien Sanglard <sanglardf@google.com> Delete HWC1

After 10 years of good service, HWC1 is not needed anymore since HWC2
is now mandatory.

Change-Id: I5768b50c89854688ba31032f01ea231699393e5b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
22851c3ba2cf5ccb0c3a0aa6c5b94ae123a5616a 09-Aug-2016 Dan Stoza <stoza@google.com> SF: Fix a couple of Layer ref count issues

This is an attempt at fixing two reference counting issues for Layers.

The first issue is that since we were holding an sp<IBinder> (really a
reference to a LayerCleaner) inside the layer state for deferred
transactions, there was a possibility that it could end up being the
last strong reference to the LayerCleaner such that when it was
destroyed while applying a non-deferred transaction, it would attempt
to grab the SurfaceFlinger main lock to destroy its Layer. Since this
occurred in the main SurfaceFlinger loop, which was already holding
the lock to process transactions, this would cause a deadlock.

To fix this, the sp<IBinder> inside the layer state was changed to a
wp<IBinder>, only being promoted when it actually needs to be accessed
(i.e., when the deferred transaction is created).

The second issue is that we were promoting and holding a strong
reference to a Layer before calling into SurfaceFlinger to destroy it
on the onLayerDestroyed path (triggered when a LayerCleaner is
destroyed). After returning from the attempt to grab the SurfaceFlinger
main lock, it was possible that this strong reference was the last one
keeping the Layer alive, and destroying it at this point could cause
the HWC2 version of the layer to be destroyed at effectively any point,
even between validate/present.

To fix this, the promotion of the weak Layer reference was moved inside
the critical section where the SurfaceFlinger main lock is held.

Bug: 30503916
Bug: 30281222
Change-Id: I1c6a271f9a7b5d6eea9a9db61d971f262d0cfe84
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ffc9efc4b55df38ac524f20cdd1a2fca8e259fae 28-Jul-2016 Irvel <irvel@google.com> Add display tracing to SurfaceInterceptor

Change-Id: Iaae5a840ca7dca7a9a70dde1ccab0fa3944cd863
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8cf150a0341768133b37cd9c6f2369bf6f79a943 02-Aug-2016 Dan Stoza <stoza@google.com> SF: Add property to disable HWC virtual displays

Adds the property debug.sf.disable_hwc_vds, which will disable the use
of Hardware Composer virtual displays inside SurfaceFlinger (falling
back to SurfaceFlinger management and client composition of such
displays).

Also adds a Binder debug interface for controlling this behavior.

Bug: 30510632
Change-Id: I2c1a199213a24195b144bfa0c0f1679f2dfd0668
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ae56a32be71278b77e82fe56bcfbdc9589f7e1dc 10-Aug-2016 Dan Stoza <stoza@google.com> Revert "SF: Fix a couple of Layer ref count issues"

This reverts commit 92cd24e5f648175944deef5899258981807a9ca4.

Change-Id: I551c292d8151d39bd34f2667eda384273f7cfd87
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
dd03e70fd620a7a305c1a271583e0da07d6c1ac4 10-Aug-2016 Dan Stoza <stoza@google.com> SF: Fix a couple of Layer ref count issues am: 92cd24e5f6 am: 56e16bb1ca
am: 263910d00a

Change-Id: I76564ea2195d2de9aaf00ebd4c50db1d36dafeff
92cd24e5f648175944deef5899258981807a9ca4 09-Aug-2016 Dan Stoza <stoza@google.com> SF: Fix a couple of Layer ref count issues

This is an attempt at fixing two reference counting issues for Layers.

The first issue is that since we were holding an sp<IBinder> (really a
reference to a LayerCleaner) inside the layer state for deferred
transactions, there was a possibility that it could end up being the
last strong reference to the LayerCleaner such that when it was
destroyed while applying a non-deferred transaction, it would attempt
to grab the SurfaceFlinger main lock to destroy its Layer. Since this
occurred in the main SurfaceFlinger loop, which was already holding
the lock to process transactions, this would cause a deadlock.

To fix this, the sp<IBinder> inside the layer state was changed to a
wp<IBinder>, only being promoted when it actually needs to be accessed
(i.e., when the deferred transaction is created).

The second issue is that we were promoting and holding a strong
reference to a Layer before calling into SurfaceFlinger to destroy it
on the onLayerDestroyed path (triggered when a LayerCleaner is
destroyed). After returning from the attempt to grab the SurfaceFlinger
main lock, it was possible that this strong reference was the last one
keeping the Layer alive, and destroying it at this point could cause
the HWC2 version of the layer to be destroyed at effectively any point,
even between validate/present.

To fix this, the promotion of the weak Layer reference was moved inside
the critical section where the SurfaceFlinger main lock is held.

Bug: 30503916
Bug: 30281222
Change-Id: I1c6a271f9a7b5d6eea9a9db61d971f262d0cfe84
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c1ba5c4649554e744844b07cfe402b42fbe12ff3 08-Jun-2016 Sahil Dhanju <sahildhanju@google.com> Multithreaded Surface Replayer that replays traces

Change-Id: Id8d17f74e00d4796e1ea266bdaf9e8dd0af6475b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
468051e20be19130572231266db306396a56402b 14-Jun-2016 Irvel <irvel@google.com> Integrate SurfaceInterceptor into SurfaceFlinger

Change-Id: If18d967f2b69ed219f17a9afedb61884ad5f1dc8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d16f6ae2bd1083ee29717829a39e93908bba2bf5 21-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HWC2: Add properties to revert latching changes" into nyc-mr1-dev
c5da271eec001da9e11a2786f2618a45257439c3 21-Jul-2016 Dan Stoza <stoza@google.com> HWC2: Add properties to revert latching changes

Adds two properties:

debug.sf.latch_unsignaled - This causes SurfaceFlinger to latch
buffers even if their fences haven't signaled
debug.sf.disable_backpressure - This causes SurfaceFlinger to skip
propagating backpressure back to apps by not running when it
detects that a prior composition missed hardware vsync

Bug: 30216498
Change-Id: Idd70f472ec567a4bc03352f30f201f434cf5d660
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/SurfaceFlinger.h
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/SurfaceFlinger.h
05dacfb68af895fce3cc8ebb0b4aa06c6c336e26 01-Jul-2016 Dan Stoza <stoza@google.com> HWC2: Backpressure missed vsyncs into apps

Adds a mechanism to detect whether the prior frame SurfaceFlinger
presented to hardware composer was actually picked up or not. We then
use this mechanism to avoid pushing two frames in the same vsync.
This backpressure is passed back to applications by not latching any
buffers, which will manifest as dequeueBuffer stalling until
SurfaceFlinger releases a buffer on the following vsync.

Also makes the former INVALIDATE_ON_VSYNC behavior the only behavior
so that this functionality works correctly.

Bug: 29413700
Change-Id: Ibde358e45423ee6fea7b5e09ff65e49c4ad67baa
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ce796e78a57018f186b062199c75d94545318aca 05-Feb-2016 Pablo Ceballos <pceballos@google.com> Plumbing for getting FenceTracker timestamps

Change-Id: I1ebee9e42e28658bd3a2b161fdaabb7da756d8f3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
e77c7669bee30b7c0099172cf0c38cef92412040 13-May-2016 Dan Stoza <stoza@google.com> BufferQueue/SF: Add OccupancyTracker

Adds an OccupancyTracker to BufferQueue. This module keeps track of
how many buffers are in the queue over time, which, in combination
with various aggregation of these statistics, allows SurfaceFlinger
to report what fraction of the time a given layer was double- or
triple-buffered.

Change-Id: Ida6e967dc5483c00a633e9fe03998e420dd88502
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6328134d8f3969e5cf345bec84b2c6455afc6a34 19-Apr-2016 Tim Murray <timmurray@google.com> Merge "Revert "Revert "DispSync: Always resync after inactivity""" into nyc-dev
4a4e4a239f034cb8af2df9a438b26c3bc088889c 19-Apr-2016 Tim Murray <timmurray@google.com> Revert "Revert "DispSync: Always resync after inactivity""

This reverts commit 67264e930992e43ef3351b04692d4ca59cbb01ad.

We've fixed the kernel issues this exposed.

bug 28198793

Change-Id: Ie895cc0a815094cce4bee3b2bf45800ee1e2fdc3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ccf8058396c3ac8d1e296b9c0ba5f6317cc90661 15-Apr-2016 Tim Murray <timmurray@google.com> Merge "Revert "DispSync: Always resync after inactivity"" into nyc-dev
67264e930992e43ef3351b04692d4ca59cbb01ad 14-Apr-2016 Dan Stoza <stoza@google.com> Revert "DispSync: Always resync after inactivity"

This reverts commit f34b9be610ce286af224364cb6e69ef6f7697ee9.
Bug: 28160740

Change-Id: I48a5bd66712651b42fdc0aaf1492899d7b032977
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
7e5e1287276efba71cceec75c495c21ecec4f147 11-Apr-2016 Dan Stoza <stoza@google.com> Merge "DispSync: Always resync after inactivity" into nyc-dev
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f34b9be610ce286af224364cb6e69ef6f7697ee9 06-Apr-2016 Dan Stoza <stoza@google.com> DispSync: Always resync after inactivity

Changes DispSync to enable hardware vsync immediately when new frames
arrive after a period of inactivity.

No matter how hard we try, we can't avoid drifting over time without
being able to detect error based on display retire fences. By enabling
hardware vsync immediately, we avoid having a weird period or phase
offset relative to hardware while we retrain the model. Once the model
has locked, we turn hardware vsync back off to save power (until we
detect drift again).

Bug: 26255070
Change-Id: If4dd17c2d541015c730f47d824359d7cb4b52c3c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b5b3563058c178811d434ab6e8c4ead4a519701b 23-Feb-2016 Pablo Ceballos <pceballos@google.com> SF: check secure layers in screenshot message handler

- Instead of checking for the presence of secure layers on the Binder
thread, check in the message handler. Transactions may have occurred
in between when the check is done and when the screen shot message
is handled.

Bug 23757877

Change-Id: Iec74193996ca72c60f86f7c0f0b2a5dea8d19543
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
29370d3bd744209a5cd6cb6384139486c3405f75 06-Aug-2015 Pablo Ceballos <pceballos@google.com> Merge "libgui/SF: Fix some code warnings"
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
14cd37cf3d7d783eaeb4cfb5f1f9e712d3b49578 09-Jul-2015 Dan Stoza <stoza@google.com> SF: Track missed frames and optionally drop them

Adds code to track whether SurfaceFlinger has sent two frames to HWC in
the same vsync window. This can occur if one frame is delayed so far
it slips into the next window or just if one frame takes an abnormal
amount of time. If this occurs, it shows up as FrameMissed in systrace.

Also adds a property debug.sf.drop_missed_frames which, if set, tells
SurfaceFlinger to skip sending a frame to HWC (i.e., calling
prepare/set) when we detect this condition, which can help prevent
backpressure from the HWC implementation.

Bug: 22513558
Change-Id: I2df0d44cec5fd6edba419388d8c90b5710d1a5b6
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f7a862a1d6f103519d41c2c0d4aef8aa4289ac3f 01-May-2015 Dan Stoza <stoza@google.com> am 6dbfc87d: am 32d4b6c8: Merge "SurfaceFlinger: Limit to 4k Layers"

* commit '6dbfc87da5b07547b7ce7a0218fef3a90d23a6c4':
SurfaceFlinger: Limit to 4k Layers
7d89d06a6fe1bfadfe277f19dbb7e4aa021444e0 30-Apr-2015 Dan Stoza <stoza@google.com> SurfaceFlinger: Limit to 4k Layers

Sets a limit of 4k Layers which SurfaceFlinger will allow to be in
existence at any given time. An attempt to create Layers in excess of
this limit will fail with NO_MEMORY.

Bug: 20674586
Change-Id: I2dfaf59643d826f982b2fa44e8a9ed643176d972
(cherry picked from commit e7f8dde3f3c398c1ea1bec14e76725a760f71d31)
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
e7f8dde3f3c398c1ea1bec14e76725a760f71d31 30-Apr-2015 Dan Stoza <stoza@google.com> SurfaceFlinger: Limit to 4k Layers

Sets a limit of 4k Layers which SurfaceFlinger will allow to be in
existence at any given time. An attempt to create Layers in excess of
this limit will fail with NO_MEMORY.

Bug: 20674586
Change-Id: I2dfaf59643d826f982b2fa44e8a9ed643176d972
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
91dea34652ff891192148b4062a80c2e8f0852ce 15-Apr-2015 Dan Stoza <stoza@google.com> am 19f06de0: am 40b2a8b4: am e7d20eb0: Merge "SurfaceFlinger: Pass surface damage to HWC"

* commit '19f06de0930e0f741ed113c37faf306fceee39bd':
SurfaceFlinger: Pass surface damage to HWC
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b90cf07f8b3a8fe76e40b997924c2509d04575f4 05-Mar-2015 Dan Stoza <stoza@google.com> SurfaceFlinger: Add --static-screen stats

Adds a --static-screen option to dumpsys SurfaceFlinger, which
displays screen-on time broken down by the time between the prior
frame and the current frame. An example dump looks like this:

$ adb shell dumpsys SurfaceFlinger --static-screen
Static screen stats:
< 1 frames: 12.235 s (3.5%)
< 2 frames: 29.898 s (8.7%)
< 3 frames: 15.370 s (4.4%)
< 4 frames: 13.103 s (3.8%)
< 5 frames: 15.780 s (4.6%)
< 6 frames: 2.022 s (0.6%)
< 7 frames: 0.201 s (0.1%)
7+ frames: 256.887 s (74.4%)

The buckets are exclusive, so '< 3 frames' covers the interval
[2, 3) frames

Bug: 19543586
Change-Id: I3253a54c23995d25e96016997acedd0775956b60
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6b9454d1fee0347711af1746642aa7820b1ea04d 08-Nov-2014 Dan Stoza <stoza@google.com> SurfaceFlinger: Do less work when using PTS

Currently, SurfaceFlinger is very dumb about how it handles buffer
updates at less than 60fps. If there is a new frame pending, but its
timestamp says not to present it until later SurfaceFlinger will wake
up every vsync until it is time to present it. Even worse, if
SurfaceFlinger has woken up but nothing has changed, it still goes
through the entire composition process.

This change (mostly) fixes that inefficiency. SurfaceFlinger will
still wake up every refresh period while there is a new frame
pending, but if there is no work to do, it will almost immediately go
back to sleep.

Bug: 18111837
Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3f121fc650d72d0103cef8e6a651093fb1589e0a 01-Oct-2014 Michael Lentine <mlentine@google.com> When eglMakeCurrent fails we need to fix the egl state.

Bug: 16676660

Change-Id: Ie7bee9c78378b9e9206060444319e6ee35e1ab74
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
67d8bd66aaf04805cb8f2616ba964141b865e3b9 11-Sep-2014 Lajos Molnar <lajos@google.com> surfaceflinger: add getDisplayStats() method

This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.

Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c3ebe66b49cfba035e1fd0e160a13db38eb81b0e 05-Sep-2014 Riley Andrews <riandrews@google.com> Add rotation to surfaceflingers screen cap.

+ This is needed so that activity manager does not
have to do cpu side rotations when capturing recents
thumbnails.

Change-Id: If998008e675ad01305db8399fd643cf4608b7025
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1f6078aef71b1d3f080cd565adbec350c71088dd 27-Jun-2014 Michael Wright <michaelwr@google.com> Have VirtualDisplays send SF resize messages when resizing

Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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)
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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>
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c18790018be5d7ea7061ccbc81f3044e74adc823 23-May-2014 Dan Stoza <stoza@google.com> SurfaceFlinger: Add sourceCrop to screenshot

Adds a sourceCrop Rect parameter to screenshot commands, which allows
clients to capture only a portion of the screen instead of the whole
screen.

Bug: 15137922
Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d85084b2b65828442eafaff9b811e9b6c9ca9fad 20-Mar-2014 Svetoslav <svetoslavganov@google.com> Adding render stats APIs to UiAutomation (framework native).

bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b9b088375d33a87b201cdbe18be71802e2607717 13-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
29fa9590ad32d918cb32cc88898ec53d28e1ad5a 17-Mar-2014 Wonsik Kim <wonsik@google.com> Revert "Implement video plane layer"

This reverts commit f837c93a1b392dbc4f7099d0c4fb723e32ca438e.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f837c93a1b392dbc4f7099d0c4fb723e32ca438e 24-Feb-2014 Wonsik Kim <wonsik@google.com> Implement video plane layer

Binding with video source will follow.

Change-Id: Ic14e9757f5b61f4055cbeda47c1bafae0a621abb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c701401f8cec2e5309f8b57e2b97baced5093274 15-Feb-2014 Dan Stoza <stoza@google.com> Allow disabling layer rotation during screenshots

Add the ability to ignore layers' transformation matrices during
screenshot capture, which will allow the window manager to capture
unrotated images for recents during the device rotation animation.

Bug: 11805195
Change-Id: I854d87bc84ca06ef9a054a454af1c080ee66fbb8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
10ca42cbdc75c6a36d0b72dadbe845d990e31e95 03-Jan-2014 Jesse Hall <jessehall@google.com> am 4c37d088: am 6c7dcfa9: am 662d3134: Merge "Move EGLConfig selection to RenderEngine"

* commit '4c37d0886ca06c290e205cad2798406361bbbf53':
Move EGLConfig selection to RenderEngine
05f8c703d4a050669ff8f406be3a9dc2357935f7 24-Dec-2013 Jesse Hall <jessehall@google.com> Move EGLConfig selection to RenderEngine

Bug: 12230666
Change-Id: I8d1111a7e0fd9d9e2525e6a80da8ce46d7dd085d
Signed-off-by: Jesse Hall <jessehall@google.com>
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cd65a2c51e2f0d7756274fad0ad2c2fe698d2229 16-Oct-2013 Jamie Gennis <jgennis@google.com> am bbfbe93c: am 0a645cc5: SurfaceFlinger: give SF its own vsync phase

* commit 'bbfbe93c0d2d6c7818e23219d2925f02ddf5bd92':
SurfaceFlinger: give SF its own vsync phase
5727fc08ba39bb53e9191447e1b3144ea244ae0e 16-Oct-2013 Jamie Gennis <jgennis@google.com> am 47c772e8: am d1700756: SurfaceFlinger: Add EventControlThread

* commit '47c772e8ec28eb0a3df9c8edd252f292c7c8e152':
SurfaceFlinger: Add EventControlThread
c6694b4cb4829164cd490869c557103f310fd761 16-Oct-2013 Jesse Hall <jessehall@google.com> resolved conflicts for merge of e94d204a to master

Change-Id: Idb2030dbb25a2e4b972492587558b25a305e68bd
0a645cc5a935e67a8d1effc7679a838160b971d8 15-Oct-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: give SF its own vsync phase

This change allows SurfaceFlinger to run at a different vsync phase offset from
that used by external listeners.

Bug: 11175503
Change-Id: I561c53a5659fa6dc1e3e4ae30340f3c1a6adceb4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d1700756ec9520c3fba22f9a14fd064a6e288810 14-Oct-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Add EventControlThread

This change adds a new thread for calling HWComposer's eventControl
asynchronously. The DispSync-based vsync approach ends up enabling and
disabling HWComposer's vsync callbacks at arbitrary times, and some HWComposer
implementations do not have these calls optimized.

Bug: 11175503
Change-Id: I719be82bd200b391c61d40863b991c7b59acdfd6
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
948fe0ce74c13e1bbff233883c158519fa8fb293 14-Oct-2013 Jesse Hall <jessehall@google.com> Disable hardware vsync when blanking the screen

Bug: 11220224
Change-Id: I99d0a42e1a6bb0aaf89706f6d100e9ef2a5deaa4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0c6fd94c13402ef56010cc2f122768bf9bf35dd9 02-Oct-2013 Jesse Hall <jessehall@google.com> am 92d7c3ee: am b65f32eb: Fix two EGLConfig selection bugs

* commit '92d7c3ee03109cf2d465a103b828b7d7d3ee9848':
Fix two EGLConfig selection bugs
b65f32ebe2c86869b07ac1c986660dfb2187b7d3 28-Sep-2013 Jesse Hall <jessehall@google.com> Fix two EGLConfig selection bugs

This fixes two bugs introduced by
Change-Id: Ia8cc084c02a0e3de910def024da8a08d02bbd89d

(a) There is no invalid EGLConfig value, in particular zero is valid.
Checking return values of eglGetConfigs and eglChooseConfig is the
only way to determine success.
(b) The "simple" EGLConfig query used as the emulator fallback should
not include EGL_RECORDABLE; the emulator doesn't have it.

Bug: 10935622
Change-Id: Ib798a24e7cf06a679811c46eaa45d39174a715ec
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1c479c56da44c8942ab3d858ebcc19e4a6f76786 20-Sep-2013 Mathias Agopian <mathias@google.com> am 754bad45: am d555684c: reinstate black-screenshot debugging code

* commit '754bad4534e9a2de8b4e3ecbe097993c71246f91':
reinstate black-screenshot debugging code
4d5755389d111eb58ba5bdade84a39614dd222ed 20-Sep-2013 Mathias Agopian <mathias@google.com> am f589dd29: am e2a3e872: Merge "Fix GLES context version selection" into klp-dev

* commit 'f589dd2915587994d3dd36eff2191962fe0b71c0':
Fix GLES context version selection
d555684cb36dfb959694db76962e570184f98838 20-Sep-2013 Mathias Agopian <mathias@google.com> reinstate black-screenshot debugging code

turned off by default.

Bug: 10809349
Change-Id: I3e6b8c7860e6b0e122b8f07de4020967cd1f005c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2185f8b420ee1b150f761893a9c47cffff645cde 19-Sep-2013 Mathias Agopian <mathias@google.com> Fix GLES context version selection

Explicitly selects an ES 2.0 config first, then an ES 1.x config,
before attempting the fallback path for the emulator.

Bug: 10820214
Change-Id: Ia8cc084c02a0e3de910def024da8a08d02bbd89d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9c5a3335110769993d3fe997bdf1d594954d4304 13-Sep-2013 Alan Viverette <alanv@google.com> Add API for pushing color transforms to SurfaceFlinger

BUG: 9057596
Change-Id: Iea0953366eac875b7968897a75472c25a137edb5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ff2ed70fa30f04b90dd1a2c06ec2319e157152d7 02-Sep-2013 Mathias Agopian <mathias@google.com> color blindness enhancement

This is an attempt at improving the experience of
users with color vision impairement.

At this time this feature can only be enabled for
debugging:

adb shell service call SurfaceFlinger 1014 i32 PARAM

with PARAM:
0 : disabled
1 : protanomaly/protanopia simulation
2 : deuteranomaly/deuteranopia simulation
3 : tritanopia/tritanomaly simulation
11, 12, 13: same as above w/ attempted correction/enhancement

The enhancement algorithm tries to spread the "error"
such that tones that would otherwise appear similar can be
distinguished.

Bug: 9465644

Change-Id: I860f7eed0cb81f54ef9cf24ad78155b6395ade48
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4f4f0943489d9113c66ac22b58cfba8c21dfa879 20-Aug-2013 Mathias Agopian <mathias@google.com> SurfaceFlinger now runs in the process's main thread

it used to spawn its own thread and return the main thread
to the binder thread pool -- this was confusing the naming
of things in the kernel.

Bug: 10331839

Change-Id: I2d13a6d73409a38109300fcbe6a04b4c41cb5d00
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9e663de4fe1dcc872373ee530c60a375624671c3 16-Aug-2013 Jesse Hall <jessehall@google.com> Use new HWC display type/count constants.

Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3f84483382be2d528918cc1a6fbc6a7d68e0b181 08-Aug-2013 Mathias Agopian <mathias@google.com> SurfaceFlinger now uses GLES 2.x when available

Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6c913be9ca95fd6b556d056e165a4ba6dc69795b 08-Aug-2013 Jesse Hall <jessehall@google.com> Add ISurfaceComposer::destroyDisplay

Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3ca76f416bc8665a97636ca8a2d0128b9da9d92c 07-Aug-2013 Mathias Agopian <mathias@google.com> remove support for glReadPixels screenshot path

this was only needed on some chipset we're not
supporting in KLP.

Change-Id: I2e8fc07f135030bd61d2e241a8e426f1a4316425
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6547ff4327aa320fbc9635668d3fc66db7dd78f6 17-Jul-2013 Jamie Gennis <jgennis@google.com> surfaceflinger: add frame duration logging

Change-Id: Ib414a45e7e191f23a2726cbbbeb606e9ce68a3b5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
547e98f33c829eb2e3948a57e491a9106afa1f5e 09-Jul-2013 Mathias Agopian <mathias@google.com> Merge "Refactor SF. Move all GL operations in their own class."
fee2b463c5fbe8fa0132d03634ccc02ea55c1505 03-Jul-2013 Mathias Agopian <mathias@google.com> Debug code for detecting all black pixels screenshots

Bug: 9120292
Change-Id: If60db32524db973bb1f905ba3cb415c2a1cd7e71
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
875d8e1323536e16dcfc90c9674d7ad32116a69a 08-Jun-2013 Mathias Agopian <mathias@google.com> Refactor SF. Move all GL operations in their own class.

this is the first step to add support for GLES 2.x, this
change breaks the dependency of SF on GLES 1.x by moving
all operation into their own class.

Bug: 8679321

Change-Id: I0d2741eca2cefe67dfd9cf837cac10c4d126928b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
29c3f352797d9d2ddf055d8f888e7694ef8b3947 22-May-2013 Jesse Hall <jessehall@google.com> Prevent opaque windows from making framebuffer translucent

To keep the code readable now that we have four different texenv
configurations, this change separates the decisions about what
configuration to use from the GL calls to set up the configuration.

Bug: 8963244
Change-Id: Ia07a306a7809ba8f93493d0160ccbd509e948581
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b6df7d0e4c2117ca476662bd52b6745b3d8a305f 09-May-2013 Mathias Agopian <mathias@google.com> make all libsurfaceflinger and libsensorservice symbols's visibility hidden

we only export the main entry-point.
this saves about 150KB.

Change-Id: I55eb2b6705386fdfa43860deb62f9cdd2a0982aa
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0aea53ff3f71f9f8df55d1cf58fd586442582643 24-Apr-2013 Mathias Agopian <mathias@google.com> use a Framebuffer Object to render all screenshots

this allows us to render into a buffer with a
pixelformat of our own choice; this is much faster
on all platform.

Bug: 8582615
Change-Id: I61298fc8e43fa6f92044c5123955cb5c7897dab7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
180f10de6f504d2ba56ff32ae8ed53c58bb458e9 11-Apr-2013 Mathias Agopian <mathias@google.com> Improve screenshot performance on some devices (DO NOT MERGE)

this affects devices that need a glReadPixels(). We use
a FBO instead of a GlConsumer as an intermediate render target, this
saves 2 calls to eglMakeCurrent().

On Galaxy Nexus this allows us to go from ~135ms to ~35ms for
recent's screenshots.

Bug: 8582615
Change-Id: I6b25291ecc235f1927579bbb2db3c731e985c6e8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
48bc05b56df9919fc39c5f2e3ea6535560eec98f 21-Mar-2013 Jesse Hall <jessehall@google.com> Fix dump when virtual display exists

SurfaceFlinger::getLayerSortedByZForHwcDisplay only worked for builtin
displays.

Bug: 8384764
Change-Id: I989275407fb2f06d166a6e70321c3211e27e562e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ed985574148a938bc3af24442eead313cc62521c 22-Mar-2013 Mathias Agopian <mathias@google.com> make sure screenshot are in a format supported by Bitmap.java

Change-Id: I0fb9cc4088f9c1fd27e6c017b0a7c5617adb4660
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b4b1730abb7824dc084468c4942f010d94a7e039 21-Mar-2013 Mathias Agopian <mathias@google.com> only use glReadPixels() when needed when taking screenshots

some drivers don't support this yet, so we use a system
property to enable the glReadPixels "workaround" for them:

ro.bq.gpu_to_cpu_unsupported=1

Change-Id: I74d6a3a8f0cee8d5a507b72c760cf247e39195e0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
abe815dd6978b718c04f6e22e1a893d2b51d11a1 20-Mar-2013 Mathias Agopian <mathias@google.com> rework how we take screenshots for a CPU consumer

We're not using IMemoryHeap as a transport anymore,
instead we're providing a CpuConsumer and use the
IGraphicBufferProducer version of the screenshot API.

However, some GPU drivers don't support properly
a GPU to CPU path, to work around this, we use a
temporary BufferQueue on the server side for the
GL rendering, and we use glReadPixels into the
CpuConsumer (we're now using a CPU to CPU path
which is always supported).

Currently this "wrapping" is always performed,
but it can be bypassed on devices that support
the GPU to CPU path.

This also addresses a DoS attack vector on
SurfaceFlinger, where an application could
consume all of SF's filedescriptors by creating
a lot of screenshots in a row.

Bug: 8390553

Change-Id: I9e81514c2a7711b9bb393f74305be7d2abe08f1c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6710604286401d4205c27235a252dd0e5008cc08 15-Mar-2013 Mathias Agopian <mathias@google.com> get rid of purgatory and fix QueuesToWindowComposer query

the purgatory list wasn't needed anymore; in fact it had no effect as
buffer life-time management is now handled by the BufferQueue.

For QueuesToWindowComposer we keep a list of wp<> on the IBinder
for IGraphicBufferProducers we hand over to clients so we can
easily check if an IGraphicBufferProducer is ours. We clean-up the
list when our IGraphicBufferProducer are destroyed.

Bug: 8349142
Change-Id: I1aa06652ade8c72d0004a3f5e6c3d6e8a82fc2ae
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6 13-Mar-2013 Mathias Agopian <mathias@google.com> get rid of ISurface

ISurface was only used to get the IGraphicBufferProducer from
a Layer. It's now replaced by a BBinder subclass / IBinder and
is only used as a handle to the surface, to both refer to it
and manage its life-time.

Also cleaned-up a bit the ISurfaceComposer interface and
"create layer" code path.

Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b79f61d41ef053bee1087ec612896c59f95f9686 06-Mar-2013 Mathias Agopian <mathias@google.com> fold LayerBaseClient into LayerBase

Change-Id: Ic745136522df59c42f0885fd969e75ea55d09f01
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
089a15298e045598bf15fd2a46284c34dd56384c 05-Mar-2013 Mathias Agopian <mathias@google.com> Remove support for ScreenshotLayer

Change-Id: I5b571a4cf3faa77d2c4aca916fa4bd00a1065bb9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2a9fc493dfdba67108e4335bb1fe931bc1e2a025 01-Mar-2013 Mathias Agopian <mathias@google.com> rework screenshot API and implementation

- SurfaceFlinger now supports to take a screenshot
directly into an IGraphicBufferProducer

- reimplement the IMemoryHeap screenshot on top
of the above

- reimplement LayerScreenshot such that its
BufferQueue is directly used as the destination
of the screenshot. LayerScreenshot is now a thin
wrapper around Layer

Bug: 6940974

Change-Id: I69a2096b44b91acbb99eba16f83a9c78d94e0d10
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
e3c697fb929c856b59fa56a8e05a2a7eba187c3d 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ac9fa427d4a86745e60a5f7fd8e3ea340c4db907 12-Feb-2013 Mathias Agopian <mathias@google.com> get rid of Surface identity and token

we use the IBinder instead.

Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4b0eba949cc026ffb2c75313042d8a7bcb3fcf86 05-Feb-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add win anim frame time tracking

This change makes the 'dumpsys SurfaceFlinger --latency' command with no extra
args dump the frame timestamp data for the most recent frames that
SurfaceFlinger generated that included window animation transaction changes.

Change-Id: I8bded1ea08a4cddefef0aa955401052bb9107c90
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
692c723e84e6f2747447d871d468ff50e5c73f19 09-Nov-2012 Jesse Hall <jessehall@google.com> Create builtin display tokens on demand

For hotpluggable builtin displays (currently just HDMI), create the
display device IBinder token when the display is connected and destroy
it when the display is disconnected. Previously we created the tokens
at startup and never changed them. This made it so that when comparing
current and drawing state, we couldn't tell whether a display had been
disconnected and reconnected.

Bug: 7491120
Change-Id: I23b77037dc0f548d549abf580339edd0e3c626e9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
dd3cb84cfbe8068790c6233b5829fae9c4a0ee93 20-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add support for secure displays

This change adds support for displays that are not allowed to display surfaces
with the eSecure flag set. All non-virtual displays are considered secure,
while virtual displays have their secure-ness specified at creation time.

Bug: 7368436
Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
db9b41fd157279d1b988a854e0d7c5b43c2fac38 16-Oct-2012 Mathias Agopian <mathias@google.com> fix a corruption in blank/unblank

we were holding a reference (ie: pointer) to a sp<DisplayDevice>
while processing the message. Meanwhile the object itself could
go away and we would end up accessing a dead object.

the root cause of the problem is that we are accessing mDisplays[]
in a few places outside of the main thread.

Bug: 7352770
Change-Id: I89e35dd85fb30e9a6383eca9a0bbc7028363876c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2d5e230292c27d59f4c096bc742a0a19abf811c1 16-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add animation transactions

This change adds a transaction flag for WindowManager to indicate that a
transaction is being used to animate windows around the screen. SurfaceFlinger
will not allow more than one of these transactions to be outstanding at a time
to prevent the animation "frames" from being dropped.

Bug: 7353840
Change-Id: I6488a6e0e1ed13d27356d2203c9dc766dc6b1759
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cb55857bbde34a06c19dde3db5064d1717a0173e 05-Oct-2012 Mathias Agopian <mathias@google.com> fix dumpsys Layer name when using multiple displays

Bug: 7288401
Change-Id: I14beeef58fac5270cef3b611e18c163060efe6c3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
722b98f9dfe8f04de8734630198b99a6cd024118 26-Sep-2012 Mathias Agopian <mathias@google.com> add support for EGL_FRAMEBUFFER_TARGET_ANDROID

we now try first with EGL_FRAMEBUFFER_TARGET_ANDROID, and
pick the first config we find. Otherwise, we revert to
the old algorithm.

Bug: 7232584

Change-Id: I8d5c5a4ce48420832c2e2828718a8f53325effb0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4803b74e2a12a508f7bbfde6f6a962fe3299c61c 25-Sep-2012 Andy McFadden <fadden@android.com> Show build config in dumpsys SurfaceFlinger

This adds a line to the "dumpsys SurfaceFlinger" output that shows
build-time configuration values.

Example:
Build configuration: [sf HAS_CONTEXT_PRIORITY] [libui] \
[libgui USE_FENCE_SYNC]

Bug 7206633

Change-Id: Ibe1856b459d34a4be6ee83a4ebfd2807e6cc68a0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
148994e5f33ce240ff24ceb5bc0500b7f2001959 20-Sep-2012 Mathias Agopian <mathias@google.com> We now report hotplug events to the framework

Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8dfa92fef9759a881e96ee58d59875d35023aab9 18-Sep-2012 Andy McFadden <fadden@android.com> Plumb display name into SurfaceFlinger

The Surface createDisplay() call takes a display name for debugging.
This change carries it through SurfaceFlinger and displays it in
the "dumpsys SurfaceFlinger" output.

Bug 7058158

Change-Id: I79f3474a8656ff1beb7b478e0dbf2c5de666118a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ce3a0a541c3dde1330551bd7a048cd9d92335c00 13-Sep-2012 Mathias Agopian <mathias@google.com> don't call hwc with non-empty layer lists for blanked displays

we now make sure to take the blanked state of a display into
account when we build its list of visible layers, this ensures
that we won't call prepare/set with a non-empty list when the
display is blanked.

Possibly fixes 7075380, 7103553, 7130187, 7016215

Bug: 7075380
Change-Id: I9fdd2e73d1b7621eaeca3d4ac2ae60d9fb1b3631
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
da8d0a5c0cf9d41915d3b106cad4aaec3e767c11 05-Sep-2012 Mathias Agopian <mathias@google.com> implement display viewport and frame

note: viewport clipping is not implemented yet

Change-Id: I7fde7c4de075d409d95c48bb20ba8ee017f6f00a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
63f165fd6b86d04be94d4023e845e98560504a96 31-Aug-2012 Keun young Park <keunyoung@google.com> add libsurfaceflinger_ddmconnection for PDK build

- the library is dlopened from libsurfaceflinger
- the library built only when libnativehelper exists

Bug: 7089510
Change-Id: Ib3ea1029d7e8f6e055f4b759d0bf68f5123fa8a1
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
55801e41e6d7306d75d8134dd69d7d8cbbfbc63c 28-Aug-2012 Mathias Agopian <mathias@google.com> we were not always clearing the screen properly

Change-Id: I269dd866e965aebd9b3c4667095818202982f4a3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2a 28-Aug-2012 Mathias Agopian <mathias@google.com> Eradicate DisplayID.

DisplayDevices are now keyed of the wp<IBinder> the client uses.
DisplayID has now become DisplayType which is just used to identify
physical displays (as opposed to virtual displays such as wifi displays).

Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9d4e3d2f42e93e2d12bacabe97d307d30c3c20dd 25-Aug-2012 Jeff Brown <jeffbrown@google.com> Banish DisplayID from the SurfaceFlinger API.

Use only display tokens in the API to refer to new displays.

Don't require the caller to specify the display when creating
a surface (since in general a surface could be shown on
any display).

This is intended to be a minimum change just to update the API.
Note that SurfaceFlinger still uses DisplayID in a few places
internally that might cause some features not to work properly
when there are multiple displays (LayerScreenshot, for example).

Change-Id: I3d91eec2da406eefd97bcd53655d403ad865a7e6
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0bceb84773882b796d9dacbaf96167cb15928d78 24-Aug-2012 Jamie Gennis <jgennis@google.com> surfaceflinger: fix display id selection

This change fixes display ID selection so that it never chooses negative
numbers as display IDs.

Change-Id: I5af1acc7b1270b371595e096b18e2a6ad250c7ba
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9b6a395e65ff88ab79fe92d6f112c434441ca606 24-Aug-2012 Andy McFadden <fadden@android.com> Revert "Added display initialization method"

Something doesn't seem right (again).

This reverts commit 53ade0853ca003c9e917b5e7d34e1b1338d7b87d.

Change-Id: Id5786997ca9dd2a447363e8ac95213ea37468504
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
53ade0853ca003c9e917b5e7d34e1b1338d7b87d 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

(This reverts an earlier revert.)
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f1bf89dd88f3926faaec77b9322b2a580691960d 22-Aug-2012 Ramanan Rajeswaran <ramanan@google.com> Revert "Added display initialization method"

This reverts commit 3f3956236aac97b6aa25fa89f0983d5e9d065fdb

Change-Id: Ia2a15d9a5db88add6019edf9d955cef1f73d432d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3f3956236aac97b6aa25fa89f0983d5e9d065fdb 21-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: Idaa0d0b98ebb331a17d1b16774c6b05bfa1e8728
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cd60f99aba9e750700a967db30b74a29145739cf 17-Aug-2012 Mathias Agopian <mathias@google.com> refactor compositing code to avoid multiple eglMakeCurrent() calls

when multiple displays are connected, we ended-up having to
call eglMakeCurrent() twice per display due to a limitation
in EGL. this fixes that.

Change-Id: I11e4584df50f8c24bbecee74e37b28b3ee031d2f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
e57f292595bec48f65c8088b00ff6beea01217e9 10-Aug-2012 Mathias Agopian <mathias@google.com> make multi-display more real

- displays are represented by a binder on the client side
- c++ clients can now create and modify displays

Change-Id: I203ea5b4beae0819d742ec5171c27568f4e8354b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4297734c1156fd8ede7e9c61b1e439f9e1c18cd9 05-Aug-2012 Mathias Agopian <mathias@google.com> turn DisplayDevice into a reference-counted object

it's safer this way because this object owns an
EGLSurface which cannot be easily reference-counted.

it also gives us the ability to sub-class it, which
we might want to do soon.

Change-Id: I07358bb052dc5a13b4f2196b2c2b6e6e94c4bb4f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
92efd84f37ce5a8aae74dc9086f825a67b6894e9 03-Aug-2012 Mathias Agopian <mathias@google.com> screen-off animation won't be handled by SF anymore

Change-Id: Idc41386804ae7d7eb981c36e1bc55c270870c8d0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
92a979a92c34b7de609ce2b1662c73bb8a2728b9 03-Aug-2012 Mathias Agopian <mathias@google.com> We now have a real list of displays.

displays can be dynamically added or removed, and the
list is part of the SF's transaction.

Change-Id: I4186ea39f1317c0e7c044f869004017738968fab
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0f2f5ff75b7b48ceb64270655ee6b62d09bf4d00 01-Aug-2012 Mathias Agopian <mathias@google.com> rename DisplayHardware to DisplayDevice

Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
52bbb1ae239c8a4d05543a23fa8c08467d09c3b2 01-Aug-2012 Mathias Agopian <mathias@google.com> getting closer to final main composition loop

Change-Id: Icd63782366ffd11d9ea00c925ae5783ed7440cdb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
87baae104a3e4c2059990b01c393476065c558b0 31-Jul-2012 Mathias Agopian <mathias@google.com> get rid of global regions that should be tracked per display

Change-Id: I3b871860cc29f1b2fdcc22b0c577a6eae65d9296
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c666cae2d5995097ec49a87e375e2afdd92802b7 26-Jul-2012 Mathias Agopian <mathias@google.com> get rid of the shared-memory control block

Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8b33f032327f8de0dcc0e6d0d43ed80f834b51f6 25-Jul-2012 Mathias Agopian <mathias@google.com> update SF binder protocol to support setting display attributes

no change of functionality -- the old behavior is implemented
on top of this new protocol.
this new protocol will allow, eventually, to pass informations
about displays and layer stacks.

Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a49126087b4494f4ef50873f3a3f6727265f6621 12-Jul-2012 Mathias Agopian <mathias@google.com> factor EGL/GL and surface creation out of DisplayHardware

Change-Id: Icd85a6a4caad06f056578008af3e21666fa8b1f4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3b1d2b6b2bbfb5df46b1059ec52360974e6f1428 11-Jul-2012 Mathias Agopian <mathias@google.com> mVisibleLayersSortedByZ is now maintained per display

Change-Id: Idcdb77eba1a3f99b3e4b2150128a82acaffcd2a8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4fec873a98f7b4380720cd1ad006f74c8cdc73da 29-Jun-2012 Mathias Agopian <mathias@google.com> one more step towards multiple display support

- remove dependency on cached state in validateVisibility
- get rid of mVertices and mTransformedBounds
- get rid of validateVisibility
- get rid of unlockPageFlip
- handleTransaction now returns a dirty region
- computevisibileregion now uses window-manager space
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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.
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
aa049f0d19684cf92f2f6510133a33138845dcd3 20-Jun-2012 Mathias Agopian <mathias@google.com> am 8aaf3e47: am a67e418e: Exit boot animation cleanly.

* commit '8aaf3e47a51aa0beebecc8c536504d310d07cda9':
Exit boot animation cleanly.
a67e418e1fda219f6cc0a7e420bcf5cc4f9fe710 20-Jun-2012 Mathias Agopian <mathias@google.com> Exit boot animation cleanly.

The desc.txt file can now mark parts as 'must finish cleanly' by using
'c' as the part line prefix rather than 'p'. If so indicated, if the
bootanimation is asked to quit it will do so only after waiting to
finish that part.

I considered either making init.c service killing smarter or promoting
bootanim to be a bindable service with a requestExit method. However,
these changes are probably too big/risky given our ship date. So
I used a property as a mailbox between SurfaceFlinger and bootanim.

Bug: 6679877
Change-Id: Id7dca22caa50b450fff25ca94f7242d971034f41
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
db403e8ff0d7727015e1a5009bab20eb7ec205bc 19-Jun-2012 Mathias Agopian <mathias@google.com> split-up Client.h out of SurfaceFlinger.h

Change-Id: I1993bf23e417163749d886283563a93d50b361b4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b9494d5c9d44e4a59b6d510fea1665de434f3c6b 18-Apr-2012 Mathias Agopian <mathias@google.com> make sure to clear the framebuffer when using overlays

Bug: 6354761, 6353719
Change-Id: I0739de3fee7c54c14b294ffd768b70ee1f541d9e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b60314a12f3336b27d73920805ab07cbc498d857 11-Apr-2012 Mathias Agopian <mathias@google.com> rework screen on/off code

Change-Id: I13f71e850592a588bbd4805b1830c503bd4decb4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cb9732a951d20cacb7ebe2dab132b5738226b1b6 04-Apr-2012 Mathias Agopian <mathias@google.com> refactor / simplify EventThread

Change-Id: I3981c6fba93b7b985174b2a7045e24db2c0b4428
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
90ac799241f077a7b7e6c1875fd933864c8dd2a7 26-Feb-2012 Mathias Agopian <mathias@google.com> fix libgui header location

Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
99ce5cdeb383216dee95af4d90e47406b0948ea1 01-Feb-2012 Mathias Agopian <mathias@google.com> separate transactions from updates

with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ad8d13c8858b33e3efef42086875c0b0836d2296 30-Jan-2012 Mathias Agopian <mathias@google.com> remove unneeded code

Change-Id: I07e2fca7274d2e12bf5b4aee0050794bdb97a8b3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
25e66fc324bbc004fa8902b2d4699e41bb601104 29-Jan-2012 Mathias Agopian <mathias@google.com> added a few more commands to SF's dumpsys

--latency-clear [name]
clears the latency data for the specified layer or for
all layers if none is specified

--list
prints the list of all layers regardless of their visibility

Change-Id: I7c07ae020f838c173b98ee50f3fb3e93da78acbb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
55ef343331f5efbfe3e01bc9993d94faea236048 07-Jan-2012 Mathias Agopian <mathias@google.com> remove dead/usnused code

Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
99ed22412db547c59d3da08114d9d5a586442b30 15-Dec-2011 Glenn Kasten <gkasten@google.com> Use the standard CC_LIKELY and CC_UNLIKELY macros

Several source files privately defined macros LIKELY and UNLIKELY in terms
of __builtin_expect. But <cutils/compiler.h> already has CC_LIKELY and
CC_UNLIKELY which are intended for this purpose. So rename the private
uses to use the standard names.

In addition, AudioFlinger was relying on the macro expanding to extra ( ).

Change-Id: I2494e087a0c0cac0ac998335f5e9c8ad02955873
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
478ae5eb5a0047e1b2988c896cff6363b455ee50 07-Dec-2011 Mathias Agopian <mathias@google.com> Improve the VSYNC api a bit.

- add the ability to set the vsync delivery rate, when the rate is
set to N>1 (ie: receive every N vsync), SF process' is woken up for
all of vsync, but clients only see the every N events.

- add the concept of one-shot vsync events, with a call-back
to request the next one. currently the call-back is a binder IPC.

Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
43bfe7f047668a5b74fefb8cfecbf070f637201b 03-Dec-2011 Jesse Hall <jessehall@google.com> am a91e54fe: am f57c1388: Merge "SurfaceFlinger: fix layer removal race condition" into ics-mr1

* commit 'a91e54fed6a0690d59c97bab9b081b2614880563':
SurfaceFlinger: fix layer removal race condition
2f4b68d21c1a58cbcb1e6929fb241e425a8f7b5d 02-Dec-2011 Jesse Hall <jessehall@google.com> SurfaceFlinger: fix layer removal race condition

Layer::lockPageFlip() and layer::onRemove() could be called on
different threads and race such that lockPageFlip() successfully
called mSurfaceTexture->updateTexImage() but then gets NULL back from
mSurfaceTexture->getCurrentBuffer(), leading to a crash.

This change moves Layer::onRemove() calls to
SurfaceFlinger::commitTransaction() so they happen after the Layer is
done being drawn from and only happen on the main surfaceflinger
thread.

Change-Id: I4b550caadff4cc1878d7c3bca6129193fb0c713e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4a9ac37fe26644bb5253d15eec08be2edb896642 01-Nov-2011 Mathias Agopian <mathias@google.com> Fix rotation displays frame N-1 briefly while rotating

The ScreenShot layer is now created hidden. The screenshot itself
is aquired during the transaction when the layer is made visible.
This guarantees the screenshot and the layer happen atomically
with respect to screen updates.

Bug: 5534521
Change-Id: Ida23e1f13d5716ec83b78a15712e0646d6cf8729
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
51726c381e23d148867c760d06306dfa940b4d15 22-Oct-2011 Mathias Agopian <mathias@google.com> am aa938c8d: Merge "mDirtyRegion is single threaded, but could be accessed from a hwc thread" into ics-mr0

* commit 'aa938c8d9c0e71c9b556657cb33794210ce6ebf8':
mDirtyRegion is single threaded, but could be accessed from a hwc thread
0dfb7b73a468698622d6c0423f0d5471a6f5d375 22-Oct-2011 Mathias Agopian <mathias@google.com> mDirtyRegion is single threaded, but could be accessed from a hwc thread

We now have mInvalidateRegion which holds the region to invalidate, it
can be set from any thread as long as mInvalidateLock is held. We use
fine-grained locking here because mInvalidateRegion can be set from anywhere,
in particular frmo HWC callbacks.

Bug: 5466774
Change-Id: Iafca20aa3f5b25a87755e65bde7b769aa8f997bc
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
818fb243572f8e1f408ba9fc35ef61bbedbd9ce1 19-Oct-2011 Dave Burke <daveburke@google.com> am 70ac412b: Merge "Add a LayerScreenshot" into ics-mr0

* commit '70ac412b2fe7be2507189a9fdfb30c43b36d56ac':
Add a LayerScreenshot
118d0245ee0a3b107055782aa8b555404b6f0280 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Make sure to call compositionComplete() after rendering into a FBO.

Bug: 5446982, 5467587, 5466259
Change-Id: I5d8a1b4c327f9973d950cd4f4c0bca7f62825cd4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cdec8f01aae14ed59fbc57cb2ce97a6602f4b9a1 17-Oct-2011 Mathias Agopian <mathias@google.com> am 840b8a67: Revert "Add a LayerScreenshot"

* commit '840b8a678537519c27ddf2f818494eaa20a135d4':
Revert "Add a LayerScreenshot"
090cb44b945bfe2711344a5331814bd6412ab437 17-Oct-2011 Elliott Hughes <enh@google.com> Merge branch 'master' of ssh://android-git:29418/platform/frameworks/base
e9800c83114988b6f8cc25bb9d508ebb322f9903 17-Oct-2011 Mathias Agopian <mathias@google.com> Revert "Add a LayerScreenshot"

This reverts commit d6809f40cf61203573ec5dbc437f695cd132cc18.
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a402c4c9913cfbc6c3da21719c57a93a11f091f0 15-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Remove display freezing code

This change removes the dead code from SurfaceFlinger that resulted from
disabling support for freezing the display.

Change-Id: I4e5ff00c94b4c7a79af2f65c9850c135210068ed
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
28378392fd5aa3e0a392c9eb64634055678c3987 13-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: make sync transactions explicit

This change enables a layer or orientation update transaction sent to
SurfaceFlinger to explicitly request a synchronous transaction.

Change-Id: I97cbba610c13679849f66114b216fa6dbf12f2a9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f171ab6da9cf9793093e50947aacdab8f2b0c9b2 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Bug: 5446982
Change-Id: I7814aff2380e7e146937f2b641907be2a30c76cc
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b8d69a55f1c187a35ac41e69de63251f5501b6f4 11-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: update orientation via transactions

This change merges the ISurfaceComposer::setOrientation functionality
into ISurfaceComposer::setTransactionState. It enables the window
manager to atomically update both the display orientation and the
position and size of the windows in a single transaction with
SurfaceFlinger.

Bug: 5439574
Change-Id: I18a8ccc564d7d760ef8afb2d015ccdb7a7963900
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9575f60722f7a4f54384fe0be6938a8de48dc23a 07-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: screenshots w/ protected buffers

This change modifies SurfaceFlinger's screenshot behavior when a layer
with a protected buffer is visible. The previous behavior was to simply
fail the screenshot. The new behavior is to render the screenshot using
a placeholder texture where the protected buffer would have been.

Change-Id: I5e50cb2f3b31b2ea81cfe291c9b4a42e9ee71874
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
21230c6410bdab13cd2bd274da54b1e4061b6035 21-Sep-2011 Jeff Brown <jeffbrown@google.com> Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager. Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out. For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes. The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise. We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened. We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0656a68380d01de4136933901b2c322cf9ab0d7e 21-Sep-2011 Mathias Agopian <mathias@google.com> rename mInvalidRegion to mSwapRegion

Change-Id: I946cbc782c0c84645843ea44c3d8b04a0a2fe658
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f9abeb956fb95682d77005ea0dc506a805f52a04 09-Sep-2011 Mathias Agopian <mathias@google.com> Fix another problem with refreshing the screen when switching to/from overlay

the previous fix was incorrect. See comment in setupHardwareComposer for
full explanations.

Change-Id: Ib24a9af000b8f95cf7319f9272d34997064ceb6d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f384cc3008a25ad1b00403aca0cc001547f029c6 09-Sep-2011 Mathias Agopian <mathias@google.com> Fix an issue is SF that caused drawing artifacts when hwc changed mode

we were not redrawing and/or clearing the FB properly when
hwc moved a layer from/to FB to/from OVERLAY.

In these cases we needed to expand the dirty region to include
the layer that changed mode.

Also split composeSurfaces() which was becoming quite large.

Change-Id: Id6fa1acfc4ff694037fddf7efd037a4405732073
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a45836466c301d49d8df286b5317dfa99cb83b70 24-Aug-2011 Mathias Agopian <mathias@google.com> Add a debug option to turn the "transformation hint" off

transformation hint is disabled with:

adb shell service call SurfaceFlinger 1009 i32 1

Change-Id: I9aafe6f280f88ce41569ed69a06dc522b10e3a88
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
53331da007b56e0cb4201728de99c8c29bcfaa9a 23-Aug-2011 Mathias Agopian <mathias@google.com> fix "show screen update" debug option.

Change-Id: I7d8b24124768b5f7d59d3bb0b019e9baaa0dfc4f
NOTE: from now on, this also disable the h/w composer
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
582270d69db94286a248bd829f1ae6f910d45124 18-Aug-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix queues-to-composer

This change fixes the NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER query of
Surface and SurfaceTextureClient. Surface now uses the inherited
SurfaceTextureClient implementation of this query. SurfaceTextureClient
now queries SurfaceFlinger to determine whether buffers that are queued
to its ISurfaceTexture will be sent to SurfaceFlinger (as opposed to
some other process).

Change-Id: Iff187e72f30d454229f07f896b438198978270a8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8afb7e39a83a3e31170612d562eb08508e328388 16-Aug-2011 Mathias Agopian <mathias@google.com> as a debug option SrufaceFlinger can now connect to DDMS

this is disabled by default. To enable:
setprop debug.sf.ddms 1

this debug option requires to restart SurfaceFlinger

Change-Id: Ic2f8050b29911b55bcd21721648b6978700c277d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
47d0812977b7acc4fed6a823203770a57f7a6b78 12-Aug-2011 Mathias Agopian <mathias@google.com> SurfaceFlinger doesn't rely on having a custom RefBase destructor

we just use a message to the main thread to
destroy our GLES state.
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
7e918860f9d496bf0c4b7e1649216c9209c57850 06-Jul-2011 Mathias Agopian <mathias@google.com> Merge "don't kill surfaceflinger when system process dies"
1f339ff3875afad128a8e16ee6395c5fad295826 02-Jul-2011 Mathias Agopian <mathias@google.com> don't kill surfaceflinger when system process dies

Change-Id: I2d3ed87b590f9ccea3fa4af41d92911de070b315
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d9e8c64c3dce1612eb948a5c16ba4ff62202b423 01-Jul-2011 Mathias Agopian <mathias@google.com> return an error code with gralloc buffer allocation failures

Change-Id: I471e5d37ea7a42fc8a0f93446ee3b4229da37807
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
698c0873cf2e07bdc7fd1e72169aee2a19fa40d7 29-Jun-2011 Mathias Agopian <mathias@google.com> SF transactions are now O(1) wrt IPC instead of O(N).

Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
99b49840d309727678b77403d6cc9f920111623f 28-Jun-2011 Mathias Agopian <mathias@google.com> PermissionCache caches permission checks

This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.

CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.

Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a67932fe6864ac346e7f78b86df11cf6c5344137 20-Apr-2011 Mathias Agopian <mathias@google.com> unify SurfaceTexture and Surface

Add the concept of synchronous dequeueBuffer in SurfaceTexture
Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Add SurfaceTexture logging
fix onFrameAvailable
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ca4d3602c07837d0b2ac6878685a8e327b5f30f0 20-May-2011 Mathias Agopian <mathias@google.com> Fix a race that could cause GL commands to be executed from the wrong thread.

Change-Id: Ia3d407f7bf2f5553f46cfdade70b7b0badb35beb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
dea20b1f343012d58ca9eb381684b26a168dc127 04-May-2011 Mathias Agopian <mathias@google.com> Fix a race in SurfaceFlinger that could cause layers to be leaked forever.

The transaction flags were atomically read-and-cleared to determine if
a transaction was needed, in the later case, mStateLock was taken to
keep the current state still during the transaction. This left a small
window open, where a layer could be removed after the transaction flags
were checked but before the transaction was started holding the lock.
In that situation eTraversalNeeded would be set but only seen during the
next transaction cycle; however, because we're handling this transaction
(because of another flag) it will be commited, "loosing" the information
about the layer being removed -- so when the next transaction cycle due
to eTraversalNeeded starts, it won't notice that layers have been removed
and won't populated the ditchedLayers array.

Change-Id: Iedea9e25fee8dd98a0c5bd5ad41a20fcadf75b47
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4f113740180b6512b43723c4728f262882dc9b45 04-May-2011 Mathias Agopian <mathias@google.com> Fix a race-condtion in SurfaceFlinger that could lead to a crash.

Client::mLayers could be accessed from different threads.
On one side from Client::attachLayer() which is currently
called from a binder thread; on the other side from
Client::detachLayer() which is always called from the main
thread.

This could lead to a corruption of Client::mLayers.

We fix this issue by adding an internal lock to Client.

Change-Id: Ib1317d7750ed5030e6f577efe34b69fc10198bd3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0ef4e15a6c12778daf464a4953d7e15e651f49ac 20-Apr-2011 Mathias Agopian <mathias@google.com> Get rid of the "pid" parameter from createSurface

Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4cb18881b55b82a24873ccd8e298bc2d5a9c17e5 09-Apr-2011 Mathias Agopian <mathias@google.com> Fix a GraphicBuffer leak in SurfaceTexture

This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.

In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.

this allows the public facing API to not expose the previous hack.

Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1bbafb96101de04c43adb5e3ca2494070d20a46a 12-Mar-2011 Mathias Agopian <mathias@google.com> Fix some const-ness and comments

mDrawingState doesn't need to be accessed by the
mStateLock, because by definition it's only accessed
from the main thread.

Similarily, the list of layers in the drawing state
cannot change (ie: is const).

Change-Id: I2e5da7f4d8caee7af7802b432cd45cc81c7c08b0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
134f0422866e8985188ed10dfbdcb8e6c34b87f7 08-Mar-2011 Jamie Gennis <jgennis@google.com> ANativeWindow: add queues-to-window-composer check.

This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.

Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2bd1d95efecffad447afd682ffe605bbf8c79d62 20-Jan-2011 Mathias Agopian <mathias@google.com> clean-up unneeded code

now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.

Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0d3dcc4aab864e4e4086b070c08949d369239f22 15-Jan-2011 Mathias Agopian <mathias@google.com> Merge "partially fix [3306150] HTML5 video with H/W acceleration blackout" into honeycomb
76cd4ddc6ad664257739b3d3713fd9ebdc9a4ad9 15-Jan-2011 Mathias Agopian <mathias@google.com> partially fix [3306150] HTML5 video with H/W acceleration blackout

We used to guarantee that a layer in SurfaceFlinger would never be
destroyed before all references (to its ISurface) on the client
side would be released. At some point, this guarantee got
relaxed to allow to free gralloc resources sooner. This last
change was incorrect, because:
- in implementations with reference-counting the gralloc resources
wouldn't be released anyways, until all the mapping were gone
- in implementations without ref counting, the client side
would most likely crash or do something bad
- it also caused the SharedBufferStack slot to be reallocated
to another surface, which could be problematic if the client
continued to use the surface after the window manager destroyed it.

So, we essentially reinstate the guarantee that layers won't be
destroyed until after all references to their ISurface are
released.

NOTE: This doesn't entirely fix 3306150 because there is another
problem there where the Browser continues to use a surface after it
has been destroyed.

Change-Id: I305c830dd722b30a6d53cbf3a9c714fd3cf7eb06
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a49576f06b73893fd957d974382390a47b44589e 14-Jan-2011 Mathias Agopian <mathias@google.com> Merge "fix [3312683] Camera mirroring problem after switching from back to front camera" into honeycomb
ad456f9878ff7c176499e7b992f9ff1cb3e9cdee 14-Jan-2011 Mathias Agopian <mathias@google.com> fix [3312683] Camera mirroring problem after switching from back to front camera

the crop as well as buffer orientation can change at every frame, when that happens
we need to reset the hwc HAL (ie: set the GEOMETRY_CHANGED flag).
currently we achieve this by taking the same code path than an actual geometry change
which is a bit more heavy than necessary.

Change-Id: I751f9ed1eeec0c27db7df2e77d5d17c6bcc17a24
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9a78c90cd46b2a3bd637b056873149d3b94384b4 13-Jan-2011 Jamie Gennis <jgennis@google.com> Fix remote GraphicBuffer allocation in SurfaceFlinger.

This change fixes a horrible hack that I did to allow application
processes to create GraphicBuffer objects by making a binder call to
SurfaceFlinger. This change introduces a new binder interface
specifically for doing this, and does it in such a way that
SurfaceFlinger will maintain a reference to the buffers until the app is
done with them.

Change-Id: Icb240397c6c206d7f69124c1497a829f051cb49b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
495633406580685dfaa41979bbae47fc5f77fefe 20-Dec-2010 Jamie Gennis <jgennis@google.com> Add the ISurfaceComposer::createGraphicBuffer IPC.

This change adds a new binder method to the ISurfaceComposer interface.
This IPC is intended to allow SurfaceFlinger clients to allocate gralloc
buffers using SurfaceFlinger as a proxy to gralloc.

Change-Id: Ide9fc283aec5da6268ba62cfed0c3319a50b640d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
bf2c6a6c8f1df40ac94e28b948754bb9739daaca 11-Dec-2010 Mathias Agopian <mathias@google.com> [3258939] Need snapshot to limit which layers are included

Change-Id: Id7351a0e3f53dde99b291cffba553d89fd4d7ca9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1293a8eb567fd63c072a6970fa9dcf37d076059f 09-Dec-2010 Mathias Agopian <mathias@google.com> More clean-up. Get rid off the "blur" effect in SurfaceFlinger

For multiple reason, this effect is not maintainable and was never
used due to its abysmal performance. it'll be resurected when it can be
implemented efficiently.

Change-Id: Id4222c9b86c629275cdec18873ef07be8723b6d2
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
fb3051b15e15b0f57196e0f2bc6ba8570f7ffe5e 16-Oct-2010 Mathias Agopian <mathias@google.com> am 7e9a54d4: am d4e03f37: addresses parts of 3096779 and 3097475

Merge commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8'

* commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8':
addresses parts of 3096779 and 3097475
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
abd671a08a41519a7ab3d438a500efe0ef0bfc1d 14-Oct-2010 Mathias Agopian <mathias@google.com> addresses parts of 3096779 and 3097475

3097475: Animation setting should control the screen on animation
3096779: CRT power-on animation can briefly show the top app instead of lockscreen

There is now a parameter that controls wether the ON and/or OFF animation are
performed. we also always clear the screen to black on power off, to make
sure it won't briefly appear on power on.
HOWEVER, 3096779 is not 100% fixed in the case where we're doing the animation
because there is a race, where SF doesn't wait (b/c it doesn't know) for the
framework to have redrawn the lockscreen.

Change-Id: Ie0f02c9225fcdf24b1e8907e268eb7da2c5b0a03
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
59119e658a12279e8fff508f8773843de2d90917 11-Oct-2010 Mathias Agopian <mathias@google.com> turn off the electron beam

Change-Id: I335fb6719f1d5a3f1c6f37a046fd1c2c4ed2bbc6
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
df85c455c34a920d22a8e3f7459a1cc615efcd27 29-Sep-2010 Mathias Agopian <mathias@google.com> refactored screenshot code

the core screenshot function now can capture the screen at any lower resolution
performing bilinear filtering.

we also now have some client code to interface with the screenshot service.

it's now possible to request a screenshot at a lower resolution.

Change-Id: I33689bba98507ab928d0898b21596d0d2fe4b953
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
74c40c0a273dbfd7d10617c4cc1b0c066bfc812e 29-Sep-2010 Mathias Agopian <mathias@google.com> refactored screenshot code

the core screenshot function now can capture the screen at any lower resolution
performing bilinear filtering.

we also now have some client code to interface with the screenshot service.

it's now possible to request a screenshot at a lower resolution.

Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a3aefeb1c31618dcc897da22d2d2f741104e3fe3 25-Sep-2010 Mathias Agopian <mathias@google.com> am 495ad4f2: am beabe75a: Merge changes I1f7c4535,I741c68a2 into gingerbread

Merge commit '495ad4f22096aa172d025c16c25497e7dad8f2bd'

* commit '495ad4f22096aa172d025c16c25497e7dad8f2bd':
simple test app for screen capture API
add support for [1974164] Be able to take a screen shot on the device
1b0b30d04304392748a8a4ab5a69e52a19f51b3a 24-Sep-2010 Mathias Agopian <mathias@google.com> add support for [1974164] Be able to take a screen shot on the device

screenshots are taken using ISurfaceComposer::captureScreen() which returns
the size of the screenshot and an IMemoryHeap containing the data.
screenshots have limitations:
- they will always fail if a secure window is up on screen
- require GL_OES_framebuffer_object extension
- in some situation, video planes won't been captured

Change-Id: I741c68a2d2984fb139039301c3349e6780e2cd58
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
73d3ba9e50be1014aa21ec4bbdc874be394accb4 23-Sep-2010 Mathias Agopian <mathias@google.com> add a way to toggle the h/w composer at runtime

to DISABLE the h/w composer:
adb shell service call SurfaceFlinger 1008 i32 1

to ENABLE the h/w composer:
adb shell service call SurfaceFlinger 1008 i32 0

the state is dumped in "dumpsys SurfaceFlinger"

Change-Id: I23e2242d42c6e3fd5261a83332dd900b189e38ce
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
000ca8fa9a1a92aa2f132ba41d11ece6d01cdadd 18-Aug-2010 Mathias Agopian <mathias@google.com> revert hwcomposer HAL changes. DO NOT MERGE.

This reverts commit:
94364b91a2894bf037b8beb027132fbb812e1434
f8e705dea48f77f1c2532fdbadd4997dd1851af0
b59beb5ca68d0228f60dda60d85e2d0226b33215
e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a350ff98692b3a50cad5cc93f9f83221242ca86a 11-Aug-2010 Mathias Agopian <mathias@google.com> call into hwcomposer HAL when present

Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f6679fc6f70939643901f29a9a69e40c603e6e5f 11-Aug-2010 Mathias Agopian <mathias@google.com> get rid of our LayerVector implementation

we now use SortedVector<> with a special compare implementation.

Change-Id: I910459cf3b3c8993b55ad0786a8c348369262de5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4da751999358fffa4cefc4c8046dab72045925f6 11-Aug-2010 Mathias Agopian <mathias@google.com> keep a list of visible sorted surfaces

Change-Id: Ib815eeff894f8a3b1e79fbbf8186d5d91bb60285
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a1e6bc864fb821c1b470b7aad9b75c441f54eeb4 15-Jul-2010 Mathias Agopian <mathias@google.com> added BinderService<> template to help creating native binder services

Change-Id: Id980899d2647b56479f8a27c89eaa949f9209dfe
/frameworks/native/services/surfaceflinger/SurfaceFlinger.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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h