Commit cd19e52a authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm: Kick start vblank interrupts at drm_vblank_on()

If the user is interested in getting accurate vblank sequence
numbers all the time they may disable the vblank disable timer
entirely. In that case it seems appropriate to kick start the
vblank interrupts already from drm_vblank_on().

v2: Adapt to the drm_vblank_offdelay ==0 vs <0 changes
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 21da2700
...@@ -1126,9 +1126,12 @@ void drm_vblank_on(struct drm_device *dev, int crtc) ...@@ -1126,9 +1126,12 @@ void drm_vblank_on(struct drm_device *dev, int crtc)
vblank->last = vblank->last =
(dev->driver->get_vblank_counter(dev, crtc) - 1) & (dev->driver->get_vblank_counter(dev, crtc) - 1) &
dev->max_vblank_count; dev->max_vblank_count;
/*
/* re-enable interrupts if there's are users left */ * re-enable interrupts if there are users left, or the
if (atomic_read(&vblank->refcount) != 0) * user wishes vblank interrupts to be enabled all the time.
*/
if (atomic_read(&vblank->refcount) != 0 ||
(!dev->vblank_disable_immediate && drm_vblank_offdelay == 0))
WARN_ON(drm_vblank_enable(dev, crtc)); WARN_ON(drm_vblank_enable(dev, crtc));
spin_unlock_irqrestore(&dev->vbl_lock, irqflags); spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment