aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-05-22 12:36:03 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-08 11:43:26 -0400
commit020178a1bcadf20b9d057988984f374c905d542e (patch)
tree18ce192d4d9719fad6416ede0a25bcc2d74fa622
parentb95af8bee524974768681b2b92235e1e1e21bf1a (diff)
drm: Add drm_crtc_vblank_waitqueue()
Add a small static inline helper to grab the vblank wait queue based on the drm_crtc. This is useful for drivers to do internal vblank waits using wait_event() & co. v2: Pimp commit message (Daniel) Add kernel doc (Daniel) Suggested-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--Documentation/DocBook/drm.tmpl1
-rw-r--r--include/drm/drmP.h11
2 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index 1d3756d3176c..972759489376 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -3400,6 +3400,7 @@ void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis>
3400 <sect2> 3400 <sect2>
3401 <title>Vertical Blanking and Interrupt Handling Functions Reference</title> 3401 <title>Vertical Blanking and Interrupt Handling Functions Reference</title>
3402!Edrivers/gpu/drm/drm_irq.c 3402!Edrivers/gpu/drm/drm_irq.c
3403!Iinclude/drm/drmP.h drm_crtc_vblank_waitqueue
3403 </sect2> 3404 </sect2>
3404 </sect1> 3405 </sect1>
3405 3406
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index d3d9be6b83ef..bb44c1ee557d 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1344,6 +1344,17 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
1344extern void drm_calc_timestamping_constants(struct drm_crtc *crtc, 1344extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
1345 const struct drm_display_mode *mode); 1345 const struct drm_display_mode *mode);
1346 1346
1347/**
1348 * drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC
1349 * @crtc: which CRTC's vblank waitqueue to retrieve
1350 *
1351 * This function returns a pointer to the vblank waitqueue for the CRTC.
1352 * Drivers can use this to implement vblank waits using wait_event() & co.
1353 */
1354static inline wait_queue_head_t *drm_crtc_vblank_waitqueue(struct drm_crtc *crtc)
1355{
1356 return &crtc->dev->vblank[drm_crtc_index(crtc)].queue;
1357}
1347 1358
1348/* Modesetting support */ 1359/* Modesetting support */
1349extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); 1360extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);