Loading services/surfaceflinger/Android.bp +0 −1 Original line number Original line Diff line number Diff line Loading @@ -60,7 +60,6 @@ cc_defaults { "libnativewindow", "libnativewindow", "libprocessgroup", "libprocessgroup", "libprotobuf-cpp-lite", "libprotobuf-cpp-lite", "libstatslog", "libsync", "libsync", "libtimestats", "libtimestats", "libui", "libui", Loading services/surfaceflinger/SurfaceFlinger.cpp +0 −44 Original line number Original line Diff line number Diff line Loading @@ -1814,10 +1814,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT if (frameMissed) { if (frameMissed) { mFrameMissedCount++; mFrameMissedCount++; mTimeStats->incrementMissedFrames(); mTimeStats->incrementMissedFrames(); if (mMissedFrameJankCount == 0) { mMissedFrameJankStart = systemTime(); } mMissedFrameJankCount++; } } if (hwcFrameMissed) { if (hwcFrameMissed) { Loading Loading @@ -1849,37 +1845,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT } } } } // Our jank window is always at least 100ms since we missed a // frame... static constexpr nsecs_t kMinJankyDuration = std::chrono::duration_cast<std::chrono::nanoseconds>(100ms).count(); // ...but if it's larger than 1s then we missed the trace cutoff. static constexpr nsecs_t kMaxJankyDuration = std::chrono::duration_cast<std::chrono::nanoseconds>(1s).count(); nsecs_t jankDurationToUpload = -1; // If we're in a user build then don't push any atoms if (!mIsUserBuild && mMissedFrameJankCount > 0) { const auto display = ON_MAIN_THREAD(getDefaultDisplayDeviceLocked()); // Only report jank when the display is on, as displays in DOZE // power mode may operate at a different frame rate than is // reported in their config, which causes noticeable (but less // severe) jank. if (display && display->getPowerMode() == hal::PowerMode::ON) { const nsecs_t currentTime = systemTime(); const nsecs_t jankDuration = currentTime - mMissedFrameJankStart; if (jankDuration > kMinJankyDuration && jankDuration < kMaxJankyDuration) { jankDurationToUpload = jankDuration; } // We either reported a jank event or we missed the trace // window, so clear counters here. if (jankDuration > kMinJankyDuration) { mMissedFrameJankCount = 0; mMissedFrameJankStart = 0; } } } if (mTracingEnabledChanged) { if (mTracingEnabledChanged) { mTracingEnabled = mTracing.isEnabled(); mTracingEnabled = mTracing.isEnabled(); mTracingEnabledChanged = false; mTracingEnabledChanged = false; Loading Loading @@ -1926,7 +1891,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT refreshNeeded |= mRepaintEverything; refreshNeeded |= mRepaintEverything; if (refreshNeeded && CC_LIKELY(mBootStage != BootStage::BOOTLOADER)) { if (refreshNeeded && CC_LIKELY(mBootStage != BootStage::BOOTLOADER)) { mLastJankDuration = jankDurationToUpload; // Signal a refresh if a transaction modified the window state, // Signal a refresh if a transaction modified the window state, // a new buffer was latched, or if HWC has requested a full // a new buffer was latched, or if HWC has requested a full // repaint // repaint Loading Loading @@ -2302,14 +2266,6 @@ void SurfaceFlinger::postComposition() { const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections); mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections); if (mLastJankDuration > 0) { ATRACE_NAME("Jank detected"); const int32_t jankyDurationMillis = mLastJankDuration / (1000 * 1000); android::util::stats_write(android::util::DISPLAY_JANK_REPORTED, jankyDurationMillis, mMissedFrameJankCount); mLastJankDuration = -1; } if (isDisplayConnected && !display->isPoweredOn()) { if (isDisplayConnected && !display->isPoweredOn()) { return; return; } } Loading services/surfaceflinger/SurfaceFlinger.h +0 −7 Original line number Original line Diff line number Diff line Loading @@ -1387,13 +1387,6 @@ private: // be any issues with a raw pointer referencing an invalid object. // be any issues with a raw pointer referencing an invalid object. std::unordered_set<Layer*> mOffscreenLayers; std::unordered_set<Layer*> mOffscreenLayers; // Fields tracking the current jank event: when it started and how many // janky frames there are. nsecs_t mMissedFrameJankStart = 0; int32_t mMissedFrameJankCount = 0; // Positive if jank should be uploaded in postComposition nsecs_t mLastJankDuration = -1; int mFrameRateFlexibilityTokenCount = 0; int mFrameRateFlexibilityTokenCount = 0; sp<IBinder> mDebugFrameRateFlexibilityToken; sp<IBinder> mDebugFrameRateFlexibilityToken; Loading Loading
services/surfaceflinger/Android.bp +0 −1 Original line number Original line Diff line number Diff line Loading @@ -60,7 +60,6 @@ cc_defaults { "libnativewindow", "libnativewindow", "libprocessgroup", "libprocessgroup", "libprotobuf-cpp-lite", "libprotobuf-cpp-lite", "libstatslog", "libsync", "libsync", "libtimestats", "libtimestats", "libui", "libui", Loading
services/surfaceflinger/SurfaceFlinger.cpp +0 −44 Original line number Original line Diff line number Diff line Loading @@ -1814,10 +1814,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT if (frameMissed) { if (frameMissed) { mFrameMissedCount++; mFrameMissedCount++; mTimeStats->incrementMissedFrames(); mTimeStats->incrementMissedFrames(); if (mMissedFrameJankCount == 0) { mMissedFrameJankStart = systemTime(); } mMissedFrameJankCount++; } } if (hwcFrameMissed) { if (hwcFrameMissed) { Loading Loading @@ -1849,37 +1845,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT } } } } // Our jank window is always at least 100ms since we missed a // frame... static constexpr nsecs_t kMinJankyDuration = std::chrono::duration_cast<std::chrono::nanoseconds>(100ms).count(); // ...but if it's larger than 1s then we missed the trace cutoff. static constexpr nsecs_t kMaxJankyDuration = std::chrono::duration_cast<std::chrono::nanoseconds>(1s).count(); nsecs_t jankDurationToUpload = -1; // If we're in a user build then don't push any atoms if (!mIsUserBuild && mMissedFrameJankCount > 0) { const auto display = ON_MAIN_THREAD(getDefaultDisplayDeviceLocked()); // Only report jank when the display is on, as displays in DOZE // power mode may operate at a different frame rate than is // reported in their config, which causes noticeable (but less // severe) jank. if (display && display->getPowerMode() == hal::PowerMode::ON) { const nsecs_t currentTime = systemTime(); const nsecs_t jankDuration = currentTime - mMissedFrameJankStart; if (jankDuration > kMinJankyDuration && jankDuration < kMaxJankyDuration) { jankDurationToUpload = jankDuration; } // We either reported a jank event or we missed the trace // window, so clear counters here. if (jankDuration > kMinJankyDuration) { mMissedFrameJankCount = 0; mMissedFrameJankStart = 0; } } } if (mTracingEnabledChanged) { if (mTracingEnabledChanged) { mTracingEnabled = mTracing.isEnabled(); mTracingEnabled = mTracing.isEnabled(); mTracingEnabledChanged = false; mTracingEnabledChanged = false; Loading Loading @@ -1926,7 +1891,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT refreshNeeded |= mRepaintEverything; refreshNeeded |= mRepaintEverything; if (refreshNeeded && CC_LIKELY(mBootStage != BootStage::BOOTLOADER)) { if (refreshNeeded && CC_LIKELY(mBootStage != BootStage::BOOTLOADER)) { mLastJankDuration = jankDurationToUpload; // Signal a refresh if a transaction modified the window state, // Signal a refresh if a transaction modified the window state, // a new buffer was latched, or if HWC has requested a full // a new buffer was latched, or if HWC has requested a full // repaint // repaint Loading Loading @@ -2302,14 +2266,6 @@ void SurfaceFlinger::postComposition() { const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections); mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections); if (mLastJankDuration > 0) { ATRACE_NAME("Jank detected"); const int32_t jankyDurationMillis = mLastJankDuration / (1000 * 1000); android::util::stats_write(android::util::DISPLAY_JANK_REPORTED, jankyDurationMillis, mMissedFrameJankCount); mLastJankDuration = -1; } if (isDisplayConnected && !display->isPoweredOn()) { if (isDisplayConnected && !display->isPoweredOn()) { return; return; } } Loading
services/surfaceflinger/SurfaceFlinger.h +0 −7 Original line number Original line Diff line number Diff line Loading @@ -1387,13 +1387,6 @@ private: // be any issues with a raw pointer referencing an invalid object. // be any issues with a raw pointer referencing an invalid object. std::unordered_set<Layer*> mOffscreenLayers; std::unordered_set<Layer*> mOffscreenLayers; // Fields tracking the current jank event: when it started and how many // janky frames there are. nsecs_t mMissedFrameJankStart = 0; int32_t mMissedFrameJankCount = 0; // Positive if jank should be uploaded in postComposition nsecs_t mLastJankDuration = -1; int mFrameRateFlexibilityTokenCount = 0; int mFrameRateFlexibilityTokenCount = 0; sp<IBinder> mDebugFrameRateFlexibilityToken; sp<IBinder> mDebugFrameRateFlexibilityToken; Loading