[sf] Trigger input updates in post composition
Move input updates off the hotpath. This doesn't affect
input latency. We are updating the data input uses for hit
testing after the composition hotpath. The data is pushed
via an async call. If the caller wants to ensure the
data is observable in inputflinger, they can add a window info
reported listener.
Bug: 256882630
Test: presubmit
Test: perfetto traces
Change-Id: If35b02d5754dd71c73a4ae23e318e3e8b0ada83b
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 648409c..a9a1d80 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2523,7 +2523,9 @@
}
updateCursorAsync();
- updateInputFlinger(vsyncId, pacesetterFrameTarget.frameBeginTime());
+ if (!mustComposite) {
+ updateInputFlinger(vsyncId, pacesetterFrameTarget.frameBeginTime());
+ }
if (mLayerTracingEnabled && !mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) {
// This will block and tracing should only be enabled for debugging.
@@ -2718,6 +2720,8 @@
addToLayerTracing(mVisibleRegionsDirty, pacesetterFrameTarget.frameBeginTime(), vsyncId);
}
+ updateInputFlinger(vsyncId, pacesetterFrameTarget.frameBeginTime());
+
if (mVisibleRegionsDirty) mHdrLayerInfoChanged = true;
mVisibleRegionsDirty = false;