summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author Rob Carr <racarr@google.com> 2022-03-07 22:47:48 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-03-07 22:47:48 +0000
commit734be1c1cfcd2e314d5aceef127b0ee2054cf183 (patch)
treec08ea1b3a6149591e00d65bfdd60f2ec1eaa2a08 /libs/gui/BLASTBufferQueue.cpp
parent506d7d39f326646f98f11deb930966c2a4374611 (diff)
parent79dc06a39f4a31b65873271f22aecd91b37b75af (diff)
Merge "BLASTBufferQueue/SF: apply transactions with one-way binder" into tm-dev
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 8e23eb8766..ec4c7c10a4 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -182,7 +182,8 @@ BLASTBufferQueue::~BLASTBufferQueue() {
static_cast<uint32_t>(mPendingTransactions.size()));
SurfaceComposerClient::Transaction t;
mergePendingTransactions(&t, std::numeric_limits<uint64_t>::max() /* frameNumber */);
- t.setApplyToken(mApplyToken).apply();
+ // All transactions on our apply token are one-way. See comment on mAppliedLastTransaction
+ t.setApplyToken(mApplyToken).apply(false, true);
}
void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height,
@@ -230,7 +231,8 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width,
}
}
if (applyTransaction) {
- t.setApplyToken(mApplyToken).apply();
+ // All transactions on our apply token are one-way. See comment on mAppliedLastTransaction
+ t.setApplyToken(mApplyToken).apply(false, true);
}
}
@@ -551,7 +553,13 @@ void BLASTBufferQueue::acquireNextBufferLocked(
mergePendingTransactions(t, bufferItem.mFrameNumber);
if (applyTransaction) {
- t->setApplyToken(mApplyToken).apply();
+ // All transactions on our apply token are one-way. See comment on mAppliedLastTransaction
+ t->setApplyToken(mApplyToken).apply(false, true);
+ mAppliedLastTransaction = true;
+ mLastAppliedFrameNumber = bufferItem.mFrameNumber;
+ } else {
+ t->setBufferHasBarrier(mSurfaceControl, mLastAppliedFrameNumber);
+ mAppliedLastTransaction = false;
}
BQA_LOGV("acquireNextBufferLocked size=%dx%d mFrameNumber=%" PRIu64
@@ -857,7 +865,8 @@ void BLASTBufferQueue::applyPendingTransactions(uint64_t frameNumber) {
SurfaceComposerClient::Transaction t;
mergePendingTransactions(&t, frameNumber);
- t.setApplyToken(mApplyToken).apply();
+ // All transactions on our apply token are one-way. See comment on mAppliedLastTransaction
+ t.setApplyToken(mApplyToken).apply(false, true);
}
void BLASTBufferQueue::mergePendingTransactions(SurfaceComposerClient::Transaction* t,
@@ -1050,7 +1059,8 @@ void BLASTBufferQueue::abandon() {
static_cast<uint32_t>(mPendingTransactions.size()));
SurfaceComposerClient::Transaction t;
mergePendingTransactions(&t, std::numeric_limits<uint64_t>::max() /* frameNumber */);
- t.setApplyToken(mApplyToken).apply();
+ // All transactions on our apply token are one-way. See comment on mAppliedLastTransaction
+ t.setApplyToken(mApplyToken).apply(false, true);
}
// Clear sync states