Loading services/surfaceflinger/SurfaceFlinger.cpp +15 −8 Original line number Diff line number Diff line Loading @@ -1576,6 +1576,18 @@ void SurfaceFlinger::onMessageReceived(int32_t what) { ATRACE_CALL(); switch (what) { case MessageQueue::INVALIDATE: { bool frameMissed = mPreviousPresentFence != Fence::NO_FENCE && (mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled); bool hwcFrameMissed = mHadDeviceComposition && frameMissed; bool gpuFrameMissed = mHadClientComposition && frameMissed; ATRACE_INT("FrameMissed", static_cast<int>(frameMissed)); ATRACE_INT("HwcFrameMissed", static_cast<int>(hwcFrameMissed)); ATRACE_INT("GpuFrameMissed", static_cast<int>(gpuFrameMissed)); if (frameMissed) { mFrameMissedCount++; mTimeStats->incrementMissedFrames(); } if (mUseSmart90ForVideo) { // This call is made each time SF wakes up and creates a new frame. It is part // of video detection feature. Loading @@ -1586,14 +1598,6 @@ void SurfaceFlinger::onMessageReceived(int32_t what) { break; } bool frameMissed = mPreviousPresentFence != Fence::NO_FENCE && (mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled); bool hwcFrameMissed = !mHadClientComposition && frameMissed; if (frameMissed) { ATRACE_INT("FrameMissed", static_cast<int>(frameMissed)); mFrameMissedCount++; mTimeStats->incrementMissedFrames(); } // For now, only propagate backpressure when missing a hwc frame. if (hwcFrameMissed) { if (mPropagateBackpressure) { Loading Loading @@ -1674,11 +1678,14 @@ void SurfaceFlinger::handleMessageRefresh() { postComposition(); mHadClientComposition = false; mHadDeviceComposition = false; for (const auto& [token, displayDevice] : mDisplays) { auto display = displayDevice->getCompositionDisplay(); const auto displayId = display->getId(); mHadClientComposition = mHadClientComposition || getHwComposer().hasClientComposition(displayId); mHadDeviceComposition = mHadDeviceComposition || getHwComposer().hasDeviceComposition(displayId); } mVsyncModulator.onRefreshed(mHadClientComposition); Loading services/surfaceflinger/SurfaceFlinger.h +5 −0 Original line number Diff line number Diff line Loading @@ -970,7 +970,12 @@ private: // Tracks layers that need to update a display's dirty region. std::vector<sp<Layer>> mLayersPendingRefresh; sp<Fence> mPreviousPresentFence = Fence::NO_FENCE; // True if in the previous frame at least one layer was composed via the GPU. bool mHadClientComposition = false; // True if in the previous frame at least one layer was composed via HW Composer. // Note that it is possible for a frame to be composed via both client and device // composition, for example in the case of overlays. bool mHadDeviceComposition = false; enum class BootStage { BOOTLOADER, Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +15 −8 Original line number Diff line number Diff line Loading @@ -1576,6 +1576,18 @@ void SurfaceFlinger::onMessageReceived(int32_t what) { ATRACE_CALL(); switch (what) { case MessageQueue::INVALIDATE: { bool frameMissed = mPreviousPresentFence != Fence::NO_FENCE && (mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled); bool hwcFrameMissed = mHadDeviceComposition && frameMissed; bool gpuFrameMissed = mHadClientComposition && frameMissed; ATRACE_INT("FrameMissed", static_cast<int>(frameMissed)); ATRACE_INT("HwcFrameMissed", static_cast<int>(hwcFrameMissed)); ATRACE_INT("GpuFrameMissed", static_cast<int>(gpuFrameMissed)); if (frameMissed) { mFrameMissedCount++; mTimeStats->incrementMissedFrames(); } if (mUseSmart90ForVideo) { // This call is made each time SF wakes up and creates a new frame. It is part // of video detection feature. Loading @@ -1586,14 +1598,6 @@ void SurfaceFlinger::onMessageReceived(int32_t what) { break; } bool frameMissed = mPreviousPresentFence != Fence::NO_FENCE && (mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled); bool hwcFrameMissed = !mHadClientComposition && frameMissed; if (frameMissed) { ATRACE_INT("FrameMissed", static_cast<int>(frameMissed)); mFrameMissedCount++; mTimeStats->incrementMissedFrames(); } // For now, only propagate backpressure when missing a hwc frame. if (hwcFrameMissed) { if (mPropagateBackpressure) { Loading Loading @@ -1674,11 +1678,14 @@ void SurfaceFlinger::handleMessageRefresh() { postComposition(); mHadClientComposition = false; mHadDeviceComposition = false; for (const auto& [token, displayDevice] : mDisplays) { auto display = displayDevice->getCompositionDisplay(); const auto displayId = display->getId(); mHadClientComposition = mHadClientComposition || getHwComposer().hasClientComposition(displayId); mHadDeviceComposition = mHadDeviceComposition || getHwComposer().hasDeviceComposition(displayId); } mVsyncModulator.onRefreshed(mHadClientComposition); Loading
services/surfaceflinger/SurfaceFlinger.h +5 −0 Original line number Diff line number Diff line Loading @@ -970,7 +970,12 @@ private: // Tracks layers that need to update a display's dirty region. std::vector<sp<Layer>> mLayersPendingRefresh; sp<Fence> mPreviousPresentFence = Fence::NO_FENCE; // True if in the previous frame at least one layer was composed via the GPU. bool mHadClientComposition = false; // True if in the previous frame at least one layer was composed via HW Composer. // Note that it is possible for a frame to be composed via both client and device // composition, for example in the case of overlays. bool mHadDeviceComposition = false; enum class BootStage { BOOTLOADER, Loading