Loading services/surfaceflinger/EventThread.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -44,13 +44,14 @@ static void vsyncOffCallback(union sigval val) { return; } EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger) EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bool interceptVSyncs) : mVSyncSource(src), mFlinger(flinger), mUseSoftwareVSync(false), mVsyncEnabled(false), mDebugVsyncEnabled(false), mVsyncHintSent(false) { mVsyncHintSent(false), mInterceptVSyncs(interceptVSyncs) { for (int32_t i=0 ; i<DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) { mVSyncEvent[i].header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC; Loading Loading @@ -226,7 +227,9 @@ Vector< sp<EventThread::Connection> > EventThread::waitForEvent( timestamp = mVSyncEvent[i].header.timestamp; if (timestamp) { // we have a vsync event to dispatch if (mInterceptVSyncs) { mFlinger.mInterceptor.saveVSyncEvent(timestamp); } *event = mVSyncEvent[i]; mVSyncEvent[i].header.timestamp = 0; vsyncCount = mVSyncEvent[i].vsync.count; Loading services/surfaceflinger/EventThread.h +2 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ class EventThread : public Thread, private VSyncSource::Callback { public: EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger); EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bool interceptVSyncs); sp<Connection> createEventConnection() const; status_t registerDisplayEventConnection(const sp<Connection>& connection); Loading Loading @@ -132,6 +132,7 @@ private: bool mDebugVsyncEnabled; bool mVsyncHintSent; const bool mInterceptVSyncs; timer_t mTimerId; }; Loading services/surfaceflinger/SurfaceFlinger.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -503,10 +503,10 @@ void SurfaceFlinger::init() { // start the EventThread sp<VSyncSource> vsyncSrc = new DispSyncSource(&mPrimaryDispSync, vsyncPhaseOffsetNs, true, "app"); mEventThread = new EventThread(vsyncSrc, *this); mEventThread = new EventThread(vsyncSrc, *this, false); sp<VSyncSource> sfVsyncSrc = new DispSyncSource(&mPrimaryDispSync, sfVsyncPhaseOffsetNs, true, "sf"); mSFEventThread = new EventThread(sfVsyncSrc, *this); mSFEventThread = new EventThread(sfVsyncSrc, *this, true); mEventQueue.setEventThread(mSFEventThread); // set SFEventThread to SCHED_FIFO to minimize jitter Loading Loading @@ -896,7 +896,7 @@ status_t SurfaceFlinger::enableVSyncInjections(bool enable) { ALOGV("VSync Injections enabled"); if (mVSyncInjector.get() == nullptr) { mVSyncInjector = new InjectVSyncSource(); mInjectorEventThread = new EventThread(mVSyncInjector, *this); mInjectorEventThread = new EventThread(mVSyncInjector, *this, false); } mEventQueue.setEventThread(mInjectorEventThread); } else { Loading services/surfaceflinger/SurfaceFlinger_hwc1.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -499,10 +499,10 @@ void SurfaceFlinger::init() { // start the EventThread sp<VSyncSource> vsyncSrc = new DispSyncSource(&mPrimaryDispSync, vsyncPhaseOffsetNs, true, "app"); mEventThread = new EventThread(vsyncSrc, *this); mEventThread = new EventThread(vsyncSrc, *this, false); sp<VSyncSource> sfVsyncSrc = new DispSyncSource(&mPrimaryDispSync, sfVsyncPhaseOffsetNs, true, "sf"); mSFEventThread = new EventThread(sfVsyncSrc, *this); mSFEventThread = new EventThread(sfVsyncSrc, *this, true); mEventQueue.setEventThread(mSFEventThread); // set SFEventThread to SCHED_FIFO to minimize jitter Loading Loading @@ -859,7 +859,7 @@ status_t SurfaceFlinger::enableVSyncInjections(bool enable) { ALOGV("VSync Injections enabled"); if (mVSyncInjector.get() == nullptr) { mVSyncInjector = new InjectVSyncSource(); mInjectorEventThread = new EventThread(mVSyncInjector, *this); mInjectorEventThread = new EventThread(mVSyncInjector, *this, false); } mEventQueue.setEventThread(mInjectorEventThread); } else { Loading Loading
services/surfaceflinger/EventThread.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -44,13 +44,14 @@ static void vsyncOffCallback(union sigval val) { return; } EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger) EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bool interceptVSyncs) : mVSyncSource(src), mFlinger(flinger), mUseSoftwareVSync(false), mVsyncEnabled(false), mDebugVsyncEnabled(false), mVsyncHintSent(false) { mVsyncHintSent(false), mInterceptVSyncs(interceptVSyncs) { for (int32_t i=0 ; i<DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) { mVSyncEvent[i].header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC; Loading Loading @@ -226,7 +227,9 @@ Vector< sp<EventThread::Connection> > EventThread::waitForEvent( timestamp = mVSyncEvent[i].header.timestamp; if (timestamp) { // we have a vsync event to dispatch if (mInterceptVSyncs) { mFlinger.mInterceptor.saveVSyncEvent(timestamp); } *event = mVSyncEvent[i]; mVSyncEvent[i].header.timestamp = 0; vsyncCount = mVSyncEvent[i].vsync.count; Loading
services/surfaceflinger/EventThread.h +2 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ class EventThread : public Thread, private VSyncSource::Callback { public: EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger); EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bool interceptVSyncs); sp<Connection> createEventConnection() const; status_t registerDisplayEventConnection(const sp<Connection>& connection); Loading Loading @@ -132,6 +132,7 @@ private: bool mDebugVsyncEnabled; bool mVsyncHintSent; const bool mInterceptVSyncs; timer_t mTimerId; }; Loading
services/surfaceflinger/SurfaceFlinger.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -503,10 +503,10 @@ void SurfaceFlinger::init() { // start the EventThread sp<VSyncSource> vsyncSrc = new DispSyncSource(&mPrimaryDispSync, vsyncPhaseOffsetNs, true, "app"); mEventThread = new EventThread(vsyncSrc, *this); mEventThread = new EventThread(vsyncSrc, *this, false); sp<VSyncSource> sfVsyncSrc = new DispSyncSource(&mPrimaryDispSync, sfVsyncPhaseOffsetNs, true, "sf"); mSFEventThread = new EventThread(sfVsyncSrc, *this); mSFEventThread = new EventThread(sfVsyncSrc, *this, true); mEventQueue.setEventThread(mSFEventThread); // set SFEventThread to SCHED_FIFO to minimize jitter Loading Loading @@ -896,7 +896,7 @@ status_t SurfaceFlinger::enableVSyncInjections(bool enable) { ALOGV("VSync Injections enabled"); if (mVSyncInjector.get() == nullptr) { mVSyncInjector = new InjectVSyncSource(); mInjectorEventThread = new EventThread(mVSyncInjector, *this); mInjectorEventThread = new EventThread(mVSyncInjector, *this, false); } mEventQueue.setEventThread(mInjectorEventThread); } else { Loading
services/surfaceflinger/SurfaceFlinger_hwc1.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -499,10 +499,10 @@ void SurfaceFlinger::init() { // start the EventThread sp<VSyncSource> vsyncSrc = new DispSyncSource(&mPrimaryDispSync, vsyncPhaseOffsetNs, true, "app"); mEventThread = new EventThread(vsyncSrc, *this); mEventThread = new EventThread(vsyncSrc, *this, false); sp<VSyncSource> sfVsyncSrc = new DispSyncSource(&mPrimaryDispSync, sfVsyncPhaseOffsetNs, true, "sf"); mSFEventThread = new EventThread(sfVsyncSrc, *this); mSFEventThread = new EventThread(sfVsyncSrc, *this, true); mEventQueue.setEventThread(mSFEventThread); // set SFEventThread to SCHED_FIFO to minimize jitter Loading Loading @@ -859,7 +859,7 @@ status_t SurfaceFlinger::enableVSyncInjections(bool enable) { ALOGV("VSync Injections enabled"); if (mVSyncInjector.get() == nullptr) { mVSyncInjector = new InjectVSyncSource(); mInjectorEventThread = new EventThread(mVSyncInjector, *this); mInjectorEventThread = new EventThread(mVSyncInjector, *this, false); } mEventQueue.setEventThread(mInjectorEventThread); } else { Loading