Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7e4eaf3 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

[sf] Trigger input updates in post composition

- Move input updates off the hotpath
- trigger transaction complete/release buffer callbacks a bit sooner.

Bug: 256882630
Test: presubmit
Test: perfetto traces

Change-Id: Ic3640bac6784d3e607268df3fe1605a8ef4a723e
parent 2c1f96e0
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -2517,8 +2517,6 @@ bool SurfaceFlinger::commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expe
    }

    updateCursorAsync();
    updateInputFlinger();

    if (mLayerTracingEnabled && !mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) {
        // This will block and tracing should only be enabled for debugging.
        mLayerTracing.notify(mVisibleRegionsDirty, frameTime.ns(), vsyncId.value);
@@ -2845,6 +2843,11 @@ void SurfaceFlinger::postComposition(nsecs_t callTime) {
        layer->releasePendingBuffer(presentTime.ns());
    }

    mTransactionCallbackInvoker.addPresentFence(std::move(presentFence));
    mTransactionCallbackInvoker.sendCallbacks(false /* onCommitOnly */);
    mTransactionCallbackInvoker.clearCompletedTransactions();
    updateInputFlinger();

    std::vector<std::pair<std::shared_ptr<compositionengine::Display>, sp<HdrLayerInfoReporter>>>
            hdrInfoListeners;
    bool haveNewListeners = false;
@@ -2901,10 +2904,6 @@ void SurfaceFlinger::postComposition(nsecs_t callTime) {

    mHdrLayerInfoChanged = false;

    mTransactionCallbackInvoker.addPresentFence(std::move(presentFence));
    mTransactionCallbackInvoker.sendCallbacks(false /* onCommitOnly */);
    mTransactionCallbackInvoker.clearCompletedTransactions();

    mTimeStats->incrementTotalFrames();
    mTimeStats->setPresentFenceGlobal(presentFenceTime);