Signed-off-by: Rob Clark <robdclark@xxxxxxxxx> --- I'll need this helper for msm async commit, and I suspect other drivers will as well. drivers/gpu/drm/drm_atomic_helper.c | 16 +++++++++++++--- include/drm/drm_atomic_helper.h | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index ca839bd..9032fd5 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -754,8 +754,17 @@ 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: the just-applied driver state object + * + * Helper to, after atomic commit, wait for vblanks on all effected crtcs + * (ie. before cleaning up old crtcs) + */ +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 +809,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 +869,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); diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 67e3c46..64b4e91 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -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, -- 1.9.3 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel