Loading services/surfaceflinger/BufferQueueLayer.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -400,11 +400,9 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) { ATRACE_CALL(); // Add this buffer from our internal queue tracker { // Autolock scope if (mFlinger->mUseSmart90ForVideo) { const nsecs_t presentTime = item.mIsAutoTimestamp ? 0 : item.mTimestamp; mFlinger->mScheduler->recordLayerHistory(this, presentTime, item.mHdrMetadata.validTypes != 0); } const bool isHDR = item.mHdrMetadata.validTypes != 0; mFlinger->mScheduler->recordLayerHistory(this, presentTime, isHDR); Mutex::Autolock lock(mQueueItemLock); // Reset the frame number tracker when we receive the first buffer after Loading services/surfaceflinger/BufferStateLayer.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -247,11 +247,8 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer, nsecs_t postTi FrameTracer::FrameEvent::POST); mCurrentState.desiredPresentTime = desiredPresentTime; if (mFlinger->mUseSmart90ForVideo) { const nsecs_t presentTime = (desiredPresentTime == -1) ? 0 : desiredPresentTime; mFlinger->mScheduler->recordLayerHistory(this, presentTime, mCurrentState.hdrMetadata.validTypes != 0); } const bool isHDR = mCurrentState.hdrMetadata.validTypes != 0; mFlinger->mScheduler->recordLayerHistory(this, desiredPresentTime, isHDR); return true; } Loading services/surfaceflinger/Scheduler/LayerHistory.h +2 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ namespace android { class Layer; class TestableScheduler; namespace scheduler { Loading Loading @@ -59,6 +60,7 @@ public: private: friend class LayerHistoryTest; friend TestableScheduler; using LayerPair = std::pair<wp<Layer>, std::unique_ptr<LayerInfo>>; using LayerInfos = std::vector<LayerPair>; Loading services/surfaceflinger/Scheduler/LayerInfo.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ LayerInfo::LayerInfo(float lowRefreshRate, float highRefreshRate) : mLowRefreshRate(lowRefreshRate), mHighRefreshRate(highRefreshRate) {} void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now) { lastPresentTime = std::max(lastPresentTime, static_cast<nsecs_t>(0)); // Buffers can come with a present time far in the future. That keeps them relevant. mLastUpdatedTime = std::max(lastPresentTime, now); mPresentTimeHistory.insertPresentTime(mLastUpdatedTime); Loading services/surfaceflinger/Scheduler/OneShotTimer.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "OneShotTimer.h" #include <chrono> #include <sstream> #include <thread> namespace android { Loading Loading @@ -98,7 +99,7 @@ void OneShotTimer::loop() { mTimeoutCallback(); } } } // namespace scheduler } void OneShotTimer::reset() { { Loading @@ -108,5 +109,11 @@ void OneShotTimer::reset() { mCondition.notify_all(); } std::string OneShotTimer::dump() const { std::ostringstream stream; stream << mInterval.count() << " ms"; return stream.str(); } } // namespace scheduler } // namespace android Loading
services/surfaceflinger/BufferQueueLayer.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -400,11 +400,9 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) { ATRACE_CALL(); // Add this buffer from our internal queue tracker { // Autolock scope if (mFlinger->mUseSmart90ForVideo) { const nsecs_t presentTime = item.mIsAutoTimestamp ? 0 : item.mTimestamp; mFlinger->mScheduler->recordLayerHistory(this, presentTime, item.mHdrMetadata.validTypes != 0); } const bool isHDR = item.mHdrMetadata.validTypes != 0; mFlinger->mScheduler->recordLayerHistory(this, presentTime, isHDR); Mutex::Autolock lock(mQueueItemLock); // Reset the frame number tracker when we receive the first buffer after Loading
services/surfaceflinger/BufferStateLayer.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -247,11 +247,8 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer, nsecs_t postTi FrameTracer::FrameEvent::POST); mCurrentState.desiredPresentTime = desiredPresentTime; if (mFlinger->mUseSmart90ForVideo) { const nsecs_t presentTime = (desiredPresentTime == -1) ? 0 : desiredPresentTime; mFlinger->mScheduler->recordLayerHistory(this, presentTime, mCurrentState.hdrMetadata.validTypes != 0); } const bool isHDR = mCurrentState.hdrMetadata.validTypes != 0; mFlinger->mScheduler->recordLayerHistory(this, desiredPresentTime, isHDR); return true; } Loading
services/surfaceflinger/Scheduler/LayerHistory.h +2 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ namespace android { class Layer; class TestableScheduler; namespace scheduler { Loading Loading @@ -59,6 +60,7 @@ public: private: friend class LayerHistoryTest; friend TestableScheduler; using LayerPair = std::pair<wp<Layer>, std::unique_ptr<LayerInfo>>; using LayerInfos = std::vector<LayerPair>; Loading
services/surfaceflinger/Scheduler/LayerInfo.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ LayerInfo::LayerInfo(float lowRefreshRate, float highRefreshRate) : mLowRefreshRate(lowRefreshRate), mHighRefreshRate(highRefreshRate) {} void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now) { lastPresentTime = std::max(lastPresentTime, static_cast<nsecs_t>(0)); // Buffers can come with a present time far in the future. That keeps them relevant. mLastUpdatedTime = std::max(lastPresentTime, now); mPresentTimeHistory.insertPresentTime(mLastUpdatedTime); Loading
services/surfaceflinger/Scheduler/OneShotTimer.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "OneShotTimer.h" #include <chrono> #include <sstream> #include <thread> namespace android { Loading Loading @@ -98,7 +99,7 @@ void OneShotTimer::loop() { mTimeoutCallback(); } } } // namespace scheduler } void OneShotTimer::reset() { { Loading @@ -108,5 +109,11 @@ void OneShotTimer::reset() { mCondition.notify_all(); } std::string OneShotTimer::dump() const { std::ostringstream stream; stream << mInterval.count() << " ms"; return stream.str(); } } // namespace scheduler } // namespace android