summaryrefslogtreecommitdiff
path: root/libs/gui/DisplayEventReceiver.cpp
AgeCommit message (Collapse)Author
2023-05-19Fix status log in getLatestVsyncEventData Rachel Lee
status.toString8 lists error code and message already formatted. Bug: 283421301 Test: ABTD Change-Id: Ica98e4d8a7c6aef39cc2223c458381a07341765d
2023-02-01Framework code for Attached Choreographer. Rachel Lee
Allows a direct association of a Layer (via LayerHistory) to attached choreographer. The EventThread checks whether the vsync is in phase for a choreographer. Bug: 255838011 Test: atest AttachedChoreographerNativeTest Change-Id: I9cb35bced5e6d4509609ad7698ab2902a31d5b98
2022-04-19Migrate bootFinished of ISurfaceComposer to AIDL Huihong Luo
And createDisplayEventConnection is migrated too. Bug: 221898546 Bug: 211009610 Test: atest libsurfaceflinger_unittest libgui_test SurfaceFlinger_test Change-Id: I2d0968262b86829b4cce13158446f1c85a4e55e4
2022-02-15Merge "Use VsyncEventData in DisplayEventReceiver::Event." Rachel Lee
2022-02-14Use VsyncEventData in DisplayEventReceiver::Event. Rachel Lee
Clean-up that re-uses VsyncEventData so it's easier to maintain. The ParcelableVsyncEventData is used in AIDL. It is separated from VsyncEventData because of the union in DisplayEventReceiver::Event and Parcelable has non-trivial constructors. Bug: 218563993 Test: atest ChoreographerNativeTest Test: atest libsurfaceflinger_unittest Test: atest libgui_test Change-Id: I3ebeb1c7826300c27c4a12d4dba6fbd16305e9e1
2022-02-10Merge "DisplayEventReceiver: improve error handling" Ady Abraham
2022-02-09DisplayEventReceiver: improve error handling Ady Abraham
Reset the state in case of a binder error and log the error. Bug: 213926330 Test: boot Change-Id: I1b926d08689d9d6e4b382ce18e4a5ecb9156e564
2022-02-07Add method to get current vsync from sf directly. Rachel Lee
Bug: 205721584 Test: atest libsurfaceflinger_unittest Test: atest DisplayEventReceiverTest Change-Id: I38d4bd20bc2f2ad7ff964c3d613c28919478c0fc
2021-11-23Migrate IDisplayEventConnection interface to AIDL Huihong Luo
This addresses security vulnerabilities due to hard coded binder interface. Bug: 195660647 Test: atest services/surfaceflinger/tests/unittests/SchedulerTest.cpp Change-Id: I948e97e37056286d54623ca6232580187b138e62
2020-11-18SurfaceFlinger: Add DISPLAY_EVENT_FRAME_RATE_OVERRIDE Ady Abraham
Add a new event to DisplayEventReceiver that conveys a list of apps whose frame rates have been overriden. This event is processed by the DisplayManager to advertise the new frame rate to the overridden app. Change-Id: I89fce8b5b4d9db65ec5db7dd2393c384c0fcfd82 Bug: 169271059 Bug: 169271062 Bug: 170503758 Test: manual test using SF backdoor
2020-08-07Fix refresh rate callback fan-out for choreographer Alec Mouri
* AChoreographer receives refresh rates from DisplayManager already, so there's no need to default-enable them - AChoreographer only needs to pump an event with the latest refresh rate to wake up looper. This also ensures that AChoreographer's callbacks are entirely in-sync with DisplayManager since there's no raciness. * Instead of re-requesting a config change from SF, instead inject it in AChoreographer correctly to save on binder. Bug: 154874011 Bug: 158680912 Bug: 161406626 Test: while [ true ]; do adb shell service call SurfaceFlinger 1035 i32 1; adb shell service call SurfaceFlinger 1035 i32 0; and repeatedly rotate the home screen with auto-rotate off. Change-Id: I66abc2e28e60f06987ce3a54be294c94b77524fc
2020-05-07Receive refresh rate callbacks from DMS Alec Mouri
AChoreographer will use DMS as the source of truth for these callbacks instead of SurfaceFlinger. Bug: 154874011 Test: ChoreographerNativeTest Tes: Manually verify that HWUI is processing refresh rate callbacks Change-Id: I961a7d1ab335800d3e260ba7564ddca9c0595cfc
2019-12-26[AChoreographer] Add refresh rate callback. Alec Mouri
This will augment the NDK to respond to display events where the display refresh rate changes. Consumers of this api will include: * HWUI, for implementing a policy for determining whether to use render-ahead, * Swappy, to potentially replace jumping into Java from native code to respond to display evnets there. * Any other native app that would rely on the up-to-date display refresh rate. Currently however this is not yet exposed to NDK as CTS is not yet written. Once CTS is written then this will be formally exposed to NDK. For now we'll leave these as APEX apis to represent incremental progress. Bug: 136262896 Test: builds Change-Id: I66d393f93eb5d681547411e330ef1b8950a35c5d
2019-06-05SurfaceFlinger: add explicit register for DISPLAY_EVENT_CONFIG_CHANGED Ady Abraham
When display refresh rate changes, SF fires DISPLAY_EVENT_CONFIG_CHANGED thru DisplayEventReceiver. If the other end of the pipe doesn't consume the events it may lead to pipe full and dropping of events. Furthermore, The only clients interested in this event in DisplayManager and hwui. To avoid spamming all clients with this event, this change is adding an explicit register for DISPLAY_EVENT_CONFIG_CHANGED events. Bug: 131688378 Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest Test: trigger config change and observe logcat Change-Id: I5973a1ecc1f3e3ff8d8a0cba19db0e49ef0d5341
2018-06-05Replace NULL/0 with nullptr Yi Kong
Fixes -Wzero-as-null-pointer-constant warning. clang-tidy -checks=modernize-use-nullptr -p compile_commands.json -fix ... Test: m Bug: 68236239 Change-Id: I3a8e982ba40f9b029bafef78437b146a878f56a9
2017-06-08Properly run window animations at vsync-sf (2/2) Jorim Jaggi
- 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
2017-04-06libgui: Remove RefBase from BitTube Dan Stoza
Removes RefBase from BitTube, since because it is not a Binder object, it doesn't need to be reference-counted in this way. In the process, we rename IDisplayEventConnection::getDataChannel to IDEC::stealReceiveChannel to make it clearer that this is a non-const operation on the remote end that removes its access to the receive channel. This also adds a couple of methods for moving the receive file descriptor out of one BitTube and into another, since this is the essence of the IDisplayEventConnection::stealReceiveChannel method, and now with C++11 move semantics, we can do this without needing to return an sp<> from EventThread's implementation of stealReceiveChannel. Test: m -j + manual testing Change-Id: Ibaaca2a14fb6155052fe5434c14bc3e671b43743
2017-04-06libgui: Format BitTube and move into gui namespace Dan Stoza
Reformats BitTube using the framework default .clang-format and moves it into the android::gui namespace. Test: m -j + manual testing Change-Id: I5ea748b809f37c2ec4dcfb41e7b84daf7a084368
2017-04-06libgui: Normalize IDisplayEventConnection methods Dan Stoza
This change modifies the IDisplayEventConnection API such that every synchronous method returns a status_t (to be able to return transport errors). This required changing getDataChannel to return its channel by output parameter rather than return type. Currently no more error messages are checked than before, but this will both enable calling code to check error messages if it desires and, more importantly, allow the Bp/Bn code to be semi-automatically generated using SafeInterface. Test: libgui_tests + manual testing Change-Id: I8d5bc5ef0475cee07b638a97079b234f0384c022
2017-03-07split libsensor our of libgui Mathias Agopian
Test: compile & run Bug: treble cleanup Change-Id: I5b2c2a14f7d3b364d25695cf0901c5b08cfb0fc9
2012-04-02use a socketpair instead of a pipe in BitTube Mathias Agopian
Bug: 6252830 Change-Id: Ia7a7b08409517214136261c05569dc5959a597ab
2012-02-27fix libgui header location Mathias Agopian
Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
2012-02-01separate transactions from updates Mathias Agopian
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
2012-01-08Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2011-12-06Improve the VSYNC api a bit. Mathias Agopian
- 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
2011-11-29Add support for sending VSYNC events to the framework Mathias Agopian
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