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

Commit 29e307db authored by Ram Indani's avatar Ram Indani Committed by Sally Qi
Browse files

DO NOT MERGE Early return for getPresentFenceShift

When minFrameInterval is 0 then return the shift was 0.

Bug: 365442861
Merged-In: I00c1795c11f1dc38e6b4ce3ff49fae79e265f25c
Change-Id: I00c1795c11f1dc38e6b4ce3ff49fae79e265f25c
parent 357c2ed3
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -134,8 +134,11 @@ private:
    }
    }


    size_t getPresentFenceShift(Period minFramePeriod) const {
    size_t getPresentFenceShift(Period minFramePeriod) const {
        const bool isTwoVsyncsAhead = targetsVsyncsAhead<2>(minFramePeriod);
        size_t shift = 0;
        size_t shift = 0;
        if (minFramePeriod.ns() == 0) {
            return shift;
        }
        const bool isTwoVsyncsAhead = targetsVsyncsAhead<2>(minFramePeriod);
        if (isTwoVsyncsAhead) {
        if (isTwoVsyncsAhead) {
            shift = static_cast<size_t>(expectedFrameDuration().ns() / minFramePeriod.ns());
            shift = static_cast<size_t>(expectedFrameDuration().ns() / minFramePeriod.ns());
            if (shift >= mPresentFences.size()) {
            if (shift >= mPresentFences.size()) {