Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4475a071 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6478919 from 0050943c to rvc-release

Change-Id: Idef1c0d14ab7e4175bcbeb4940918ab12cd5ef94
parents a4901326 0050943c
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -130,12 +130,16 @@ std::optional<float> LayerInfoV2::calculateRefreshRateIfPossible() {
    // Now once we calculated the refresh rate we need to make sure that all the frames we captured
    // are evenly distributed and we don't calculate the average across some burst of frames.
    for (auto it = mFrameTimes.begin(); it != mFrameTimes.end() - 1; ++it) {
        const nsecs_t frameTimeDeltas = [&] {
            nsecs_t delta;
            if (it->presetTime == 0 || (it + 1)->presetTime == 0) {
            continue;
                delta = (it + 1)->queueTime - it->queueTime;
            } else {
                delta = (it + 1)->presetTime - it->presetTime;
            }
        const nsecs_t presentTimeDeltas =
                std::max(((it + 1)->presetTime - it->presetTime), mHighRefreshRatePeriod);
        if (std::abs(presentTimeDeltas - averageFrameTime) > 2 * averageFrameTime) {
            return std::max(delta, mHighRefreshRatePeriod);
        }();
        if (std::abs(frameTimeDeltas - averageFrameTime) > 2 * averageFrameTime) {
            return std::nullopt;
        }
    }
+5 −2
Original line number Diff line number Diff line
@@ -1919,9 +1919,12 @@ void SurfaceFlinger::onMessageInvalidate(nsecs_t expectedVSyncTime) NO_THREAD_SA
                ATRACE_NAME("Jank detected");
                ALOGD("Detected janky event. Missed frames: %d", mMissedFrameJankCount);
                const int32_t jankyDurationMillis = jankDuration / (1000 * 1000);
                {
                    ATRACE_NAME("Pushing to statsd");
                    android::util::stats_write(android::util::DISPLAY_JANK_REPORTED,
                                               jankyDurationMillis, mMissedFrameJankCount);
                }
            }

            // We either reported a jank event or we missed the trace
            // window, so clear counters here.