From ac70bc579028cdc00a2f14b77718080b26b93c7d Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Tue, 9 Jul 2024 17:11:28 -0500 Subject: Optimize BLAST buffer releases via Unix sockets Bug: 294133380 Flag: com.android.graphics.libgui.flags.buffer_release_channel Test: BLASTBufferQueueTest Change-Id: Ia183452198dadc7f8e540f7219bd44d8b5823458 --- libs/gui/SurfaceComposerClient.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 2821b510c3..5c87772587 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -2394,6 +2394,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBufferReleaseChannel( + const sp& sc, + const std::shared_ptr& channel) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + + s->what |= layer_state_t::eBufferReleaseChannelChanged; + s->bufferReleaseChannel = channel; + + registerSurfaceControlForCallback(sc); + return *this; +} + // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp& token) { -- cgit v1.2.3-59-g8ed1b