Combine Buffer Properties when calling setBuffer
There are several properties, like releaseCallback, acquireFence,
frameNumber, that are tied to the buffer being set. If a new buffer is
set, all those properties should also be overwritten, rather than
through a separate call.
1. Remove Transaction.setAcquireFence and Transaction.setFrameNumber and
added them to the setBuffer as optional
2. Combine all the buffer info into a struct called BufferData that's
sent to SF as one. This will also help with merging or overwriting
buffer data since the callback, frameNumber, and acquireFence should
also be updated.
3. Combine the functions in SF so there's no longer a separate call to
BSL to set fence. Instead, send all buffer related data to BSL.setBuffer
Test: SurfaceFlinger_test
Fixes: 200065015
Change-Id: I53ad12dd105cd4cac6c3a7ecd48279d1b3cd2b8f
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 8c281d5..f29ebde 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -416,17 +416,11 @@
// Used only to set BufferStateLayer state
virtual bool setTransform(uint32_t /*transform*/) { return false; };
virtual bool setTransformToDisplayInverse(bool /*transformToDisplayInverse*/) { return false; };
- virtual bool setBuffer(const std::shared_ptr<renderengine::ExternalTexture>& /*buffer*/,
- const sp<Fence>& /*acquireFence*/, nsecs_t /*postTime*/,
- nsecs_t /*desiredPresentTime*/, bool /*isAutoTimestamp*/,
- const client_cache_t& /*clientCacheId*/, uint64_t /* frameNumber */,
- std::optional<nsecs_t> /* dequeueTime */,
- const FrameTimelineInfo& /*info*/,
- const sp<ITransactionCompletedListener>& /* releaseBufferListener */,
- const sp<IBinder>& /* releaseBufferEndpoint */) {
+ virtual bool setBuffer(const BufferData&, nsecs_t /*postTime*/, nsecs_t /*desiredPresentTime*/,
+ bool /*isAutoTimestamp*/, std::optional<nsecs_t> /* dequeueTime */,
+ const FrameTimelineInfo& /*info*/) {
return false;
};
- virtual bool setAcquireFence(const sp<Fence>& /*fence*/) { return false; };
virtual bool setDataspace(ui::Dataspace /*dataspace*/) { return false; };
virtual bool setHdrMetadata(const HdrMetadata& /*hdrMetadata*/) { return false; };
virtual bool setSurfaceDamageRegion(const Region& /*surfaceDamage*/) { return false; };
@@ -527,8 +521,6 @@
virtual bool shouldPresentNow(nsecs_t /*expectedPresentTime*/) const { return false; }
- virtual uint64_t getHeadFrameNumber(nsecs_t /* expectedPresentTime */) const { return 0; }
-
/*
* called after composition.
* returns true if the layer latched a new buffer this frame.