Loading services/surfaceflinger/Scheduler/Scheduler.cpp +20 −16 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ void Scheduler::addFramePresentTimeForLayer(const nsecs_t framePresentTime, bool } void Scheduler::incrementFrameCounter() { std::lock_guard<std::mutex> lock(mLayerHistoryLock); mLayerHistory.incrementCounter(); } Loading @@ -323,12 +324,14 @@ void Scheduler::updateFrameSkipping(const int64_t skipCount) { void Scheduler::determineLayerTimestampStats(const std::string layerName, const nsecs_t framePresentTime) { mLayerHistory.insert(layerName, framePresentTime); std::vector<int64_t> differencesMs; std::string differencesText = ""; { std::lock_guard<std::mutex> lock(mLayerHistoryLock); mLayerHistory.insert(layerName, framePresentTime); // Traverse through the layer history, and determine the differences in present times. nsecs_t newestPresentTime = framePresentTime; std::string differencesText = ""; for (int i = 1; i < mLayerHistory.getSize(); i++) { std::unordered_map<std::string, nsecs_t> layers = mLayerHistory.get(i); for (auto layer : layers) { Loading @@ -344,6 +347,7 @@ void Scheduler::determineLayerTimestampStats(const std::string layerName, newestPresentTime = layer.second; } } } ALOGV("Layer %s timestamp intervals: %s", layerName.c_str(), differencesText.c_str()); if (!differencesMs.empty()) { Loading services/surfaceflinger/Scheduler/Scheduler.h +4 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,10 @@ private: std::array<int64_t, scheduler::ARRAY_SIZE> mTimeDifferences{}; size_t mCounter = 0; LayerHistory mLayerHistory; // DetermineLayerTimestampStats is called from BufferQueueLayer::onFrameAvailable which // can run on any thread, and cause failure. std::mutex mLayerHistoryLock; LayerHistory mLayerHistory GUARDED_BY(mLayerHistoryLock); // Timer that records time between requests for next vsync. If the time is higher than a given // interval, a callback is fired. Set this variable to >0 to use this feature. Loading Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +20 −16 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ void Scheduler::addFramePresentTimeForLayer(const nsecs_t framePresentTime, bool } void Scheduler::incrementFrameCounter() { std::lock_guard<std::mutex> lock(mLayerHistoryLock); mLayerHistory.incrementCounter(); } Loading @@ -323,12 +324,14 @@ void Scheduler::updateFrameSkipping(const int64_t skipCount) { void Scheduler::determineLayerTimestampStats(const std::string layerName, const nsecs_t framePresentTime) { mLayerHistory.insert(layerName, framePresentTime); std::vector<int64_t> differencesMs; std::string differencesText = ""; { std::lock_guard<std::mutex> lock(mLayerHistoryLock); mLayerHistory.insert(layerName, framePresentTime); // Traverse through the layer history, and determine the differences in present times. nsecs_t newestPresentTime = framePresentTime; std::string differencesText = ""; for (int i = 1; i < mLayerHistory.getSize(); i++) { std::unordered_map<std::string, nsecs_t> layers = mLayerHistory.get(i); for (auto layer : layers) { Loading @@ -344,6 +347,7 @@ void Scheduler::determineLayerTimestampStats(const std::string layerName, newestPresentTime = layer.second; } } } ALOGV("Layer %s timestamp intervals: %s", layerName.c_str(), differencesText.c_str()); if (!differencesMs.empty()) { Loading
services/surfaceflinger/Scheduler/Scheduler.h +4 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,10 @@ private: std::array<int64_t, scheduler::ARRAY_SIZE> mTimeDifferences{}; size_t mCounter = 0; LayerHistory mLayerHistory; // DetermineLayerTimestampStats is called from BufferQueueLayer::onFrameAvailable which // can run on any thread, and cause failure. std::mutex mLayerHistoryLock; LayerHistory mLayerHistory GUARDED_BY(mLayerHistoryLock); // Timer that records time between requests for next vsync. If the time is higher than a given // interval, a callback is fired. Set this variable to >0 to use this feature. Loading