drm/i915: move swap state to the right place
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 1 Jun 2015 10:50:06 +0000 (12:50 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 12 Jun 2015 10:19:34 +0000 (13:19 +0300)
This is a preparation for passing crtc state to the helpers.
When converting all users of crtc->config to use the old or
new state it's easier to find regressions when swap_state is
done first.

If crtc->config is swapped at the same place as swap_state
bugs will never be found.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_display.c

index 547d6db2a6ee0e9de8867869a687e6290405aaa9..d4d7708b58a43979698627728bb74213b9311635 100644 (file)
@@ -12189,7 +12189,6 @@ intel_modeset_update_state(struct drm_atomic_state *state)
        struct drm_connector *connector;
 
        intel_shared_dpll_commit(state);
-       drm_atomic_helper_swap_state(state->dev, state);
 
        for_each_intel_encoder(dev, intel_encoder) {
                if (!intel_encoder->base.crtc)
@@ -12887,8 +12886,10 @@ static int __intel_set_mode(struct drm_atomic_state *state)
        if (ret)
                return ret;
 
+       drm_atomic_helper_swap_state(dev, state);
+
        for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               if (!needs_modeset(crtc_state) || !crtc->state->active)
+               if (!needs_modeset(crtc->state) || !crtc_state->active)
                        continue;
 
                intel_crtc_disable_planes(crtc);