Loading services/surfaceflinger/Scheduler/EventThread.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -426,8 +426,8 @@ void EventThread::onVsync(nsecs_t vsyncTime, nsecs_t wakeupTime, nsecs_t readyTi LOG_FATAL_IF(!mVSyncState); mVsyncTracer = (mVsyncTracer + 1) % 2; mPendingEvents.push_back(makeVSync(mVSyncState->displayId, wakeupTime, ++mVSyncState->count, vsyncTime, readyTime)); mPendingEvents.push_back(makeVSync(mVsyncSchedule->getPhysicalDisplayId(), wakeupTime, ++mVSyncState->count, vsyncTime, readyTime)); mCondition.notify_all(); } Loading Loading @@ -486,9 +486,9 @@ void EventThread::threadMain(std::unique_lock<std::mutex>& lock) { if (event->header.type == DisplayEventReceiver::DISPLAY_EVENT_HOTPLUG) { if (event->hotplug.connectionError == 0) { if (event->hotplug.connected && !mVSyncState) { mVSyncState.emplace(event->header.displayId); } else if (!event->hotplug.connected && mVSyncState && mVSyncState->displayId == event->header.displayId) { mVSyncState.emplace(); } else if (!event->hotplug.connected && mVsyncSchedule->getPhysicalDisplayId() == event->header.displayId) { mVSyncState.reset(); } } else { Loading Loading @@ -559,7 +559,7 @@ 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(); mPendingEvents.push_back(makeVSync(mVSyncState->displayId, now, mPendingEvents.push_back(makeVSync(mVsyncSchedule->getPhysicalDisplayId(), now, ++mVSyncState->count, expectedVSyncTime, deadlineTimestamp)); } Loading Loading @@ -739,7 +739,7 @@ void EventThread::dump(std::string& result) const { StringAppendF(&result, "%s: state=%s VSyncState=", mThreadName, toCString(mState)); if (mVSyncState) { StringAppendF(&result, "{displayId=%s, count=%u%s}\n", to_string(mVSyncState->displayId).c_str(), mVSyncState->count, to_string(mVsyncSchedule->getPhysicalDisplayId()).c_str(), mVSyncState->count, mVSyncState->synthetic ? ", synthetic" : ""); } else { StringAppendF(&result, "none\n"); Loading services/surfaceflinger/Scheduler/EventThread.h +0 −4 Original line number Diff line number Diff line Loading @@ -235,10 +235,6 @@ private: // VSYNC state of connected display. struct VSyncState { explicit VSyncState(PhysicalDisplayId displayId) : displayId(displayId) {} const PhysicalDisplayId displayId; // Number of VSYNC events since display was connected. uint32_t count = 0; Loading services/surfaceflinger/Scheduler/VsyncSchedule.h +2 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ public: bool getPendingHardwareVsyncState() const REQUIRES(kMainThreadContext); PhysicalDisplayId getPhysicalDisplayId() const { return mId; } protected: using ControllerPtr = std::unique_ptr<VsyncController>; Loading Loading
services/surfaceflinger/Scheduler/EventThread.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -426,8 +426,8 @@ void EventThread::onVsync(nsecs_t vsyncTime, nsecs_t wakeupTime, nsecs_t readyTi LOG_FATAL_IF(!mVSyncState); mVsyncTracer = (mVsyncTracer + 1) % 2; mPendingEvents.push_back(makeVSync(mVSyncState->displayId, wakeupTime, ++mVSyncState->count, vsyncTime, readyTime)); mPendingEvents.push_back(makeVSync(mVsyncSchedule->getPhysicalDisplayId(), wakeupTime, ++mVSyncState->count, vsyncTime, readyTime)); mCondition.notify_all(); } Loading Loading @@ -486,9 +486,9 @@ void EventThread::threadMain(std::unique_lock<std::mutex>& lock) { if (event->header.type == DisplayEventReceiver::DISPLAY_EVENT_HOTPLUG) { if (event->hotplug.connectionError == 0) { if (event->hotplug.connected && !mVSyncState) { mVSyncState.emplace(event->header.displayId); } else if (!event->hotplug.connected && mVSyncState && mVSyncState->displayId == event->header.displayId) { mVSyncState.emplace(); } else if (!event->hotplug.connected && mVsyncSchedule->getPhysicalDisplayId() == event->header.displayId) { mVSyncState.reset(); } } else { Loading Loading @@ -559,7 +559,7 @@ 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(); mPendingEvents.push_back(makeVSync(mVSyncState->displayId, now, mPendingEvents.push_back(makeVSync(mVsyncSchedule->getPhysicalDisplayId(), now, ++mVSyncState->count, expectedVSyncTime, deadlineTimestamp)); } Loading Loading @@ -739,7 +739,7 @@ void EventThread::dump(std::string& result) const { StringAppendF(&result, "%s: state=%s VSyncState=", mThreadName, toCString(mState)); if (mVSyncState) { StringAppendF(&result, "{displayId=%s, count=%u%s}\n", to_string(mVSyncState->displayId).c_str(), mVSyncState->count, to_string(mVsyncSchedule->getPhysicalDisplayId()).c_str(), mVSyncState->count, mVSyncState->synthetic ? ", synthetic" : ""); } else { StringAppendF(&result, "none\n"); Loading
services/surfaceflinger/Scheduler/EventThread.h +0 −4 Original line number Diff line number Diff line Loading @@ -235,10 +235,6 @@ private: // VSYNC state of connected display. struct VSyncState { explicit VSyncState(PhysicalDisplayId displayId) : displayId(displayId) {} const PhysicalDisplayId displayId; // Number of VSYNC events since display was connected. uint32_t count = 0; Loading
services/surfaceflinger/Scheduler/VsyncSchedule.h +2 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ public: bool getPendingHardwareVsyncState() const REQUIRES(kMainThreadContext); PhysicalDisplayId getPhysicalDisplayId() const { return mId; } protected: using ControllerPtr = std::unique_ptr<VsyncController>; Loading