Loading services/surfaceflinger/BufferQueueLayer.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -397,9 +397,11 @@ void BufferQueueLayer::fakeVsync() { void BufferQueueLayer::onFrameAvailable(const BufferItem& item) { // Add this buffer from our internal queue tracker { // Autolock scope // Report the requested present time to the Scheduler. mFlinger->mScheduler->addFramePresentTimeForLayer(item.mTimestamp, item.mIsAutoTimestamp, mName.c_str()); if (mFlinger->mUse90Hz && mFlinger->mUseSmart90ForVideo) { // Report the requested present time to the Scheduler, if the feature is turned on. mFlinger->mScheduler->addFramePresentTimeForLayer(item.mTimestamp, item.mIsAutoTimestamp, mName.c_str()); } Mutex::Autolock lock(mQueueItemLock); // Reset the frame number tracker when we receive the first buffer after Loading services/surfaceflinger/SurfaceFlinger.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -396,6 +396,9 @@ SurfaceFlinger::SurfaceFlinger(surfaceflinger::Factory& factory) property_get("debug.sf.use_90Hz", value, "0"); mUse90Hz = atoi(value); property_get("debug.sf.use_smart_90_for_video", value, "0"); mUseSmart90ForVideo = atoi(value); const auto [early, gl, late] = mPhaseOffsets->getCurrentOffsets(); mVsyncModulator.setPhaseOffsets(early, gl, late); Loading Loading @@ -1595,8 +1598,11 @@ void SurfaceFlinger::onMessageReceived(int32_t what) { break; } // This call is made each time SF wakes up and creates a new frame. if (mUse90Hz && mUseSmart90ForVideo) { // This call is made each time SF wakes up and creates a new frame. It is part // of video detection feature. mScheduler->incrementFrameCounter(); } bool frameMissed = !mHadClientComposition && mPreviousPresentFence != Fence::NO_FENCE && (mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled); Loading Loading @@ -4465,7 +4471,9 @@ void SurfaceFlinger::dumpVSync(std::string& result) const { " present offset: %9" PRId64 " ns\t VSYNC period: %9" PRId64 " ns\n\n", dispSyncPresentTimeOffset, getVsyncPeriod()); StringAppendF(&result, "Scheduler enabled. 90Hz feature: %s\n\n", mUse90Hz ? "on" : "off"); StringAppendF(&result, "Scheduler enabled. 90Hz feature: %s\n", mUse90Hz ? "on" : "off"); StringAppendF(&result, "+ Smart 90 for video detection: %s\n\n", mUseSmart90ForVideo ? "on" : "off"); mScheduler->dump(mAppConnectionHandle, result); } Loading services/surfaceflinger/SurfaceFlinger.h +1 −0 Original line number Diff line number Diff line Loading @@ -1075,6 +1075,7 @@ private: * Scheduler */ bool mUse90Hz = false; bool mUseSmart90ForVideo = false; std::unique_ptr<Scheduler> mScheduler; sp<Scheduler::ConnectionHandle> mAppConnectionHandle; sp<Scheduler::ConnectionHandle> mSfConnectionHandle; Loading Loading
services/surfaceflinger/BufferQueueLayer.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -397,9 +397,11 @@ void BufferQueueLayer::fakeVsync() { void BufferQueueLayer::onFrameAvailable(const BufferItem& item) { // Add this buffer from our internal queue tracker { // Autolock scope // Report the requested present time to the Scheduler. mFlinger->mScheduler->addFramePresentTimeForLayer(item.mTimestamp, item.mIsAutoTimestamp, mName.c_str()); if (mFlinger->mUse90Hz && mFlinger->mUseSmart90ForVideo) { // Report the requested present time to the Scheduler, if the feature is turned on. mFlinger->mScheduler->addFramePresentTimeForLayer(item.mTimestamp, item.mIsAutoTimestamp, mName.c_str()); } Mutex::Autolock lock(mQueueItemLock); // Reset the frame number tracker when we receive the first buffer after Loading
services/surfaceflinger/SurfaceFlinger.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -396,6 +396,9 @@ SurfaceFlinger::SurfaceFlinger(surfaceflinger::Factory& factory) property_get("debug.sf.use_90Hz", value, "0"); mUse90Hz = atoi(value); property_get("debug.sf.use_smart_90_for_video", value, "0"); mUseSmart90ForVideo = atoi(value); const auto [early, gl, late] = mPhaseOffsets->getCurrentOffsets(); mVsyncModulator.setPhaseOffsets(early, gl, late); Loading Loading @@ -1595,8 +1598,11 @@ void SurfaceFlinger::onMessageReceived(int32_t what) { break; } // This call is made each time SF wakes up and creates a new frame. if (mUse90Hz && mUseSmart90ForVideo) { // This call is made each time SF wakes up and creates a new frame. It is part // of video detection feature. mScheduler->incrementFrameCounter(); } bool frameMissed = !mHadClientComposition && mPreviousPresentFence != Fence::NO_FENCE && (mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled); Loading Loading @@ -4465,7 +4471,9 @@ void SurfaceFlinger::dumpVSync(std::string& result) const { " present offset: %9" PRId64 " ns\t VSYNC period: %9" PRId64 " ns\n\n", dispSyncPresentTimeOffset, getVsyncPeriod()); StringAppendF(&result, "Scheduler enabled. 90Hz feature: %s\n\n", mUse90Hz ? "on" : "off"); StringAppendF(&result, "Scheduler enabled. 90Hz feature: %s\n", mUse90Hz ? "on" : "off"); StringAppendF(&result, "+ Smart 90 for video detection: %s\n\n", mUseSmart90ForVideo ? "on" : "off"); mScheduler->dump(mAppConnectionHandle, result); } Loading
services/surfaceflinger/SurfaceFlinger.h +1 −0 Original line number Diff line number Diff line Loading @@ -1075,6 +1075,7 @@ private: * Scheduler */ bool mUse90Hz = false; bool mUseSmart90ForVideo = false; std::unique_ptr<Scheduler> mScheduler; sp<Scheduler::ConnectionHandle> mAppConnectionHandle; sp<Scheduler::ConnectionHandle> mSfConnectionHandle; Loading