summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index b9a293f4c3..8024482531 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -29,9 +29,10 @@
#include <gui/IProducerListener.h>
#include <gui/Surface.h>
#include <utils/Singleton.h>
-
#include <utils/Trace.h>
+#include <private/gui/ComposerService.h>
+
#include <chrono>
using namespace std::chrono_literals;
@@ -158,6 +159,11 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp<SurfaceCont
mBufferItemConsumer->setDefaultBufferFormat(convertBufferFormat(format));
mBufferItemConsumer->setBlastBufferQueue(this);
+ int extraBufferCount = 0;
+ ComposerService::getComposerService()->getExtraBufferCount(&extraBufferCount);
+ mMaxAcquiredBuffers = 1 + extraBufferCount;
+ mBufferItemConsumer->setMaxAcquiredBufferCount(mMaxAcquiredBuffers);
+
mTransformHint = mSurfaceControl->getTransformHint();
mBufferItemConsumer->setTransformHint(mTransformHint);
SurfaceComposerClient::Transaction()
@@ -567,7 +573,7 @@ void BLASTBufferQueue::setTransactionCompleteCallback(
// includeExtraAcquire is true to include this buffer to the count. Since this depends on the state
// of the buffer, the next acquire may return with NO_BUFFER_AVAILABLE.
bool BLASTBufferQueue::maxBuffersAcquired(bool includeExtraAcquire) const {
- int maxAcquiredBuffers = MAX_ACQUIRED_BUFFERS + (includeExtraAcquire ? 2 : 1);
+ int maxAcquiredBuffers = mMaxAcquiredBuffers + (includeExtraAcquire ? 2 : 1);
return mNumAcquired == maxAcquiredBuffers;
}