From 5da176f11fce24eeefbb572df41ea20bb040a75c Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 2 Apr 2021 16:38:14 -0700 Subject: Remove usages of the DISPLAY_JANK_REPORTED atom This was originally experimental code for Android 11, but we haven't used this and collection is not enabled. This also won't work well on Pixel devices because of complicated apex-reasons; SurfaceFlinger starts up before apex directories are mounted which means that SurfaceFlinger cannot depend on any apex modules, and we won't be able to resolve this dependency in Android 12. Bug: 184393731 Test: builds Change-Id: I563d41f38dd2d233f041dc52f823f12b4f5c5930 --- services/surfaceflinger/SurfaceFlinger.cpp | 44 ------------------------------ 1 file changed, 44 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index f7c9291b3c..605fef042d 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1769,10 +1769,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT if (frameMissed) { mFrameMissedCount++; mTimeStats->incrementMissedFrames(); - if (mMissedFrameJankCount == 0) { - mMissedFrameJankStart = systemTime(); - } - mMissedFrameJankCount++; } if (hwcFrameMissed) { @@ -1804,37 +1800,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(100ms).count(); - // ...but if it's larger than 1s then we missed the trace cutoff. - static constexpr nsecs_t kMaxJankyDuration = - std::chrono::duration_cast(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) { mTracingEnabled = mTracing.isEnabled(); mTracingEnabledChanged = false; @@ -1881,7 +1846,6 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT refreshNeeded |= mRepaintEverything; if (refreshNeeded && CC_LIKELY(mBootStage != BootStage::BOOTLOADER)) { - mLastJankDuration = jankDurationToUpload; // Signal a refresh if a transaction modified the window state, // a new buffer was latched, or if HWC has requested a full // repaint @@ -2209,14 +2173,6 @@ void SurfaceFlinger::postComposition() { const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); 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()) { return; } -- cgit v1.2.3-59-g8ed1b