Enable backpressure for BufferStateLayer
The default behaviour of buffer state layer is to drop older
buffers if there are newer buffers that are ready to be presented.
When emulating BufferQueue behavior via the adapter, we want
to queue up buffers without any present timestamps. To solve this,
we introduce a layer state flag to keep the buffer in the transaction
queue if there is already a buffer that is ready to be applied.
Test: atest SurfaceViewBufferTests:BufferPresentationTests
Bug: 176967609
Change-Id: I33f6347bd1c7a2d80dc4214e596bb864abe8c6bf
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index c90fb4a..194131d 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -751,7 +751,7 @@
uint32_t setTransactionFlags(uint32_t flags, TransactionSchedule);
void commitTransaction() REQUIRES(mStateLock);
void commitOffscreenLayers();
- bool transactionIsReadyToBeApplied(int64_t desiredPresentTime,
+ bool transactionIsReadyToBeApplied(bool isAutoTimestamp, int64_t desiredPresentTime,
const Vector<ComposerState>& states,
bool updateTransactionCounters = false) REQUIRES(mStateLock);
uint32_t setDisplayStateLocked(const DisplayState& s) REQUIRES(mStateLock);