diff options
| author | Rob Clark <robdclark@gmail.com> | 2014-11-11 19:38:59 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2014-11-12 02:55:44 -0500 |
| commit | 5ee3229c87d396cab3c2dfc335b90320cc4a2f42 (patch) | |
| tree | 64e8a16ac5625a56e669fa1ac04645e117cd9ef1 | |
| parent | 51b44eb17b8ec6c83eac7772b4c8bc5887c5fbf7 (diff) | |
drm: export atomic wait_for_vblanks helper (v2)
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>
| -rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 17 | ||||
| -rw-r--r-- | include/drm/drm_atomic_helper.h | 3 |
2 files changed, 17 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index ca839bd9bb0d..fad2b932cf72 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
| @@ -754,8 +754,18 @@ static void wait_for_fences(struct drm_device *dev, | |||
| 754 | } | 754 | } |
| 755 | } | 755 | } |
| 756 | 756 | ||
| 757 | static void | 757 | /** |
| 758 | wait_for_vblanks(struct drm_device *dev, struct drm_atomic_state *old_state) | 758 | * drm_atomic_helper_wait_for_vblanks - wait for vblank on crtcs |
| 759 | * @dev: DRM device | ||
| 760 | * @old_state: atomic state object with old state structures | ||
| 761 | * | ||
| 762 | * Helper to, after atomic commit, wait for vblanks on all effected | ||
| 763 | * crtcs (ie. before cleaning up old framebuffers using | ||
| 764 | * drm_atomic_helper_cleanup_planes()) | ||
| 765 | */ | ||
| 766 | void | ||
| 767 | drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, | ||
| 768 | struct drm_atomic_state *old_state) | ||
| 759 | { | 769 | { |
| 760 | struct drm_crtc *crtc; | 770 | struct drm_crtc *crtc; |
| 761 | struct drm_crtc_state *old_crtc_state; | 771 | struct drm_crtc_state *old_crtc_state; |
| @@ -800,6 +810,7 @@ wait_for_vblanks(struct drm_device *dev, struct drm_atomic_state *old_state) | |||
| 800 | drm_crtc_vblank_put(crtc); | 810 | drm_crtc_vblank_put(crtc); |
| 801 | } | 811 | } |
| 802 | } | 812 | } |
| 813 | EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks); | ||
| 803 | 814 | ||
| 804 | /** | 815 | /** |
| 805 | * drm_atomic_helper_commit - commit validated state object | 816 | * drm_atomic_helper_commit - commit validated state object |
| @@ -859,7 +870,7 @@ int drm_atomic_helper_commit(struct drm_device *dev, | |||
| 859 | 870 | ||
| 860 | drm_atomic_helper_commit_post_planes(dev, state); | 871 | drm_atomic_helper_commit_post_planes(dev, state); |
| 861 | 872 | ||
| 862 | wait_for_vblanks(dev, state); | 873 | drm_atomic_helper_wait_for_vblanks(dev, state); |
| 863 | 874 | ||
| 864 | drm_atomic_helper_cleanup_planes(dev, state); | 875 | drm_atomic_helper_cleanup_planes(dev, state); |
| 865 | 876 | ||
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 67e3c4645ae0..64b4e91b93bc 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, | |||
| 34 | struct drm_atomic_state *state, | 34 | struct drm_atomic_state *state, |
| 35 | bool async); | 35 | bool async); |
| 36 | 36 | ||
| 37 | void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, | ||
| 38 | struct drm_atomic_state *old_state); | ||
| 39 | |||
| 37 | void drm_atomic_helper_commit_pre_planes(struct drm_device *dev, | 40 | void drm_atomic_helper_commit_pre_planes(struct drm_device *dev, |
| 38 | struct drm_atomic_state *state); | 41 | struct drm_atomic_state *state); |
| 39 | void drm_atomic_helper_commit_post_planes(struct drm_device *dev, | 42 | void drm_atomic_helper_commit_post_planes(struct drm_device *dev, |
