drm/display/dp_mst: Fix payload addition on a disconnected sink
authorjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 07:36:36 +0000 (07:36 +0000)
committerjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 07:36:36 +0000 (07:36 +0000)
From Imre Deak
6e48e7901e6258b8ea1116d70752d0eb2eca797d in linux-6.1.y/6.1.18
33f960e23c29d113fe3193e0bdc19ac4f3776f20 in mainline linux

sys/dev/pci/drm/display/drm_dp_mst_topology.c

index d4fff37..f930f0d 100644 (file)
@@ -3319,8 +3319,13 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr,
        int ret;
 
        port = drm_dp_mst_topology_get_port_validated(mgr, payload->port);
-       if (!port)
+       if (!port) {
+               drm_dbg_kms(mgr->dev,
+                           "VCPI %d for port %p not in topology, not creating a payload\n",
+                           payload->vcpi, payload->port);
+               payload->vc_start_slot = -1;
                return 0;
+       }
 
        if (mgr->payload_count == 0)
                mgr->next_start_slot = mst_state->start_slot;