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