BufferStateLayer: shouldPresentNow is always true
This method should actually be removed because we do the checking
at the transaction queue level now, but we leave it for now for
BufferQueueLayer. To show the method should always return true
we can examine each clause in the method:
1. isVsyncValidForUid: We were supposed to check this at
transaction queue, if for some reason this returned false
now we just need to continue.
2. getSideBandStream/AutoRefresh, covered by the call to
layer->hasReadyFrame which encloses the only call to
layer->shouldPresentNow
3. hasFrameUpdate, also called by layer->hasReadyFrame
4. isBufferDue, supposed to be handled by the transaction
queue, mismatch not allowed at this point.
Just landing this to simplify debugging around this codepath.
Bug: 180194022
Test: Existing tests pass
Change-Id: I1a5eb572a3e651a2504039ef9cc8e3b51a46dd3c
diff --git a/services/surfaceflinger/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index 2118f4a..0b3c35a 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -182,7 +182,7 @@
bool getSidebandStreamChanged() const { return mSidebandStreamChanged; }
// Returns true if the next buffer should be presented at the expected present time
- bool shouldPresentNow(nsecs_t expectedPresentTime) const final;
+ bool shouldPresentNow(nsecs_t expectedPresentTime) const;
// Returns true if the next buffer should be presented at the expected present time,
// overridden by BufferStateLayer and BufferQueueLayer for implementation
diff --git a/services/surfaceflinger/BufferStateLayer.h b/services/surfaceflinger/BufferStateLayer.h
index 6b422ea..47c0bb2 100644
--- a/services/surfaceflinger/BufferStateLayer.h
+++ b/services/surfaceflinger/BufferStateLayer.h
@@ -118,6 +118,8 @@
std::atomic<int32_t>* getPendingBufferCounter() override { return &mPendingBufferTransactions; }
std::string getPendingBufferCounterName() override { return mBlastTransactionName; }
+ bool shouldPresentNow(nsecs_t /*expectedPresentTime*/) const override { return true; }
+
protected:
void gatherBufferInfo() override;
uint64_t getHeadFrameNumber(nsecs_t expectedPresentTime) const;