]> xenbits.xensource.com Git - people/pauldu/linux.git/commitdiff
drm/dp_mst: Revise broadcast msg lct & lcr
authorWayne Lin <Wayne.Lin@amd.com>
Wed, 24 Feb 2021 10:15:20 +0000 (18:15 +0800)
committerLyude Paul <lyude@redhat.com>
Wed, 24 Feb 2021 18:10:07 +0000 (13:10 -0500)
[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals
to 6. Current implementation is incorrect. Fix it.
In addition, revise a bit the hdr->rad handling to include broadcast
case.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210224101521.6713-2-Wayne.Lin@amd.com
drivers/gpu/drm/drm_dp_mst_topology.c

index 6dba7441684157ce4bcd4283da8cf3482a4c3063..2995e9c5976aa3b7de67532e9c9b73222faf60bd 100644 (file)
@@ -2827,10 +2827,15 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
        else
                hdr->broadcast = 0;
        hdr->path_msg = txmsg->path_msg;
-       hdr->lct = mstb->lct;
-       hdr->lcr = mstb->lct - 1;
-       if (mstb->lct > 1)
-               memcpy(hdr->rad, mstb->rad, mstb->lct / 2);
+       if (hdr->broadcast) {
+               hdr->lct = 1;
+               hdr->lcr = 6;
+       } else {
+               hdr->lct = mstb->lct;
+               hdr->lcr = mstb->lct - 1;
+       }
+
+       memcpy(hdr->rad, mstb->rad, hdr->lct / 2);
 
        return 0;
 }