Loading services/surfaceflinger/Scheduler/VSyncModulator.h +22 −2 Original line number Diff line number Diff line Loading @@ -67,6 +67,14 @@ public: mAppEventThread = appEventThread; } void setSchedulerAndHandles(Scheduler* scheduler, Scheduler::ConnectionHandle* appConnectionHandle, Scheduler::ConnectionHandle* sfConnectionHandle) { mScheduler = scheduler; mAppConnectionHandle = appConnectionHandle; mSfConnectionHandle = sfConnectionHandle; } void setTransactionStart(TransactionStart transactionStart) { if (transactionStart == TransactionStart::EARLY) { mRemainingEarlyFrameCount = MIN_EARLY_FRAME_COUNT; Loading Loading @@ -108,11 +116,19 @@ private: bool changed = false; if (desired.sf != current.sf) { if (mSfConnectionHandle != nullptr) { mScheduler->setPhaseOffset(mSfConnectionHandle, desired.sf); } else { mSfEventThread->setPhaseOffset(desired.sf); } changed = true; } if (desired.app != current.app) { if (mSfConnectionHandle != nullptr) { mScheduler->setPhaseOffset(mAppConnectionHandle, desired.app); } else { mAppEventThread->setPhaseOffset(desired.app); } changed = true; } Loading @@ -138,6 +154,10 @@ private: EventThread* mSfEventThread = nullptr; EventThread* mAppEventThread = nullptr; Scheduler* mScheduler = nullptr; Scheduler::ConnectionHandle* mAppConnectionHandle = nullptr; Scheduler::ConnectionHandle* mSfConnectionHandle = nullptr; std::atomic<Offsets> mOffsets; std::atomic<TransactionStart> mTransactionStart = TransactionStart::NORMAL; Loading services/surfaceflinger/SurfaceFlinger.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -632,8 +632,8 @@ void SurfaceFlinger::init() { }); mEventQueue->setEventConnection(mScheduler->getEventConnection(mSfConnectionHandle)); mVsyncModulator.setEventThreads(mScheduler->getEventThread(mSfConnectionHandle), mScheduler->getEventThread(mAppConnectionHandle)); mVsyncModulator.setSchedulerAndHandles(mScheduler.get(), mAppConnectionHandle.get(), mSfConnectionHandle.get()); } else { mEventThreadSource = std::make_unique<DispSyncSource>(mPrimaryDispSync.get(), Loading Loading
services/surfaceflinger/Scheduler/VSyncModulator.h +22 −2 Original line number Diff line number Diff line Loading @@ -67,6 +67,14 @@ public: mAppEventThread = appEventThread; } void setSchedulerAndHandles(Scheduler* scheduler, Scheduler::ConnectionHandle* appConnectionHandle, Scheduler::ConnectionHandle* sfConnectionHandle) { mScheduler = scheduler; mAppConnectionHandle = appConnectionHandle; mSfConnectionHandle = sfConnectionHandle; } void setTransactionStart(TransactionStart transactionStart) { if (transactionStart == TransactionStart::EARLY) { mRemainingEarlyFrameCount = MIN_EARLY_FRAME_COUNT; Loading Loading @@ -108,11 +116,19 @@ private: bool changed = false; if (desired.sf != current.sf) { if (mSfConnectionHandle != nullptr) { mScheduler->setPhaseOffset(mSfConnectionHandle, desired.sf); } else { mSfEventThread->setPhaseOffset(desired.sf); } changed = true; } if (desired.app != current.app) { if (mSfConnectionHandle != nullptr) { mScheduler->setPhaseOffset(mAppConnectionHandle, desired.app); } else { mAppEventThread->setPhaseOffset(desired.app); } changed = true; } Loading @@ -138,6 +154,10 @@ private: EventThread* mSfEventThread = nullptr; EventThread* mAppEventThread = nullptr; Scheduler* mScheduler = nullptr; Scheduler::ConnectionHandle* mAppConnectionHandle = nullptr; Scheduler::ConnectionHandle* mSfConnectionHandle = nullptr; std::atomic<Offsets> mOffsets; std::atomic<TransactionStart> mTransactionStart = TransactionStart::NORMAL; Loading
services/surfaceflinger/SurfaceFlinger.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -632,8 +632,8 @@ void SurfaceFlinger::init() { }); mEventQueue->setEventConnection(mScheduler->getEventConnection(mSfConnectionHandle)); mVsyncModulator.setEventThreads(mScheduler->getEventThread(mSfConnectionHandle), mScheduler->getEventThread(mAppConnectionHandle)); mVsyncModulator.setSchedulerAndHandles(mScheduler.get(), mAppConnectionHandle.get(), mSfConnectionHandle.get()); } else { mEventThreadSource = std::make_unique<DispSyncSource>(mPrimaryDispSync.get(), Loading