diff options
| author | 2020-10-15 12:16:10 -0700 | |
|---|---|---|
| committer | 2020-10-15 12:16:10 -0700 | |
| commit | 7eb670ae5357ea9f609e1630759a57ea31537271 (patch) | |
| tree | a8dfffc179e7f75c9f1456382aa26be48e2bf29e /libs/gui/BLASTBufferQueue.cpp | |
| parent | b71253ecbc20334061e7ce7cadad5ab748a88810 (diff) | |
BlastBufferQueue: Add a function to flush the shadow queue
If the function is called, the next queue buffer will wait until the
the adapter processes the previously queued buffers.
Test: enable blast and test split screen resize
Change-Id: Ica9b3be9459dd174a7e80311abddb691976e83e3
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
| -rw-r--r-- | libs/gui/BLASTBufferQueue.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index 87f797200c..c3f045e868 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -254,8 +254,8 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { if (rejectBuffer(bufferItem)) { BQA_LOGE("rejecting buffer:configured size=%dx%d, buffer{size=%dx%d transform=%d}", mWidth, mHeight, buffer->getWidth(), buffer->getHeight(), bufferItem.mTransform); - mBufferItemConsumer->releaseBuffer(bufferItem, Fence::NO_FENCE); - return; + // TODO(b/168917217) temporarily don't reject buffers until we can synchronize buffer size + // changes from ViewRootImpl. } mNumAcquired++; @@ -307,13 +307,16 @@ void BLASTBufferQueue::onFrameAvailable(const BufferItem& /*item*/) { std::unique_lock _lock{mMutex}; const bool nextTransactionSet = mNextTransaction != nullptr; - BQA_LOGV("onFrameAvailable nextTransactionSet=%s", toString(nextTransactionSet)); + BQA_LOGV("onFrameAvailable nextTransactionSet=%s mFlushShadowQueue=%s", + toString(nextTransactionSet), toString(mFlushShadowQueue)); - if (nextTransactionSet) { + if (nextTransactionSet || mFlushShadowQueue) { while (mNumFrameAvailable > 0 || mNumAcquired == MAX_ACQUIRED_BUFFERS + 1) { + BQA_LOGV("waiting in onFrameAvailable..."); mCallbackCV.wait(_lock); } } + mFlushShadowQueue = false; // add to shadow queue mNumFrameAvailable++; processNextBufferLocked(true); |