SurfaceFlinger: remove SurfaceControl level vsyncId setting
FrameTimelineInfo can be set on the entire transaction, or for an
individual SurfaceControl. Later in the code the FrameTimelineInfo
is unified based on the most recent vsyncId. For this reason we are
removing the setting of a FrameTimelineInfo on a SurfaceControl and
instead we use the transaction's one.
Test: adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test
Bug: 181978893
Bug: 169901895
Change-Id: Id4a8e46d57fbda66f6d478be82313482053dce20
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index f778232..5b1b975 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -401,7 +401,7 @@
t->setFrameNumber(mSurfaceControl, bufferItem.mFrameNumber);
if (!mNextFrameTimelineInfoQueue.empty()) {
- t->setFrameTimelineInfo(mSurfaceControl, mNextFrameTimelineInfoQueue.front());
+ t->setFrameTimelineInfo(mNextFrameTimelineInfoQueue.front());
mNextFrameTimelineInfoQueue.pop();
}
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 7a18ca6..a84e741 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -62,7 +62,6 @@
shouldBeSeamless(true),
fixedTransformHint(ui::Transform::ROT_INVALID),
frameNumber(0),
- frameTimelineInfo(),
autoRefresh(false),
releaseBufferListener(nullptr) {
matrix.dsdx = matrix.dtdy = 1.0f;
@@ -151,7 +150,6 @@
SAFE_PARCEL(output.writeBool, shouldBeSeamless);
SAFE_PARCEL(output.writeUint32, fixedTransformHint);
SAFE_PARCEL(output.writeUint64, frameNumber);
- SAFE_PARCEL(frameTimelineInfo.write, output);
SAFE_PARCEL(output.writeBool, autoRefresh);
SAFE_PARCEL(output.writeStrongBinder, IInterface::asBinder(releaseBufferListener));
@@ -274,7 +272,6 @@
SAFE_PARCEL(input.readUint32, &tmpUint32);
fixedTransformHint = static_cast<ui::Transform::RotationFlags>(tmpUint32);
SAFE_PARCEL(input.readUint64, &frameNumber);
- SAFE_PARCEL(frameTimelineInfo.read, input);
SAFE_PARCEL(input.readBool, &autoRefresh);
tmpBinder = nullptr;
@@ -543,10 +540,6 @@
what |= eFrameNumberChanged;
frameNumber = other.frameNumber;
}
- if (other.what & eFrameTimelineInfoChanged) {
- what |= eFrameTimelineInfoChanged;
- frameTimelineInfo.merge(other.frameTimelineInfo);
- }
if (other.what & eAutoRefreshChanged) {
what |= eAutoRefreshChanged;
autoRefresh = other.autoRefresh;
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 11fe490..eaccc5b 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1630,20 +1630,7 @@
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameTimelineInfo(
const FrameTimelineInfo& frameTimelineInfo) {
- mFrameTimelineInfo = frameTimelineInfo;
- return *this;
-}
-
-SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameTimelineInfo(
- const sp<SurfaceControl>& sc, const FrameTimelineInfo& frameTimelineInfo) {
- layer_state_t* s = getLayerState(sc);
- if (!s) {
- mStatus = BAD_INDEX;
- return *this;
- }
-
- s->what |= layer_state_t::eFrameTimelineInfoChanged;
- s->frameTimelineInfo = frameTimelineInfo;
+ mFrameTimelineInfo.merge(frameTimelineInfo);
return *this;
}
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index d68a9cf..4a52168 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -133,10 +133,9 @@
eProducerDisconnect = 0x100'00000000,
eFixedTransformHintChanged = 0x200'00000000,
eFrameNumberChanged = 0x400'00000000,
- eFrameTimelineInfoChanged = 0x800'00000000,
- eBlurRegionsChanged = 0x1000'00000000,
- eAutoRefreshChanged = 0x2000'00000000,
- eStretchChanged = 0x4000'00000000,
+ eBlurRegionsChanged = 0x800'00000000,
+ eAutoRefreshChanged = 0x1000'00000000,
+ eStretchChanged = 0x2000'00000000,
};
layer_state_t();
@@ -239,8 +238,6 @@
// graphics producer.
uint64_t frameNumber;
- FrameTimelineInfo frameTimelineInfo;
-
// Indicates that the consumer should acquire the next frame as soon as it
// can and not wait for a frame to become available. This is only relevant
// in shared buffer mode.
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index f29983c..ae7170e 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -530,9 +530,6 @@
// to the transaction, and the input event id that identifies the input event that caused
// the current frame.
Transaction& setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInfo);
- // Variant that only applies to a specific SurfaceControl.
- Transaction& setFrameTimelineInfo(const sp<SurfaceControl>& sc,
- const FrameTimelineInfo& frameTimelineInfo);
// Indicates that the consumer should acquire the next frame as soon as it
// can and not wait for a frame to become available. This is only relevant