Add inputEventId to SurfaceFrame
SurfaceFrame will now be aware of the id of the input event that caused
the current frame.
The flow of input event id is inputflinger -> app -> surfaceflinger.
Here, we are adding the 'inputEventId' parameter to the
'setFrameTimelineVsync' call. This call will now be responsible for
setting two pieces of information: the vsync id, and the input event id.
Since it will no longer be limited to the vsync id, we rename this call
to "setFrameTimelineInfo".
Once the inputEventId is stored in SurfaceFrame, we will add a binder
call to send the frame timing information to inputflinger (separate,
future CL). This will allow input to reconstruct the entire sequence of
events (at what time was input event getting processed in system_server,
app, and surfaceflinger) and will provide the ability to measure
end-to-end touch latency.
In a separate change, we will also add ATRACE calls to allow manual /
script-based latency analysis for local debugging. We will now know
which input event is being processed in surfaceflinger.
Bug: 169866723
Bug: 129481165
Design doc: https://docs.google.com/document/d/1G3bLaZYSmbe6AKcL-6ZChvrw_B_LXEz29Z6Ed9QoYXY/edit#
Test: atest WMShellUnitTests SurfaceParcelable_test libgui_test IPC_test SurfaceFlinger_test
Change-Id: If7e0eee82603b38b396b53ad7ced660973efcb50
Merged-In: If7e0eee82603b38b396b53ad7ced660973efcb50
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 357c4a4..0660a4a 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -304,8 +304,8 @@
// a fixed transform hint is not set.
ui::Transform::RotationFlags fixedTransformHint;
- // The vsync id that was used to start the transaction
- int64_t frameTimelineVsyncId;
+ // The vsync info that was used to start the transaction
+ FrameTimelineInfo frameTimelineInfo;
// When the transaction was posted
nsecs_t postTime;
@@ -869,8 +869,9 @@
bool setFrameRate(FrameRate);
- virtual void setFrameTimelineVsyncForBuffer(int64_t /*frameTimelineVsyncId*/) {}
- void setFrameTimelineVsyncForTransaction(int64_t frameTimelineVsyncId, nsecs_t postTime);
+ virtual void setFrameTimelineInfoForBuffer(const FrameTimelineInfo& /*info*/) {}
+ void setFrameTimelineInfoForTransaction(const FrameTimelineInfo& frameTimelineInfo,
+ nsecs_t postTime);
// Creates a new handle each time, so we only expect
// this to be called once.