summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAric Cyr <aric.cyr@amd.com>2020-05-12 17:48:48 +0200
committerAlex Deucher <alexander.deucher@amd.com>2020-05-28 00:42:10 +0200
commit185082b679b4bd6dfb69764eaa89213b26f6f703 (patch)
tree3d27954d6d7877c4d8eb79aabe481ecb49ef9e9d
parentdrm/amd/display: drop cursor position check in atomic test (diff)
downloadlinux-185082b679b4bd6dfb69764eaa89213b26f6f703.tar.xz
linux-185082b679b4bd6dfb69764eaa89213b26f6f703.zip
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>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index f59cf60fb78a..77f16921e7f0 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1742,6 +1742,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);
}