drm: export atomic wait_for_vblanks helper (v2)
authorRob Clark <robdclark@gmail.com>
Wed, 12 Nov 2014 00:38:59 +0000 (19:38 -0500)
committerDave Airlie <airlied@redhat.com>
Wed, 12 Nov 2014 07:55:44 +0000 (17:55 +1000)
v1: original
v2: danvet's kerneldoc nitpicks

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_atomic_helper.h

index ca839bd9bb0d2f398ca4d7e5ebbb6491b614cba4..fad2b932cf7243158fa257deb25bc0e63b26c18a 100644 (file)
@@ -754,8 +754,18 @@ static void wait_for_fences(struct drm_device *dev,
        }
 }
 
-static void
-wait_for_vblanks(struct drm_device *dev, struct drm_atomic_state *old_state)
+/**
+ * drm_atomic_helper_wait_for_vblanks - wait for vblank on crtcs
+ * @dev: DRM device
+ * @old_state: atomic state object with old state structures
+ *
+ * Helper to, after atomic commit, wait for vblanks on all effected
+ * crtcs (ie. before cleaning up old framebuffers using
+ * drm_atomic_helper_cleanup_planes())
+ */
+void
+drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
+               struct drm_atomic_state *old_state)
 {
        struct drm_crtc *crtc;
        struct drm_crtc_state *old_crtc_state;
@@ -800,6 +810,7 @@ wait_for_vblanks(struct drm_device *dev, struct drm_atomic_state *old_state)
                drm_crtc_vblank_put(crtc);
        }
 }
+EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks);
 
 /**
  * drm_atomic_helper_commit - commit validated state object
@@ -859,7 +870,7 @@ int drm_atomic_helper_commit(struct drm_device *dev,
 
        drm_atomic_helper_commit_post_planes(dev, state);
 
-       wait_for_vblanks(dev, state);
+       drm_atomic_helper_wait_for_vblanks(dev, state);
 
        drm_atomic_helper_cleanup_planes(dev, state);
 
index 67e3c4645ae0b3aadf329fa270aede0dc4e0a022..64b4e91b93bc0afaff5f81f09a10d23af424b785 100644 (file)
@@ -34,6 +34,9 @@ int drm_atomic_helper_commit(struct drm_device *dev,
                             struct drm_atomic_state *state,
                             bool async);
 
+void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
+                                       struct drm_atomic_state *old_state);
+
 void drm_atomic_helper_commit_pre_planes(struct drm_device *dev,
                                         struct drm_atomic_state *state);
 void drm_atomic_helper_commit_post_planes(struct drm_device *dev,