Commit 8e01550e authored by Daniel Vetter's avatar Daniel Vetter

drm/exynos: Use for_each_crtc_in_state

We want to hide drm_atomic_state internals better.

v2: Use drm_crtc_mask (Maarten).

Cc: Inki Dae <inki.dae@samsung.com>
Acked-by: default avatarInki Dae <inki.dae@samsung.com>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-8-git-send-email-daniel.vetter@ffwll.ch
parent 82072573
...@@ -267,6 +267,8 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state, ...@@ -267,6 +267,8 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state,
{ {
struct exynos_drm_private *priv = dev->dev_private; struct exynos_drm_private *priv = dev->dev_private;
struct exynos_atomic_commit *commit; struct exynos_atomic_commit *commit;
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
int i, ret; int i, ret;
commit = kzalloc(sizeof(*commit), GFP_KERNEL); commit = kzalloc(sizeof(*commit), GFP_KERNEL);
...@@ -288,10 +290,8 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state, ...@@ -288,10 +290,8 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state,
/* Wait until all affected CRTCs have completed previous commits and /* Wait until all affected CRTCs have completed previous commits and
* mark them as pending. * mark them as pending.
*/ */
for (i = 0; i < dev->mode_config.num_crtc; ++i) { for_each_crtc_in_state(state, crtc, crtc_state, i)
if (state->crtcs[i]) commit->crtcs |= drm_crtc_mask(crtc);
commit->crtcs |= 1 << drm_crtc_index(state->crtcs[i]);
}
wait_event(priv->wait, !commit_is_pending(priv, commit->crtcs)); wait_event(priv->wait, !commit_is_pending(priv, commit->crtcs));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment