backends/drm: fix frame scheduling with pageflip timestamps in the future
This commit is contained in:
parent
028dd552cf
commit
4b49ca7751
1 changed files with 2 additions and 1 deletions
|
@ -226,7 +226,8 @@ bool DrmCommitThread::pageflipsPending()
|
||||||
|
|
||||||
TimePoint DrmCommitThread::estimateNextVblank(TimePoint now) const
|
TimePoint DrmCommitThread::estimateNextVblank(TimePoint now) const
|
||||||
{
|
{
|
||||||
const uint64_t pageflipsSince = (now - m_lastPageflip) / m_minVblankInterval;
|
// the pageflip timestamp may be in the future
|
||||||
|
const uint64_t pageflipsSince = now >= m_lastPageflip ? (now - m_lastPageflip) / m_minVblankInterval : 0;
|
||||||
return m_lastPageflip + m_minVblankInterval * (pageflipsSince + 1);
|
return m_lastPageflip + m_minVblankInterval * (pageflipsSince + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue