]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/hdcp: Use new MST topology state in intel_conn_to_vcpi()
authorSuraj Kandpal <suraj.kandpal@intel.com>
Mon, 4 May 2026 10:11:17 +0000 (15:41 +0530)
committerSuraj Kandpal <suraj.kandpal@intel.com>
Tue, 5 May 2026 02:54:25 +0000 (08:24 +0530)
intel_conn_to_vcpi() runs from the HDCP enable path in commit_tail
and looks up the VCPI via mgr->base.state. When an ALLOCATE_PAYLOAD
is being driven on the mgr just before HDCP enable, that payload
list is being mutated in place, so the lookup can miss the port and
trip drm_WARN_ON(!payload), causing HDCP to be programmed with
VCPI 0.
Use drm_atomic_get_new_mst_topology_state() to read the topology
state attached to this atomic commit (stable, decided in
atomic_check), and bail out cleanly when no topology state or
payload is present for this port instead of WARNing.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Tested-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
Reviewed-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
Link: https://patch.msgid.link/20260504101117.3619984-2-suraj.kandpal@intel.com
drivers/gpu/drm/i915/display/intel_hdcp.c

index 9b4ff3b80b0558a3f8797b951a39f0e22db321e1..02ac981ca1eaa4011f1f7947c2255b37fc61f6d0 100644 (file)
@@ -72,6 +72,7 @@ intel_hdcp_adjust_hdcp_line_rekeying(struct intel_encoder *encoder,
 static int intel_conn_to_vcpi(struct intel_atomic_state *state,
                              struct intel_connector *connector)
 {
+       struct intel_display *display = to_intel_display(state);
        struct drm_dp_mst_topology_mgr *mgr;
        struct drm_dp_mst_atomic_payload *payload;
        struct drm_dp_mst_topology_state *mst_state;
@@ -82,10 +83,17 @@ static int intel_conn_to_vcpi(struct intel_atomic_state *state,
        mgr = connector->mst.port->mgr;
 
        drm_modeset_lock(&mgr->base.lock, state->base.acquire_ctx);
-       mst_state = to_drm_dp_mst_topology_state(mgr->base.state);
+       mst_state = drm_atomic_get_new_mst_topology_state(&state->base, mgr);
+       if (!mst_state) {
+               drm_dbg_kms(display->drm, "MST topology still not created\n");
+               return 0;
+       }
+
        payload = drm_atomic_get_mst_payload_state(mst_state, connector->mst.port);
-       if (drm_WARN_ON(mgr->dev, !payload))
+       if (!payload) {
+               drm_dbg_kms(display->drm, "MST Payload not present\n");
                return 0;
+       }
 
        return payload->vcpi;
 }