aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-22 06:24:19 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-23 19:57:46 -0500
commit1af434a92871af93d97ce28e35497532a4167a0c (patch)
tree86253693a02e39bf5204a5dde82cb5866a428063
parenta072f809b69885c77262fb978b008ef9488d513e (diff)
drm/atomic-helper: Rename commmit_post/pre_planes
These names only make sense because of backwards compatability with the order used by the crtc helper library. There's not really any real requirement in the ordering here. So rename them to something more descriptive and update the kerneldoc a bit. Motivated in a discussion with Laurent about how to restore plane state for dpms for drivers with runtime pm. v2: Squash in fixup from Stephen Rothwell to fix a conflict with tegra. Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c40
-rw-r--r--drivers/gpu/drm/i915/intel_atomic.c4
-rw-r--r--drivers/gpu/drm/msm/msm_atomic.c4
-rw-r--r--drivers/gpu/drm/tegra/drm.c4
-rw-r--r--include/drm/drm_atomic_helper.h6
5 files changed, 34 insertions, 24 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 65b9adf5777c..9c528bbcd8d2 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -768,34 +768,44 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state)
768} 768}
769 769
770/** 770/**
771 * drm_atomic_helper_commit_pre_planes - modeset commit before plane updates 771 * drm_atomic_helper_commit_modeset_disables - modeset commit to disable outputs
772 * @dev: DRM device 772 * @dev: DRM device
773 * @old_state: atomic state object with old state structures 773 * @old_state: atomic state object with old state structures
774 * 774 *
775 * This function commits the modeset changes that need to be committed before 775 * This function shuts down all the outputs that need to be shut down and
776 * updating planes. It shuts down all the outputs that need to be shut down and
777 * prepares them (if required) with the new mode. 776 * prepares them (if required) with the new mode.
777 *
778 * For compatability with legacy crtc helpers this should be called before
779 * drm_atomic_helper_commit_planes(), which is what the default commit function
780 * does. But drivers with different needs can group the modeset commits together
781 * and do the plane commits at the end. This is useful for drivers doing runtime
782 * PM since planes updates then only happen when the CRTC is actually enabled.
778 */ 783 */
779void drm_atomic_helper_commit_pre_planes(struct drm_device *dev, 784void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev,
780 struct drm_atomic_state *old_state) 785 struct drm_atomic_state *old_state)
781{ 786{
782 disable_outputs(dev, old_state); 787 disable_outputs(dev, old_state);
783 set_routing_links(dev, old_state); 788 set_routing_links(dev, old_state);
784 crtc_set_mode(dev, old_state); 789 crtc_set_mode(dev, old_state);
785} 790}
786EXPORT_SYMBOL(drm_atomic_helper_commit_pre_planes); 791EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_disables);
787 792
788/** 793/**
789 * drm_atomic_helper_commit_post_planes - modeset commit after plane updates 794 * drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs
790 * @dev: DRM device 795 * @dev: DRM device
791 * @old_state: atomic state object with old state structures 796 * @old_state: atomic state object with old state structures
792 * 797 *
793 * This function commits the modeset changes that need to be committed after 798 * This function enables all the outputs with the new configuration which had to
794 * updating planes: It enables all the outputs with the new configuration which 799 * be turned off for the update.
795 * had to be turned off for the update. 800 *
801 * For compatability with legacy crtc helpers this should be called after
802 * drm_atomic_helper_commit_planes(), which is what the default commit function
803 * does. But drivers with different needs can group the modeset commits together
804 * and do the plane commits at the end. This is useful for drivers doing runtime
805 * PM since planes updates then only happen when the CRTC is actually enabled.
796 */ 806 */
797void drm_atomic_helper_commit_post_planes(struct drm_device *dev, 807void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
798 struct drm_atomic_state *old_state) 808 struct drm_atomic_state *old_state)
799{ 809{
800 int ncrtcs = old_state->dev->mode_config.num_crtc; 810 int ncrtcs = old_state->dev->mode_config.num_crtc;
801 int i; 811 int i;
@@ -861,7 +871,7 @@ void drm_atomic_helper_commit_post_planes(struct drm_device *dev,
861 encoder->bridge->funcs->enable(encoder->bridge); 871 encoder->bridge->funcs->enable(encoder->bridge);
862 } 872 }
863} 873}
864EXPORT_SYMBOL(drm_atomic_helper_commit_post_planes); 874EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_enables);
865 875
866static void wait_for_fences(struct drm_device *dev, 876static void wait_for_fences(struct drm_device *dev,
867 struct drm_atomic_state *state) 877 struct drm_atomic_state *state)
@@ -1030,11 +1040,11 @@ int drm_atomic_helper_commit(struct drm_device *dev,
1030 1040
1031 wait_for_fences(dev, state); 1041 wait_for_fences(dev, state);
1032 1042
1033 drm_atomic_helper_commit_pre_planes(dev, state); 1043 drm_atomic_helper_commit_modeset_disables(dev, state);
1034 1044
1035 drm_atomic_helper_commit_planes(dev, state); 1045 drm_atomic_helper_commit_planes(dev, state);
1036 1046
1037 drm_atomic_helper_commit_post_planes(dev, state); 1047 drm_atomic_helper_commit_modeset_enables(dev, state);
1038 1048
1039 drm_atomic_helper_wait_for_vblanks(dev, state); 1049 drm_atomic_helper_wait_for_vblanks(dev, state);
1040 1050
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 19a9dd5408f3..011b8960fd75 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -134,9 +134,9 @@ int intel_atomic_commit(struct drm_device *dev,
134 * FIXME: The proper sequence here will eventually be: 134 * FIXME: The proper sequence here will eventually be:
135 * 135 *
136 * drm_atomic_helper_swap_state(dev, state) 136 * drm_atomic_helper_swap_state(dev, state)
137 * drm_atomic_helper_commit_pre_planes(dev, state); 137 * drm_atomic_helper_commit_modeset_disables(dev, state);
138 * drm_atomic_helper_commit_planes(dev, state); 138 * drm_atomic_helper_commit_planes(dev, state);
139 * drm_atomic_helper_commit_post_planes(dev, state); 139 * drm_atomic_helper_commit_modeset_enables(dev, state);
140 * drm_atomic_helper_wait_for_vblanks(dev, state); 140 * drm_atomic_helper_wait_for_vblanks(dev, state);
141 * drm_atomic_helper_cleanup_planes(dev, state); 141 * drm_atomic_helper_cleanup_planes(dev, state);
142 * drm_atomic_state_free(state); 142 * drm_atomic_state_free(state);
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index 871aa2108dc6..7c412292a0ff 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -96,11 +96,11 @@ static void complete_commit(struct msm_commit *c)
96 96
97 kms->funcs->prepare_commit(kms, state); 97 kms->funcs->prepare_commit(kms, state);
98 98
99 drm_atomic_helper_commit_pre_planes(dev, state); 99 drm_atomic_helper_commit_modeset_disables(dev, state);
100 100
101 drm_atomic_helper_commit_planes(dev, state); 101 drm_atomic_helper_commit_planes(dev, state);
102 102
103 drm_atomic_helper_commit_post_planes(dev, state); 103 drm_atomic_helper_commit_modeset_enables(dev, state);
104 104
105 /* NOTE: _wait_for_vblanks() only waits for vblank on 105 /* NOTE: _wait_for_vblanks() only waits for vblank on
106 * enabled CRTCs. So we end up faulting when disabling 106 * enabled CRTCs. So we end up faulting when disabling
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 7dd328d77996..5f1880766110 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -55,9 +55,9 @@ static void tegra_atomic_complete(struct tegra_drm *tegra,
55 * current layout. 55 * current layout.
56 */ 56 */
57 57
58 drm_atomic_helper_commit_pre_planes(drm, state); 58 drm_atomic_helper_commit_modeset_disables(drm, state);
59 drm_atomic_helper_commit_planes(drm, state); 59 drm_atomic_helper_commit_planes(drm, state);
60 drm_atomic_helper_commit_post_planes(drm, state); 60 drm_atomic_helper_commit_modeset_enables(drm, state);
61 61
62 drm_atomic_helper_wait_for_vblanks(drm, state); 62 drm_atomic_helper_wait_for_vblanks(drm, state);
63 63
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 8039d54a7441..829280b56874 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -43,9 +43,9 @@ int drm_atomic_helper_commit(struct drm_device *dev,
43void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, 43void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
44 struct drm_atomic_state *old_state); 44 struct drm_atomic_state *old_state);
45 45
46void drm_atomic_helper_commit_pre_planes(struct drm_device *dev, 46void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev,
47 struct drm_atomic_state *state); 47 struct drm_atomic_state *state);
48void drm_atomic_helper_commit_post_planes(struct drm_device *dev, 48void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
49 struct drm_atomic_state *old_state); 49 struct drm_atomic_state *old_state);
50 50
51int drm_atomic_helper_prepare_planes(struct drm_device *dev, 51int drm_atomic_helper_prepare_planes(struct drm_device *dev,