drm/irq: Implement a generic vblank_wait function
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 25 Jul 2014 21:34:03 +0000 (23:34 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 11 Aug 2014 12:25:21 +0000 (14:25 +0200)
commite8450f51a4b39cfe0878b4aee339820b2bfff240
treeee6cf4685f8524bf47cf49911d61ba21c77a5b33
parent2a0d7cfd9482ca4c10a4d8794791760a6a7ce40c
drm/irq: Implement a generic vblank_wait function

As usual in both a crtc index and a struct drm_crtc * version.

The function assumes that no one drivers their display below 10Hz, and
it will complain if the vblank wait takes longer than that.

v2: Also check dev->max_vblank_counter since some drivers register a
fake get_vblank_counter function.

v3: Use drm_vblank_count instead of calling the low-level
->get_vblank_counter callback. That way we'll get the sw-cooked
counter for platforms without proper vblank support and so can ditch
the max_vblank_counter check again.

v4: Review from Michel Dänzer:
- Restore lost notes about v3:
- Spelling in kerneldoc.
- Inline wait_event condition.
- s/vblank_wait/wait_one_vblank/

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_irq.c
include/drm/drmP.h