Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -2674,12 +2674,15 @@ void SurfaceFlinger::composite(TimePoint frameTime, VsyncId vsyncId) mTimeStats->recordFrameDuration(frameTime.ns(), systemTime()); // Send a power hint hint after presentation is finished // Send a power hint after presentation is finished. if (mPowerHintSessionEnabled) { const nsecs_t pastPresentTime = getPreviousPresentFence(frameTime, vsyncPeriod)->getSignalTime(); // Now that the current frame has been presented above, PowerAdvisor needs the present time // of the previous frame (whose fence is signaled by now) to determine how long the HWC had // waited on that fence to retire before presenting. const auto& previousPresentFence = mPreviousPresentFences[0].fenceTime; mPowerAdvisor->setSfPresentTiming(TimePoint::fromNs(pastPresentTime), TimePoint::now()); mPowerAdvisor->setSfPresentTiming(TimePoint::fromNs(previousPresentFence->getSignalTime()), TimePoint::now()); mPowerAdvisor->reportActualWorkDuration(); } Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -2674,12 +2674,15 @@ void SurfaceFlinger::composite(TimePoint frameTime, VsyncId vsyncId) mTimeStats->recordFrameDuration(frameTime.ns(), systemTime()); // Send a power hint hint after presentation is finished // Send a power hint after presentation is finished. if (mPowerHintSessionEnabled) { const nsecs_t pastPresentTime = getPreviousPresentFence(frameTime, vsyncPeriod)->getSignalTime(); // Now that the current frame has been presented above, PowerAdvisor needs the present time // of the previous frame (whose fence is signaled by now) to determine how long the HWC had // waited on that fence to retire before presenting. const auto& previousPresentFence = mPreviousPresentFences[0].fenceTime; mPowerAdvisor->setSfPresentTiming(TimePoint::fromNs(pastPresentTime), TimePoint::now()); mPowerAdvisor->setSfPresentTiming(TimePoint::fromNs(previousPresentFence->getSignalTime()), TimePoint::now()); mPowerAdvisor->reportActualWorkDuration(); } Loading