drm/atomic-helper: check that drivers call drm_crtc_vblank_off
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Oct 2017 15:27:14 +0000 (17:27 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 18 Oct 2017 08:23:25 +0000 (10:23 +0200)
commit84014b0a39eef6df4a26f8afabf2b50bd376d515
tree53fd383d009e8f8fe9170cf8bb362a7caeb1a0cd
parent81a7bd4a3f4497af81694c017b5b91253009f8cb
drm/atomic-helper: check that drivers call drm_crtc_vblank_off

At least when they have vblank support they need to call this, or the
vblank core will happily call into their crtc->enable_vblank callback
even when the crtc is off. Which leads to a boom when the clocks are
off on most hardware (besides the inevitable confusion in the
book-keeping).

The consistency checks in drm_vblank.c will then make sure that
vblank_off/on calls are balanced, and if drivers forget to re-enable
it all the commits will stall, so I think we're covered.

It'd be nice to be able to place this check outside of commit helpers,
but tha's not really possible (due to nonblocking commits and all
that). Placing it into atomic helpers should at least cover most
drivers.

Also note that vblank support is still optional (for virtual drivers,
which tend to not have this), check for that.

v2: Fixup the handling for vblank_put (Rob).

Cc: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171017152714.6849-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_atomic_helper.c