mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 19:40:52 +07:00
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 <aric.cyr@amd.com> Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
f7d5991b92
commit
4e5183200d
@ -1684,6 +1684,8 @@ static void delay_cursor_until_vupdate(struct dc *dc, struct pipe_ctx *pipe_ctx)
|
||||
return;
|
||||
|
||||
/* Stall out until the cursor update completes. */
|
||||
if (vupdate_end < vupdate_start)
|
||||
vupdate_end += stream->timing.v_total;
|
||||
us_vupdate = (vupdate_end - vupdate_start + 1) * us_per_line;
|
||||
udelay(us_to_vupdate + us_vupdate);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user