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

Commit b40ac209 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "SF: pass the predicted present time to LayerHistory" into sc-dev

parents 81a9915e b7f1556d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -404,7 +404,16 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer, const sp<Fence
    mCurrentState.desiredPresentTime = desiredPresentTime;
    mCurrentState.isAutoTimestamp = isAutoTimestamp;

    mFlinger->mScheduler->recordLayerHistory(this, isAutoTimestamp ? 0 : desiredPresentTime,
    const nsecs_t presentTime = [&] {
        if (!isAutoTimestamp) return desiredPresentTime;

        const auto prediction =
                mFlinger->mFrameTimeline->getTokenManager()->getPredictionsForToken(info.vsyncId);
        if (prediction.has_value()) return prediction->presentTime;

        return static_cast<nsecs_t>(0);
    }();
    mFlinger->mScheduler->recordLayerHistory(this, presentTime,
                                             LayerHistory::LayerUpdateType::Buffer);

    addFrameEvent(acquireFence, postTime, isAutoTimestamp ? 0 : desiredPresentTime);