Skip to content

Commit 185082b

Browse files
AMD-aricalexdeucher
authored andcommitted
drm/amd/display: Fix potential integer wraparound resulting in a hang
[Why] If VUPDATE_END is before VUPDATE_START the delay calculated can become very large, causing a soft hang. [How] Take the absolute value of the difference between START and END. Signed-off-by: Aric Cyr <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Acked-by: Qingqing Zhuo <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8d43e39 commit 185082b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,8 @@ static void delay_cursor_until_vupdate(struct dc *dc, struct pipe_ctx *pipe_ctx)
17421742
return;
17431743

17441744
/* Stall out until the cursor update completes. */
1745+
if (vupdate_end < vupdate_start)
1746+
vupdate_end += stream->timing.v_total;
17451747
us_vupdate = (vupdate_end - vupdate_start + 1) * us_per_line;
17461748
udelay(us_to_vupdate + us_vupdate);
17471749
}

0 commit comments

Comments
 (0)