summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author baocheng sun <baocheng.sun@amlogic.com> 2021-05-13 18:51:28 +0800
committer Marin Shalamanov <shalamanov@google.com> 2021-05-18 12:07:33 +0200
commita663c2bc47eee5279345c6f40bbae3deee69579c (patch)
tree7cbd29c3466a2c362794db1798e0c730cb6410eb
parent5c234abdc306055436466acd8c9f6f1b78135741 (diff)
Update sideband stream when BufferStateLayer has receive a buffer
This CL updates the sideband when a frame is queued. Bug: 186383891 Test: b/186383891#comment10 Change-Id: I8d753ba47e06ca969606b0f8709990a097a8ad21
-rw-r--r--services/surfaceflinger/BufferStateLayer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp
index 24b35997b9..78756dfdf1 100644
--- a/services/surfaceflinger/BufferStateLayer.cpp
+++ b/services/surfaceflinger/BufferStateLayer.cpp
@@ -622,7 +622,10 @@ void BufferStateLayer::setAutoRefresh(bool autoRefresh) {
}
bool BufferStateLayer::latchSidebandStream(bool& recomputeVisibleRegions) {
- if (mSidebandStreamChanged.exchange(false)) {
+ // We need to update the sideband stream if the layer has both a buffer and a sideband stream.
+ const bool updateSidebandStream = hasFrameUpdate() && mSidebandStream.get();
+
+ if (mSidebandStreamChanged.exchange(false) || updateSidebandStream) {
const State& s(getDrawingState());
// mSidebandStreamChanged was true
mSidebandStream = s.sidebandStream;