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

Commit e3d722e6 authored by Ady Abraham's avatar Ady Abraham Committed by android-build-merger
Browse files

SurfaceFlinger: clamp frame refresh duration to min refresh duration

am: cdd0f9d8

Change-Id: I3488b0d39e2ad75435b65cac6a254afccf00db02
parents 45c1fa79 cdd0f9d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -49,7 +49,7 @@ void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime) {
    mLastPresentTime = lastPresentTime;
    mLastPresentTime = lastPresentTime;
    // Ignore time diff that are too high - those are stale values
    // Ignore time diff that are too high - those are stale values
    if (timeDiff > OBSOLETE_TIME_EPSILON_NS.count()) return;
    if (timeDiff > OBSOLETE_TIME_EPSILON_NS.count()) return;
    const nsecs_t refreshDuration = (timeDiff > 0) ? timeDiff : mMinRefreshDuration;
    const nsecs_t refreshDuration = std::max(timeDiff, mMinRefreshDuration);
    const int fps = 1e9f / refreshDuration;
    const int fps = 1e9f / refreshDuration;
    mRefreshRateHistory.insertRefreshRate(fps);
    mRefreshRateHistory.insertRefreshRate(fps);
}
}