]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Don't use staged config in intel_dp_mst_compute_config()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 20 Mar 2015 14:18:13 +0000 (16:18 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 26 Mar 2015 17:00:18 +0000 (18:00 +0100)
Move towards atomic by using the legacy modeset's drm_atomic_state
instead.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_dp_mst.c

index 37c45f8d01356f3de0407bbdacc73191ec94e30c..5329c855acce71f4fab98385900e5c99511be986 100644 (file)
@@ -36,11 +36,11 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,
        struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
        struct intel_digital_port *intel_dig_port = intel_mst->primary;
        struct intel_dp *intel_dp = &intel_dig_port->dp;
-       struct drm_device *dev = encoder->base.dev;
-       int bpp;
+       struct drm_atomic_state *state;
+       int bpp, i;
        int lane_count, slots, rate;
        struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
-       struct intel_connector *found = NULL, *intel_connector;
+       struct intel_connector *found = NULL;
        int mst_pbn;
 
        pipe_config->dp_encoder_is_mst = true;
@@ -68,9 +68,14 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,
        pipe_config->pipe_bpp = 24;
        pipe_config->port_clock = rate;
 
-       for_each_intel_connector(dev, intel_connector) {
-               if (intel_connector->new_encoder == encoder) {
-                       found = intel_connector;
+       state = pipe_config->base.state;
+
+       for (i = 0; i < state->num_connector; i++) {
+               if (!state->connectors[i])
+                       continue;
+
+               if (state->connector_states[i]->best_encoder == &encoder->base) {
+                       found = to_intel_connector(state->connectors[i]);
                        break;
                }
        }