Commit 2943ef32 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Daniel Vetter

drm/atomic: use helper to get crtc state

DRM core provide helper to access crtc state.
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1458045960-25193-1-git-send-email-a.hajda@samsung.com
parent c1f415c9
...@@ -67,7 +67,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, ...@@ -67,7 +67,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state,
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
if (plane->state->crtc) { if (plane->state->crtc) {
crtc_state = state->crtc_states[drm_crtc_index(plane->state->crtc)]; crtc_state = drm_atomic_get_existing_crtc_state(state,
plane->state->crtc);
if (WARN_ON(!crtc_state)) if (WARN_ON(!crtc_state))
return; return;
...@@ -76,8 +77,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, ...@@ -76,8 +77,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state,
} }
if (plane_state->crtc) { if (plane_state->crtc) {
crtc_state = crtc_state = drm_atomic_get_existing_crtc_state(state,
state->crtc_states[drm_crtc_index(plane_state->crtc)]; plane_state->crtc);
if (WARN_ON(!crtc_state)) if (WARN_ON(!crtc_state))
return; return;
...@@ -374,8 +375,8 @@ mode_fixup(struct drm_atomic_state *state) ...@@ -374,8 +375,8 @@ mode_fixup(struct drm_atomic_state *state)
if (!conn_state->crtc || !conn_state->best_encoder) if (!conn_state->crtc || !conn_state->best_encoder)
continue; continue;
crtc_state = crtc_state = drm_atomic_get_existing_crtc_state(state,
state->crtc_states[drm_crtc_index(conn_state->crtc)]; conn_state->crtc);
/* /*
* Each encoder has at most one connector (since we always steal * Each encoder has at most one connector (since we always steal
...@@ -679,7 +680,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) ...@@ -679,7 +680,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
if (!old_conn_state->crtc) if (!old_conn_state->crtc)
continue; continue;
old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; old_crtc_state = drm_atomic_get_existing_crtc_state(old_state,
old_conn_state->crtc);
if (!old_crtc_state->active || if (!old_crtc_state->active ||
!drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state))
......
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