SF: change acquired buffers based on the current refresh rate

BLASTBufferQueue set the max acquired buffers based on SF
vsync configuration (sf.duration and app.duration). This is calculated
based on the max supported refresh rate on the device, and it turn
is propogated to apps via min_undequeued_buffers to the app could
allocate enough buffers for maintaining the pipeline SF expects.

This leads to a higher latency when the device is running in a lower
refresh rate as there are more buffers on the buffer queue then required.
In this change we are holding on the these "extra buffers" and not
releasing them back to the buffer queue so the app would use the number
of buffers it needs based on the current refresh rate, and to avoid having
unnecessary long latency.

Bug: 188553729
Test: Run backpressure based game on 60Hz and 120Hz and collect systraces
Change-Id: I9d4e6278f0ddd28008ac437ab0576aa79d05166a
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 71e18a9..0d7795e 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -1215,16 +1215,17 @@
         return reply.readInt32();
     }
 
-    status_t getExtraBufferCount(int* extraBuffers) const override {
+    status_t getMaxAcquiredBufferCount(int* buffers) const override {
         Parcel data, reply;
         data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
-        status_t err = remote()->transact(BnSurfaceComposer::GET_EXTRA_BUFFER_COUNT, data, &reply);
+        status_t err =
+                remote()->transact(BnSurfaceComposer::GET_MAX_ACQUIRED_BUFFER_COUNT, data, &reply);
         if (err != NO_ERROR) {
-            ALOGE("getExtraBufferCount failed to read data:  %s (%d)", strerror(-err), err);
+            ALOGE("getMaxAcquiredBufferCount failed to read data:  %s (%d)", strerror(-err), err);
             return err;
         }
 
-        return reply.readInt32(extraBuffers);
+        return reply.readInt32(buffers);
     }
 };
 
@@ -2069,14 +2070,14 @@
             SAFE_PARCEL(reply->writeInt32, priority);
             return NO_ERROR;
         }
-        case GET_EXTRA_BUFFER_COUNT: {
+        case GET_MAX_ACQUIRED_BUFFER_COUNT: {
             CHECK_INTERFACE(ISurfaceComposer, data, reply);
-            int extraBuffers = 0;
-            int err = getExtraBufferCount(&extraBuffers);
+            int buffers = 0;
+            int err = getMaxAcquiredBufferCount(&buffers);
             if (err != NO_ERROR) {
                 return err;
             }
-            SAFE_PARCEL(reply->writeInt32, extraBuffers);
+            SAFE_PARCEL(reply->writeInt32, buffers);
             return NO_ERROR;
         }
         case OVERRIDE_HDR_TYPES: {