drm: WARN if drm_handle_vblank is called errornously
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 22 Feb 2015 14:11:20 +0000 (15:11 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 23 Feb 2015 09:54:29 +0000 (10:54 +0100)
commitee3c7795e54f405fbd278b17d2e0cd8ca1c92b69
tree4825b0897afd682e1aaaf53473294c9f978dccff
parent3bff93d64cf59f0e4547d5893adccc3925a14380
drm: WARN if drm_handle_vblank is called errornously

KMS drivers are in full control of their irq and vblank handling, if
they get a vblank interrupt before drm_vblank_init or after
drm_vblank_cleanup that's just a driver bug.

For ums driver there's only r128 and radeon which support vblank, and
they call drm_vblank_init in their driver load functions. Which again
means that userspace can do whatever it wants with interrupt, vblank
structures will always be there.

So this should never happen, let's catch driver issues with a WARN_ON.
Motivated by some discussions with Imre.

v2: Use WARN_ON_ONCE as suggested by Imre.

Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/drm_irq.c