aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-26 17:18:40 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-27 09:45:31 -0400
commit4218a32f55fc71983e4c1c6e5b98b28db8226b3b (patch)
tree0f463cb777b0e4f7c50a5897376a8322ddd4dfc6
parent27798365a60eaa61d8d9010466ffd57368b98ba9 (diff)
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>
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d9ed9a54fd1e..e67d4d69faf7 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -587,7 +587,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
587 587
588 old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; 588 old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)];
589 589
590 if (!old_crtc_state->active) 590 if (!old_crtc_state->active ||
591 !needs_modeset(old_conn_state->crtc->state))
591 continue; 592 continue;
592 593
593 encoder = old_conn_state->best_encoder; 594 encoder = old_conn_state->best_encoder;
@@ -847,7 +848,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
847 if (!connector || !connector->state->best_encoder) 848 if (!connector || !connector->state->best_encoder)
848 continue; 849 continue;
849 850
850 if (!connector->state->crtc->state->active) 851 if (!connector->state->crtc->state->active ||
852 !needs_modeset(connector->state->crtc->state))
851 continue; 853 continue;
852 854
853 encoder = connector->state->best_encoder; 855 encoder = connector->state->best_encoder;