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

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

Merge "SF: fix frameTimelineVsyncId = 0" into sc-dev

parents cc81b2f4 1130b3dc
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -354,7 +354,7 @@ void EventThread::onVSyncEvent(nsecs_t timestamp, nsecs_t expectedVSyncTimestamp
            return mTokenManager->generateTokenForPredictions(
                    {timestamp, deadlineTimestamp, expectedVSyncTimestamp});
        }
        return static_cast<int64_t>(0);
        return FrameTimelineInfo::INVALID_VSYNC_ID;
    }();

    mPendingEvents.push_back(makeVSync(mVSyncState->displayId, timestamp, ++mVSyncState->count,
@@ -494,10 +494,16 @@ void EventThread::threadMain(std::unique_lock<std::mutex>& lock) {
                const auto now = systemTime(SYSTEM_TIME_MONOTONIC);
                const auto deadlineTimestamp = now + timeout.count();
                const auto expectedVSyncTime = deadlineTimestamp + timeout.count();
                // TODO(b/162890590): use TokenManager to populate vsyncId
                const int64_t vsyncId = [&] {
                    if (mTokenManager != nullptr) {
                        return mTokenManager->generateTokenForPredictions(
                                {now, deadlineTimestamp, expectedVSyncTime});
                    }
                    return FrameTimelineInfo::INVALID_VSYNC_ID;
                }();
                mPendingEvents.push_back(makeVSync(mVSyncState->displayId, now,
                                                   ++mVSyncState->count, expectedVSyncTime,
                                                   deadlineTimestamp, /*vsyncId=*/0));
                                                   deadlineTimestamp, vsyncId));
            }
        }
    }