drm/atomic-helpers: Properly avoid full modeset dance

Legacy setCrtc has a nice fastpath for just updating the frontbuffer
when the output routing doesn't change. Which I of course tried to
keep working, except that I fumbled the job: The helpers correctly
compute ->mode_changed, CRTC updates get correctly skipped but
connector functions are called unconditionally.

Fix this.

v2: For the disable sided connector->state->crtc might be NULL.
Instead look at the old_connector_state->crtc, but still use the new
crtc state for that old crtc. Reported by Thierry.

Reported-and-Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This commit is contained in:
Daniel Vetter 2015-03-26 22:18:40 +01:00
Родитель 27798365a6
Коммит 4218a32f55
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -587,7 +587,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)];
if (!old_crtc_state->active) if (!old_crtc_state->active ||
!needs_modeset(old_conn_state->crtc->state))
continue; continue;
encoder = old_conn_state->best_encoder; encoder = old_conn_state->best_encoder;
@ -847,7 +848,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
if (!connector || !connector->state->best_encoder) if (!connector || !connector->state->best_encoder)
continue; continue;
if (!connector->state->crtc->state->active) if (!connector->state->crtc->state->active ||
!needs_modeset(connector->state->crtc->state))
continue; continue;
encoder = connector->state->best_encoder; encoder = connector->state->best_encoder;