diff options
| author | 2021-06-24 13:08:53 -0700 | |
|---|---|---|
| committer | 2021-06-24 13:09:54 -0700 | |
| commit | 2a52ca6274f3ca8b9aea8d22c49ca8fcae4b8455 (patch) | |
| tree | 1e9ee0f1e9999e41cd804f8f8a025b11acfc0a61 /libs/gui/BLASTBufferQueue.cpp | |
| parent | 504a4d8f648b6c2e0ed6971c9666a69dbdeedb45 (diff) | |
BlastBufferQueue: Fix acquire counts when holding buffers
Update the acquire count when ever we release a buffer otherwise
when going from 120hz to 60hz we may release multiple buffers
and only decrement the acquire count once. This will prevent the
adapter from acquiring all the possible buffers.
Also make sure we process the shadow queue every time we release
a buffer.
Bug: 188553729
Test: Run backpressure based game on 60Hz and 90hz and collect traces
Change-Id: I23517ee0fe840a9215f368bd85713ba19dbeb2a3
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
| -rw-r--r-- | libs/gui/BLASTBufferQueue.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index 364c939c18..e15e11cc20 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -151,7 +151,7 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceCont 1, false); static int32_t id = 0; auto consumerName = mName + "(BLAST Consumer)" + std::to_string(id); - mPendingBufferTrace = "PendingBuffer - " + mName + "BLAST#" + std::to_string(id); + mQueuedBufferTrace = "QueuedBuffer - " + mName + "BLAST#" + std::to_string(id); id++; mBufferItemConsumer->setName(String8(consumerName.c_str())); mBufferItemConsumer->setFrameAvailableListener(this); @@ -361,16 +361,15 @@ void BLASTBufferQueue::releaseBufferCallback(uint64_t graphicBufferId, graphicBufferId); return; } - + mNumAcquired--; mBufferItemConsumer->releaseBuffer(it->second, releaseBuffer.releaseFence); mSubmitted.erase(it); + processNextBufferLocked(false /* useNextTransaction */); } ATRACE_INT("PendingRelease", mPendingRelease.size()); - - mNumAcquired--; - ATRACE_INT(mPendingBufferTrace.c_str(), mNumFrameAvailable + mNumAcquired); - processNextBufferLocked(false /* useNextTransaction */); + ATRACE_INT(mQueuedBufferTrace.c_str(), + mNumFrameAvailable + mNumAcquired - mPendingRelease.size()); mCallbackCV.notify_all(); } @@ -538,7 +537,8 @@ void BLASTBufferQueue::onFrameAvailable(const BufferItem& item) { } // add to shadow queue mNumFrameAvailable++; - ATRACE_INT(mPendingBufferTrace.c_str(), mNumFrameAvailable + mNumAcquired); + ATRACE_INT(mQueuedBufferTrace.c_str(), + mNumFrameAvailable + mNumAcquired - mPendingRelease.size()); BQA_LOGV("onFrameAvailable framenumber=%" PRIu64 " nextTransactionSet=%s", item.mFrameNumber, toString(nextTransactionSet)); |