aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_kms.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-11-19 12:31:03 -0500
committerRob Clark <robdclark@gmail.com>2014-11-21 08:59:18 -0500
commited8519636ef6c4b6ffbc4a449ebf39502e80ee74 (patch)
tree04dc21e8efbbc82c12b0305e34ae16a753163f8f /drivers/gpu/drm/msm/msm_kms.h
parentdrm/msm: atomic fixes (diff)
downloadlinux-dev-ed8519636ef6c4b6ffbc4a449ebf39502e80ee74.tar.xz
linux-dev-ed8519636ef6c4b6ffbc4a449ebf39502e80ee74.zip
drm/msm/mdp5: atomic
Convert mdp5 over to atomic helpers. Extend/wrap drm_plane_state to track plane zpos and to keep track of the needed when applying the atomic update. In mdp5's plane->atomic_check() we also need to check for updates which require SMP reallocation, in order to trigger full modeset. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/msm/msm_kms.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h
index 1e9d8c2e6a5d..7fb4876388e7 100644
--- a/drivers/gpu/drm/msm/msm_kms.h
+++ b/drivers/gpu/drm/msm/msm_kms.h
@@ -70,9 +70,22 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev);
list_for_each_entry((_plane), &(_crtc)->dev->mode_config.plane_list, head) \
if ((_plane)->state->crtc == (_crtc))
+static inline bool
+__plane_will_be_attached_to_crtc(struct drm_atomic_state *state,
+ struct drm_plane *plane, struct drm_crtc *crtc)
+{
+ int idx = drm_plane_index(plane);
+
+ /* if plane is modified in incoming state, use the new state: */
+ if (state->plane_states[idx])
+ return state->plane_states[idx]->crtc == crtc;
+
+ /* otherwise, current state: */
+ return plane->state->crtc == crtc;
+}
+
#define for_each_pending_plane_on_crtc(_state, _crtc, _plane) \
list_for_each_entry((_plane), &(_crtc)->dev->mode_config.plane_list, head) \
- if (({struct drm_plane_state *_ps = (_state)->plane_states[drm_plane_index(_plane)]; \
- _ps && _ps->crtc == (_crtc);}))
+ if (__plane_will_be_attached_to_crtc((_state), (_plane), (_crtc)))
#endif /* __MSM_KMS_H__ */