[PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()

Wayne Lin Wayne.Lin at amd.com
Mon Dec 2 03:58:41 UTC 2019


[Why]
If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
code doesn't delete the payload at current index and just move the
index to next one after shuffling payloads.

[How]
After shuffling payloads, decide whether to move on index or not
according to payload_state of current payload.

Signed-off-by: Wayne Lin <Wayne.Lin at amd.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 81e92b260d7a..8da5d461ea01 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3176,7 +3176,8 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr)
 			drm_dp_mst_topology_put_port(port);
 	}
 
-	for (i = 0; i < mgr->max_payloads; i++) {
+	for (i = 0; i < mgr->max_payloads;
+		(mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ? i : i++) {
 		if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
 			continue;
 
-- 
2.17.1



More information about the amd-gfx mailing list