drm/i915: Remove intel_crtc->new_config
[deliverable/linux.git] / drivers / gpu / drm / i915 / intel_display.c
index a6cd8c7a64e974444434627dad66f774777e1381..207c713dd574ba449db5598b4efbd37407815d55 100644 (file)
@@ -9171,7 +9171,6 @@ retry:
 
        intel_crtc = to_intel_crtc(crtc);
        intel_crtc->new_enabled = true;
-       intel_crtc->new_config = intel_crtc->config;
        old->dpms_mode = connector->dpms;
        old->load_detect_temp = true;
        old->release_fb = NULL;
@@ -9227,10 +9226,6 @@ retry:
 
  fail:
        intel_crtc->new_enabled = crtc->state->enable;
-       if (intel_crtc->new_enabled)
-               intel_crtc->new_config = intel_crtc->config;
-       else
-               intel_crtc->new_config = NULL;
 fail_unlock:
        if (state) {
                drm_atomic_state_free(state);
@@ -9276,7 +9271,6 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
                to_intel_connector(connector)->new_encoder = NULL;
                intel_encoder->new_crtc = NULL;
                intel_crtc->new_enabled = false;
-               intel_crtc->new_config = NULL;
 
                connector_state->best_encoder = NULL;
                connector_state->crtc = NULL;
@@ -10416,11 +10410,6 @@ static void intel_modeset_update_staged_output_state(struct drm_device *dev)
 
        for_each_intel_crtc(dev, crtc) {
                crtc->new_enabled = crtc->base.state->enable;
-
-               if (crtc->new_enabled)
-                       crtc->new_config = crtc->config;
-               else
-                       crtc->new_config = NULL;
        }
 }
 
@@ -10981,9 +10970,6 @@ intel_modeset_update_state(struct drm_device *dev, unsigned prepare_pipes)
        /* Double check state. */
        for_each_intel_crtc(dev, intel_crtc) {
                WARN_ON(intel_crtc->base.state->enable != intel_crtc_in_use(&intel_crtc->base));
-               WARN_ON(intel_crtc->new_config &&
-                       intel_crtc->new_config != intel_crtc->config);
-               WARN_ON(intel_crtc->base.state->enable != !!intel_crtc->new_config);
        }
 
        list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
@@ -11581,10 +11567,11 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
        return intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));;
 }
 
-static int __intel_set_mode_setup_plls(struct drm_device *dev,
+static int __intel_set_mode_setup_plls(struct drm_atomic_state *state,
                                       unsigned modeset_pipes,
                                       unsigned disable_pipes)
 {
+       struct drm_device *dev = state->dev;
        struct drm_i915_private *dev_priv = to_i915(dev);
        unsigned clear_pipes = modeset_pipes | disable_pipes;
        struct intel_crtc *intel_crtc;
@@ -11598,9 +11585,15 @@ static int __intel_set_mode_setup_plls(struct drm_device *dev,
                goto done;
 
        for_each_intel_crtc_masked(dev, modeset_pipes, intel_crtc) {
-               struct intel_crtc_state *state = intel_crtc->new_config;
+               struct intel_crtc_state *crtc_state =
+                       intel_atomic_get_crtc_state(state, intel_crtc);
+
+               /* Modeset pipes should have a new state by now */
+               if (WARN_ON(IS_ERR(crtc_state)))
+                       continue;
+
                ret = dev_priv->display.crtc_compute_clock(intel_crtc,
-                                                          state);
+                                                          crtc_state);
                if (ret) {
                        intel_shared_dpll_abort_config(dev_priv);
                        goto done;
@@ -11639,9 +11632,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
 
        *saved_mode = crtc->mode;
 
-       if (modeset_pipes)
-               to_intel_crtc(crtc)->new_config = pipe_config;
-
        /*
         * See if the config requires any additional preparation, e.g.
         * to adjust global state with pipes off.  We need to do this
@@ -11658,7 +11648,7 @@ static int __intel_set_mode(struct drm_crtc *crtc,
                prepare_pipes &= ~disable_pipes;
        }
 
-       ret = __intel_set_mode_setup_plls(dev, modeset_pipes, disable_pipes);
+       ret = __intel_set_mode_setup_plls(state, modeset_pipes, disable_pipes);
        if (ret)
                goto done;
 
@@ -11734,9 +11724,6 @@ done:
                       sizeof *crtc_state_copy);
                intel_crtc->config = crtc_state_copy;
                intel_crtc->base.state = &crtc_state_copy->base;
-
-               if (modeset_pipes)
-                       intel_crtc->new_config = intel_crtc->config;
        } else {
                kfree(crtc_state_copy);
        }
@@ -11915,11 +11902,6 @@ static void intel_set_config_restore_state(struct drm_device *dev,
        count = 0;
        for_each_intel_crtc(dev, crtc) {
                crtc->new_enabled = config->save_crtc_enabled[count++];
-
-               if (crtc->new_enabled)
-                       crtc->new_config = crtc->config;
-               else
-                       crtc->new_config = NULL;
        }
 
        count = 0;
@@ -12146,11 +12128,6 @@ intel_modeset_stage_output_state(struct drm_device *dev,
                                      crtc->new_enabled ? "en" : "dis");
                        config->mode_changed = true;
                }
-
-               if (crtc->new_enabled)
-                       crtc->new_config = crtc->config;
-               else
-                       crtc->new_config = NULL;
        }
 
        return 0;
@@ -12177,7 +12154,6 @@ static void disable_crtc_nofb(struct intel_crtc *crtc)
        }
 
        crtc->new_enabled = false;
-       crtc->new_config = NULL;
 }
 
 static int intel_crtc_set_config(struct drm_mode_set *set)
This page took 0.031776 seconds and 5 git commands to generate.