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

Commit 5b6bca45 authored by Rachel Lee's avatar Rachel Lee Committed by Midas Chien
Browse files

Resync on the transaction.

Currently only Choreographer requestNextVsync will resync otherwise.
Scheduler::resync already checks to make sure resync won't happen too
frequently (750 ms currently).

Bug: 266128330
Test: see b/380398647 and its child bugs
Flag: EXEMPT bugfix
Change-Id: Id3c0fc6a62b45262f4338f8154ad2fa8c0c16a05
(cherry picked from commit a5be328a)
parent 8a3f4096
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ public:
        ftl::FakeGuard guard(kMainThreadContext);
        resyncToHardwareVsyncLocked(id, allowToEnable, modePtr);
    }
    void resync() override EXCLUDES(mDisplayLock);
    void forceNextResync() { mLastResyncTime = 0; }

    // Passes a vsync sample to VsyncController. Returns true if
@@ -466,7 +467,6 @@ private:
    bool throttleVsync(TimePoint, uid_t) override;
    // Get frame interval
    Period getVsyncPeriod(uid_t) override EXCLUDES(mDisplayLock);
    void resync() override EXCLUDES(mDisplayLock);
    void onExpectedPresentTimePosted(TimePoint expectedPresentTime) override EXCLUDES(mDisplayLock);

    std::unique_ptr<EventThread> mRenderEventThread;
+1 −0
Original line number Diff line number Diff line
@@ -4552,6 +4552,7 @@ void SurfaceFlinger::setTransactionFlags(uint32_t mask, TransactionSchedule sche
    SFTRACE_INT("mTransactionFlags", transactionFlags);

    if (const bool scheduled = transactionFlags & mask; !scheduled) {
        mScheduler->resync();
        scheduleCommit(frameHint);
    } else if (frameHint == FrameHint::kActive) {
        // Even if the next frame is already scheduled, we should reset the idle timer