diff options
author | Thierry Reding <treding@nvidia.com> | 2014-11-25 06:09:44 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-25 07:27:58 -0500 |
commit | f1c37e1adc6eca1fb492c74d466141d9b01e0428 (patch) | |
tree | 56d476e091b15d9947c12bdd871838254c406fc2 | |
parent | aa54e2ee80b4f653f75b9139ae7500ee8cd5ad5f (diff) |
drm/plane: Pass old state to ->atomic_update()
In most situations it will be useful to have the old state passed to the
->atomic_update() callback. For example if a plane is being disabled the
new state's .crtc field will be NULL, but some drivers may rely on this
field to program the CRTCs registers.
v2: rename variable to old_plane_state and remove redundant comment as
suggested by Daniel Vetter, remove an Exynos hunk that doesn't apply to
drm-next and add a hunk for pending MSM mdp5 changes
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_plane_helper.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 3 | ||||
-rw-r--r-- | include/drm/drm_plane_helper.h | 3 |
5 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d981d07d50cd..2fa0840694d0 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -1046,6 +1046,7 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev, | |||
1046 | for (i = 0; i < nplanes; i++) { | 1046 | for (i = 0; i < nplanes; i++) { |
1047 | struct drm_plane_helper_funcs *funcs; | 1047 | struct drm_plane_helper_funcs *funcs; |
1048 | struct drm_plane *plane = old_state->planes[i]; | 1048 | struct drm_plane *plane = old_state->planes[i]; |
1049 | struct drm_plane_state *old_plane_state; | ||
1049 | 1050 | ||
1050 | if (!plane) | 1051 | if (!plane) |
1051 | continue; | 1052 | continue; |
@@ -1055,7 +1056,9 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev, | |||
1055 | if (!funcs || !funcs->atomic_update) | 1056 | if (!funcs || !funcs->atomic_update) |
1056 | continue; | 1057 | continue; |
1057 | 1058 | ||
1058 | funcs->atomic_update(plane); | 1059 | old_plane_state = old_state->plane_states[i]; |
1060 | |||
1061 | funcs->atomic_update(plane, old_plane_state); | ||
1059 | } | 1062 | } |
1060 | 1063 | ||
1061 | for (i = 0; i < ncrtcs; i++) { | 1064 | for (i = 0; i < ncrtcs; i++) { |
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 93c6533c25da..18a1ac6ac22f 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c | |||
@@ -443,7 +443,7 @@ int drm_plane_helper_commit(struct drm_plane *plane, | |||
443 | crtc_funcs[i]->atomic_begin(crtc[i]); | 443 | crtc_funcs[i]->atomic_begin(crtc[i]); |
444 | } | 444 | } |
445 | 445 | ||
446 | plane_funcs->atomic_update(plane); | 446 | plane_funcs->atomic_update(plane, plane_state); |
447 | 447 | ||
448 | for (i = 0; i < 2; i++) { | 448 | for (i = 0; i < 2; i++) { |
449 | if (crtc_funcs[i] && crtc_funcs[i]->atomic_flush) | 449 | if (crtc_funcs[i] && crtc_funcs[i]->atomic_flush) |
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c index 76d0a40c7138..1e5ebe83647d 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c | |||
@@ -107,7 +107,8 @@ static int mdp4_plane_atomic_check(struct drm_plane *plane, | |||
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | static void mdp4_plane_atomic_update(struct drm_plane *plane) | 110 | static void mdp4_plane_atomic_update(struct drm_plane *plane, |
111 | struct drm_plane_state *old_state) | ||
111 | { | 112 | { |
112 | struct drm_plane_state *state = plane->state; | 113 | struct drm_plane_state *state = plane->state; |
113 | int ret; | 114 | int ret; |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index 533df7caa310..26e5fdea6594 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | |||
@@ -213,7 +213,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, | |||
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | 215 | ||
216 | static void mdp5_plane_atomic_update(struct drm_plane *plane) | 216 | static void mdp5_plane_atomic_update(struct drm_plane *plane, |
217 | struct drm_plane_state *old_state) | ||
217 | { | 218 | { |
218 | struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); | 219 | struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); |
219 | struct drm_plane_state *state = plane->state; | 220 | struct drm_plane_state *state = plane->state; |
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index c48f14d88690..fcfa969523fb 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h | |||
@@ -60,7 +60,8 @@ struct drm_plane_helper_funcs { | |||
60 | 60 | ||
61 | int (*atomic_check)(struct drm_plane *plane, | 61 | int (*atomic_check)(struct drm_plane *plane, |
62 | struct drm_plane_state *state); | 62 | struct drm_plane_state *state); |
63 | void (*atomic_update)(struct drm_plane *plane); | 63 | void (*atomic_update)(struct drm_plane *plane, |
64 | struct drm_plane_state *old_state); | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | static inline void drm_plane_helper_add(struct drm_plane *plane, | 67 | static inline void drm_plane_helper_add(struct drm_plane *plane, |