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

Commit 98e1ebc0 authored by Andy McFadden's avatar Andy McFadden Committed by Android (Google) Code Review
Browse files

Merge "Improve SurfaceFlinger PTS estimation"

parents 9471c697 41d67d7a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -508,4 +508,9 @@ void DispSync::resetErrorLocked() {
    }
}

nsecs_t DispSync::computeNextRefresh(int periodOffset) const {
    nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
    return (((now - mPhase) / mPeriod) + periodOffset + 1) * mPeriod + mPhase;
}

} // namespace android
+7 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public:
    bool addResyncSample(nsecs_t timestamp);
    void endResync();

    // The setPreiod method sets the vsync event model's period to a specific
    // The setPeriod method sets the vsync event model's period to a specific
    // value.  This should be used to prime the model when a display is first
    // turned on.  It should NOT be used after that.
    void setPeriod(nsecs_t period);
@@ -102,6 +102,12 @@ public:
    // DispSync object.
    status_t removeEventListener(const sp<Callback>& callback);

    // computeNextRefresh computes when the next refresh is expected to begin.
    // The periodOffset value can be used to move forward or backward; an
    // offset of zero is the next refresh, -1 is the previous refresh, 1 is
    // the refresh after next. etc.
    nsecs_t computeNextRefresh(int periodOffset) const;

private:

    void updateModelLocked();
+1 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ status_t HWComposer::setOutputBuffer(int32_t id, const sp<Fence>& acquireFence,
    return NO_ERROR;
}

sp<Fence> HWComposer::getLastRetireFence(int32_t id) {
sp<Fence> HWComposer::getLastRetireFence(int32_t id) const {
    if (uint32_t(id)>31 || !mAllocatedDisplayIDs.hasBit(id))
        return Fence::NO_FENCE;
    return mDisplayData[id].lastRetireFence;
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ public:
    // signal when the h/w composer is completely finished with the frame.
    // For physical displays, it is no longer being displayed. For virtual
    // displays, writes to the output buffer are complete.
    sp<Fence> getLastRetireFence(int32_t id);
    sp<Fence> getLastRetireFence(int32_t id) const;

    /*
     * Interface to hardware composer's layers functionality.
+2 −1
Original line number Diff line number Diff line
@@ -1095,7 +1095,8 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)

        Reject r(mDrawingState, getCurrentState(), recomputeVisibleRegions);

        status_t updateResult = mSurfaceFlingerConsumer->updateTexImage(&r);
        status_t updateResult = mSurfaceFlingerConsumer->updateTexImage(&r,
                mFlinger->mPrimaryDispSync);
        if (updateResult == BufferQueue::PRESENT_LATER) {
            // Producer doesn't want buffer to be displayed yet.  Signal a
            // layer update so we check again at the next opportunity.
Loading