drm/i915/dp_mst: Fix payload removal during output disabling
authorjsg <jsg@openbsd.org>
Mon, 17 Apr 2023 05:32:30 +0000 (05:32 +0000)
committerjsg <jsg@openbsd.org>
Mon, 17 Apr 2023 05:32:30 +0000 (05:32 +0000)
From Imre Deak
1297278ce23977853afeac7bfb65e42450a722dd in linux-6.1.y/6.1.24
eb50912ec931913e70640cecf75cb993fd26995f in mainline linux

sys/dev/pci/drm/i915/display/intel_dp_mst.c

index 256afff..9a68222 100644 (file)
@@ -364,10 +364,14 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
        struct intel_dp *intel_dp = &dig_port->dp;
        struct intel_connector *connector =
                to_intel_connector(old_conn_state->connector);
-       struct drm_dp_mst_topology_state *mst_state =
-               drm_atomic_get_mst_topology_state(&state->base, &intel_dp->mst_mgr);
-       struct drm_dp_mst_atomic_payload *payload =
-               drm_atomic_get_mst_payload_state(mst_state, connector->port);
+       struct drm_dp_mst_topology_state *old_mst_state =
+               drm_atomic_get_old_mst_topology_state(&state->base, &intel_dp->mst_mgr);
+       struct drm_dp_mst_topology_state *new_mst_state =
+               drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst_mgr);
+       const struct drm_dp_mst_atomic_payload *old_payload =
+               drm_atomic_get_mst_payload_state(old_mst_state, connector->port);
+       struct drm_dp_mst_atomic_payload *new_payload =
+               drm_atomic_get_mst_payload_state(new_mst_state, connector->port);
        struct drm_i915_private *i915 = to_i915(connector->base.dev);
 
        drm_dbg_kms(&i915->drm, "active links %d\n",
@@ -375,8 +379,8 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
 
        intel_hdcp_disable(intel_mst->connector);
 
-       drm_dp_remove_payload(&intel_dp->mst_mgr, mst_state,
-                             payload, payload);
+       drm_dp_remove_payload(&intel_dp->mst_mgr, new_mst_state,
+                             old_payload, new_payload);
 
        intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state);
 }