diff options
-rw-r--r-- | linux-core/drm_irq.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index e2f106e4..ccb3ca89 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -360,9 +360,16 @@ void drm_update_vblank_count(struct drm_device *dev, int crtc) cur_vblank = dev->driver->get_vblank_counter(dev, crtc); spin_lock_irqsave(&dev->vbl_lock, irqflags); if (cur_vblank < dev->last_vblank[crtc]) { - diff = dev->max_vblank_count - - dev->last_vblank[crtc]; - diff += cur_vblank; + if (cur_vblank == dev->last_vblank[crtc] - 1) { + diff = 0; + } else { + diff = dev->max_vblank_count - + dev->last_vblank[crtc]; + diff += cur_vblank; + } + + DRM_DEBUG("last_vblank[%d]=0x%x, cur_vblank=0x%x => diff=0x%x\n", + crtc, dev->last_vblank[crtc], cur_vblank, diff); } else { diff = cur_vblank - dev->last_vblank[crtc]; } |