diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index 75e53da..4576983 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -363,7 +363,7 @@ void drm_update_vblank_count(struct drm_device *dev, int crtc) { u32 cur_vblank, diff; - if (dev->vblank_suspend[crtc]) + if (dev->vblank_suspend[crtc] || dev->vblank_enabled[crtc]) return; /* @@ -395,6 +395,7 @@ void drm_update_vblank_count(struct drm_device *dev, int crtc) atomic_add(diff, &dev->_vblank_count[crtc]); } +EXPORT_SYMBOL(drm_update_vblank_count); /** * drm_vblank_get - get a reference count on vblank events @@ -420,8 +421,8 @@ int drm_vblank_get(struct drm_device *dev, int crtc) if (ret) atomic_dec(&dev->vblank_refcount[crtc]); else { - dev->vblank_enabled[crtc] = 1; drm_update_vblank_count(dev, crtc); + dev->vblank_enabled[crtc] = 1; } } spin_unlock_irqrestore(&dev->vbl_lock, irqflags); @@ -549,6 +550,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, if (crtc >= dev->num_crtcs) return -EINVAL; + drm_update_vblank_count(dev, crtc); seq = drm_vblank_count(dev, crtc); switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) { diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index ecb2d7f..713759e 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -769,6 +769,7 @@ int i915_vblank_swap(struct drm_device *dev, void *data, DRM_SPINUNLOCK_IRQRESTORE(&dev->drw_lock, irqflags); + drm_update_vblank_count(dev, pipe); curseq = drm_vblank_count(dev, pipe); if (seqtype == _DRM_VBLANK_RELATIVE)