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/tests/BLASTBufferQueue_test.cpp b/libs/gui/tests/BLASTBufferQueue_test.cpp
index 5a5da97..06660b8 100644
--- a/libs/gui/tests/BLASTBufferQueue_test.cpp
+++ b/libs/gui/tests/BLASTBufferQueue_test.cpp
@@ -394,7 +394,11 @@
     setUpProducer(adapter, igbProducer);
 
     std::vector<std::pair<int, sp<Fence>>> allocated;
-    for (int i = 0; i < 3; i++) {
+    int minUndequeuedBuffers = 0;
+    ASSERT_EQ(OK, igbProducer->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minUndequeuedBuffers));
+    const auto bufferCount = minUndequeuedBuffers + 2;
+
+    for (int i = 0; i < bufferCount; i++) {
         int slot;
         sp<Fence> fence;
         sp<GraphicBuffer> buf;