Add producerId so we know when the BBQ producer has been changed.
If BBQ producer changes but the SC remains the same, the frame numbers
for the SC will get reset. This causes issues if there's a barrier layer
set because the barrier is waiting for a particular frame number before
applying the transaction. Since the frame numbers have been reset, the
barrier will be greater than the incoming frame numbers. The change adds
a producerId to the buffer being sent so it can check if the producerId
is older than what's currently set on the Layer. If there's a barriers
set from the old producer, the buffer can be released and not applied
and will stop SF from waiting indefinitely.
Bug: 251971691
Test: Builds, hard to repro
Signed-off-by: Liu Lijun<liulijun@xiaomi.corp-partner.google.com>
Change-Id: If37171de4693a73f36f8de43e29c129b352eb55f
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 07c01d8..bf8cc7e 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -141,6 +141,8 @@
uint64_t frameNumber;
ui::Transform transform;
+
+ uint32_t producerId = 0;
uint32_t bufferTransform;
bool transformToDisplayInverse;
Region transparentRegionHint;
@@ -838,6 +840,10 @@
std::unordered_set<Layer*>& visited);
bool willPresentCurrentTransaction() const;
+ void callReleaseBufferCallback(const sp<ITransactionCompletedListener>& listener,
+ const sp<GraphicBuffer>& buffer, uint64_t framenumber,
+ const sp<Fence>& releaseFence);
+
protected:
// For unit tests
friend class TestableSurfaceFlinger;
@@ -1047,6 +1053,10 @@
const sp<Fence>& releaseFence,
uint32_t currentMaxAcquiredBufferCount);
+ // Returns true if the transformed buffer size does not match the layer size and we need
+ // to apply filtering.
+ bool bufferNeedsFiltering() const;
+
// Returns true if there is a valid color to fill.
bool fillsColor() const;
// Returns true if this layer has a blur value.