Loading services/surfaceflinger/DispSync.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -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 services/surfaceflinger/DispSync.h +7 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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(); Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading services/surfaceflinger/DisplayHardware/HWComposer.h +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading services/surfaceflinger/Layer.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
services/surfaceflinger/DispSync.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -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
services/surfaceflinger/DispSync.h +7 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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(); Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
services/surfaceflinger/DisplayHardware/HWComposer.h +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading
services/surfaceflinger/Layer.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -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