drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization (v2)
[deliverable/linux.git] / drivers / gpu / drm / i915 / intel_pm.c
index 99014d7821c23d0222c1ed73362355134096424c..d74c26f1cf77ee1d0a629cf91d03507168d039f0 100644 (file)
@@ -3920,9 +3920,24 @@ skl_compute_ddb(struct drm_atomic_state *state)
         * pretend that all pipes switched active status so that we'll
         * ensure a full DDB recompute.
         */
-       if (dev_priv->wm.distrust_bios_wm)
+       if (dev_priv->wm.distrust_bios_wm) {
+               ret = drm_modeset_lock(&dev->mode_config.connection_mutex,
+                                      state->acquire_ctx);
+               if (ret)
+                       return ret;
+
                intel_state->active_pipe_changes = ~0;
 
+               /*
+                * We usually only initialize intel_state->active_crtcs if we
+                * we're doing a modeset; make sure this field is always
+                * initialized during the sanitization process that happens
+                * on the first commit too.
+                */
+               if (!intel_state->modeset)
+                       intel_state->active_crtcs = dev_priv->active_crtcs;
+       }
+
        /*
         * If the modeset changes which CRTC's are active, we need to
         * recompute the DDB allocation for *all* active pipes, even
This page took 0.034331 seconds and 5 git commands to generate.