SF: increase the number of buffers for SurfaceView
3 buffers are not sufficient for most apps to render at high refresh
rates. This change increases the maxAcquiredBufferCount on the buffer
queue for all surfaces, and removes the hwui-specific extra buffer
allocations. All Surfaces connected to SurfaceFlinger will have now
enough buffers to account for configured
'debug.sf.late.app.duration' value.
Test: Run backpressure based game on 60Hz and 120Hz and collect
traces
Bug: 188553729
Change-Id: Ib8fda5db3f48c3bfc6fbf07167b4313674512cee
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index d7c07b9..6529a4e 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -139,7 +139,7 @@
ISurfaceComposerClient::eOpaque);
mBbqChild = mClient->createSurface(String8("bbq-wrapper"), 0, 0, mFormat,
flags, mHandle, {}, &ignore);
- mBbq = new BLASTBufferQueue("bbq-adapter", mBbqChild, mWidth, mHeight, mFormat);
+ mBbq = sp<BLASTBufferQueue>::make("bbq-adapter", mBbqChild, mWidth, mHeight, mFormat);
// This surface is always consumed by SurfaceFlinger, so the
// producerControlledByApp value doesn't matter; using false.