sna/dri2: Apply a margin of error to the sequence wrap detection
If we have a queue of events, we may set the msc from a recent vblank query only to then process an older vblank event and declare the counter wrapped. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
00d9396f6b
commit
1f237bb6db
|
|
@ -472,8 +472,12 @@ extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap,
|
|||
static inline uint64_t msc64(struct sna *sna, int pipe, uint32_t seq)
|
||||
{
|
||||
assert((unsigned)pipe < MAX_PIPES);
|
||||
if (seq < sna->mode.msc[pipe].last)
|
||||
if ((int32_t)(seq - sna->mode.msc[pipe].last) < -0x40000000) {
|
||||
sna->mode.msc[pipe].wraps++;
|
||||
DBG(("%s: pipe=%d wrapped was %u, now %u, wraps=%u\n",
|
||||
__FUNCTION__, pipe, sna->mode.msc[pipe].last, seq,
|
||||
sna->mode.msc[pipe].wraps));
|
||||
}
|
||||
sna->mode.msc[pipe].last = seq;
|
||||
return (uint64_t)sna->mode.msc[pipe].wraps << 32 | seq;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue