From f693bcf2ee13391f99b8ede5562047981e1f5968 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Fri, 2 Aug 2024 09:55:23 -0500 Subject: Add BufferReleaseChannel BufferReleaseChannel will be used to communicate buffer releases from SurfaceFlinger to BLASTBufferQueue. Bug: 294133380 Flag: com.android.graphics.libgui.flags.buffer_release_channel Test: BufferReleaseChannelTest Change-Id: Ic38e8eefc96abc0b2bbe780115b7628413e8b829 --- 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 f663600f9e..b5d9366185 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -2390,6 +2390,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