]> git.openfabrics.org - ~emulex/infiniband.git/commit
drm: Always reject drm_vblank_get() after drm_vblank_off()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 6 Aug 2014 11:49:44 +0000 (14:49 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 6 Aug 2014 20:39:22 +0000 (22:39 +0200)
commit7ffd7a68511c710b84db3548a1997fd2625f580a
treef8b84573cb571663684d8d527348064e08737e44
parent21d70354bba9965a098382fc4d7fb17e138111f3
drm: Always reject drm_vblank_get() after drm_vblank_off()

Make sure drm_vblank_get() never succeeds when called between
drm_vblank_off() and drm_vblank_on(). Borrow a trick from the
old drm_vblank_{pre,post}_modeset() functions and just bump
the refcount in drm_vblank_off() and drop it in drm_vblank_on().

When drm_vblank_get() encounters a >0 refcount and the vblank
interrupt is already disabled it will simply return -EINVAL.

Hopefully the use of inmodeset won't conflict badly with
drm_vblank_{pre,post}_modeset().

For i915 there's a window between drm_vblank_off() and marking the
crtc as inactive where the current code still allows drm_vblank_get().

v2: Describe what drm_vblank_get() does to explain how
    a simple refcount bump manages to fix things (Daniel)

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_irq.c