Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f674fa1c authored by Ramakant Singh's avatar Ramakant Singh Committed by Linux Build Service Account
Browse files

sf: Make default app buffers count to three.

Default two app buffers not sufficient for fast
rendering based test cases. Hence increasing default
app buffer count to three for these use cases only.

Change-Id: Ic9a8e463832c8140178d7f99171ba7ab3bb3230a
parent 0710cc13
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <gui/BufferQueueCore.h>
#include <gui/IConsumerListener.h>
#include <gui/IProducerListener.h>
#include <cutils/properties.h>

namespace android {

@@ -89,6 +90,17 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
        // the timestamps are being auto-generated by Surface. If the app isn't
        // generating timestamps explicitly, it probably doesn't want frames to
        // be discarded based on them.
#ifdef QCOM_BSP
        char property[PROPERTY_VALUE_MAX];
        if (property_get("ro.sf.default_app_buffer", property, NULL) > 0) {
           if (!mCore->mQueue[0].mIsAutoTimestamp && mCore->mDefaultMaxBufferCount < 3) {
              const BufferItem& bufferItem(mCore->mQueue[0]);
              nsecs_t desiredPresent = bufferItem.mTimestamp;
              if ( desiredPresent < expectedPresent)
                  mCore->mDefaultMaxBufferCount = 3;
           }
        }
#endif
        while (mCore->mQueue.size() > 1 && !mCore->mQueue[0].mIsAutoTimestamp) {
            // If entry[1] is timely, drop entry[0] (and repeat). We apply an
            // additional criterion here: we only drop the earlier buffer if our