From 0f4a1b19009a1e71ed2100b63b04aa015a111b44 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 4 Jun 2019 16:04:04 -0700 Subject: SurfaceFlinger: add explicit register for DISPLAY_EVENT_CONFIG_CHANGED 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 --- libs/gui/ISurfaceComposer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libs/gui/ISurfaceComposer.cpp') diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index 6c9d81ab57..e487792c87 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -278,8 +278,8 @@ public: return NO_ERROR; } - virtual sp createDisplayEventConnection(VsyncSource vsyncSource) - { + virtual sp createDisplayEventConnection(VsyncSource vsyncSource, + ConfigChanged configChanged) { Parcel data, reply; sp result; int err = data.writeInterfaceToken( @@ -288,6 +288,7 @@ public: return result; } data.writeInt32(static_cast(vsyncSource)); + data.writeInt32(static_cast(configChanged)); err = remote()->transact( BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION, data, &reply); @@ -1155,8 +1156,11 @@ status_t BnSurfaceComposer::onTransact( } case CREATE_DISPLAY_EVENT_CONNECTION: { CHECK_INTERFACE(ISurfaceComposer, data, reply); - sp connection(createDisplayEventConnection( - static_cast(data.readInt32()))); + auto vsyncSource = static_cast(data.readInt32()); + auto configChanged = static_cast(data.readInt32()); + + sp connection( + createDisplayEventConnection(vsyncSource, configChanged)); reply->writeStrongBinder(IInterface::asBinder(connection)); return NO_ERROR; } -- cgit v1.2.3-59-g8ed1b