summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author Chavi Weingarten <chaviw@google.com> 2023-08-04 13:11:39 +0000
committer Chavi Weingarten <chaviw@google.com> 2023-08-04 20:02:13 +0000
commitd48797b7c9fdf5d1d7dfc5b6d0ac89bffc116fad (patch)
treeda4f31f467533e63775b2250e6263027f92a7147 /libs/gui/BLASTBufferQueue.cpp
parent0ef7824f727964eb1097ab395aa4f4787c759cac (diff)
Remove check for new requested sync before flushing shadow queue
In transactionCommittedCallback, the code checks to make sure there are no sync transactions still in flight and checks if no new requested sync has come in before flushing shadow queue. The second check was intented to give onFrameAvailable a chance to drop these sandwiched frames. However, that can't happen because by the time onFrameAvailable is called, there is no sync in flight and it doesn't consider the frames sandwiched, but rather frames that were just submitted before the sync. Therefore, it's safe to just remove this check and attempt to flush the shadow queue. This fixes the ANR since it will ensure frames are flushed if possible by the time onFrameAvailable is called. If we have actually ran out of buffers, there's a guarantee that a release callback should occur, which will then flush the shadow queue at that point. Fixes: 293692258 Test: race condition hard to reproduce Change-Id: If3568c1db6b4063ee1b4044067d298e5c2c8b6f1
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 5c324b29cd..207fa4fd31 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -303,13 +303,8 @@ void BLASTBufferQueue::transactionCommittedCallback(nsecs_t /*latchTime*/,
// frame numbers that were in a sync. We remove the frame from mSyncedFrameNumbers
// set and then check if it's empty. If there are no more pending syncs, we can
// proceed with flushing the shadow queue.
- // We also want to check if mSyncTransaction is null because it's possible another
- // sync request came in while waiting, but it hasn't started processing yet. In that
- // case, we don't actually want to flush the frames in between since they will get
- // processed and merged with the sync transaction and released earlier than if they
- // were sent to SF
mSyncedFrameNumbers.erase(currFrameNumber);
- if (mSyncedFrameNumbers.empty() && mSyncTransaction == nullptr) {
+ if (mSyncedFrameNumbers.empty()) {
flushShadowQueue();
}
} else {