summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2021-09-15 15:20:53 -0500
committer chaviw <chaviw@google.com> 2021-09-30 12:36:14 -0500
commitba4320c070e62f3ef7aea27c04684f5b53c5707d (patch)
tree2e5a7597f0736c24c0de9f3559f1ffae8a049179 /libs/gui/BLASTBufferQueue.cpp
parent4eecba7daea5100d69bf8c2d3efbbba222dc8cf5 (diff)
Combine Buffer Properties when calling setBuffer
There are several properties, like releaseCallback, acquireFence, frameNumber, that are tied to the buffer being set. If a new buffer is set, all those properties should also be overwritten, rather than through a separate call. 1. Remove Transaction.setAcquireFence and Transaction.setFrameNumber and added them to the setBuffer as optional 2. Combine all the buffer info into a struct called BufferData that's sent to SF as one. This will also help with merging or overwriting buffer data since the callback, frameNumber, and acquireFence should also be updated. 3. Combine the functions in SF so there's no longer a separate call to BSL to set fence. Instead, send all buffer related data to BSL.setBuffer Test: SurfaceFlinger_test Fixes: 200065015 Change-Id: I53ad12dd105cd4cac6c3a7ecd48279d1b3cd2b8f
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 379b090c5b..cc209f39f5 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -468,12 +468,12 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) {
std::bind(releaseBufferCallbackThunk, wp<BLASTBufferQueue>(this) /* callbackContext */,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4);
- t->setBuffer(mSurfaceControl, buffer, releaseCallbackId, releaseBufferCallback);
+ sp<Fence> fence = bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE;
+ t->setBuffer(mSurfaceControl, buffer, fence, bufferItem.mFrameNumber, releaseCallbackId,
+ releaseBufferCallback);
t->setDataspace(mSurfaceControl, static_cast<ui::Dataspace>(bufferItem.mDataSpace));
t->setHdrMetadata(mSurfaceControl, bufferItem.mHdrMetadata);
t->setSurfaceDamageRegion(mSurfaceControl, bufferItem.mSurfaceDamage);
- t->setAcquireFence(mSurfaceControl,
- bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE);
t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this));
mSurfaceControlsWithPendingCallback.push(mSurfaceControl);
@@ -486,7 +486,6 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) {
if (!bufferItem.mIsAutoTimestamp) {
t->setDesiredPresentTime(bufferItem.mTimestamp);
}
- t->setFrameNumber(mSurfaceControl, bufferItem.mFrameNumber);
if (!mNextFrameTimelineInfoQueue.empty()) {
t->setFrameTimelineInfo(mNextFrameTimelineInfoQueue.front());