Skip to content

Commit 4e51832

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]> Cc: [email protected]
1 parent f7d5991 commit 4e51832

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
@@ -1684,6 +1684,8 @@ static void delay_cursor_until_vupdate(struct dc *dc, struct pipe_ctx *pipe_ctx)
16841684
return;
16851685

16861686
/* Stall out until the cursor update completes. */
1687+
if (vupdate_end < vupdate_start)
1688+
vupdate_end += stream->timing.v_total;
16871689
us_vupdate = (vupdate_end - vupdate_start + 1) * us_per_line;
16881690
udelay(us_to_vupdate + us_vupdate);
16891691
}

0 commit comments

Comments
 (0)