Skip to content

Commit fdfd2a8

Browse files
Nicholas Kazlauskasalexdeucher
authored andcommitted
drm/amd/display: Defer cursor update around VUPDATE for all ASIC
[Why] Fixes the following scenario: - Flip has been prepared sometime during the frame, update pending - Cursor update happens right when VUPDATE would happen - OPTC lock acquired, VUPDATE is blocked until next frame - Flip is delayed potentially infinitely With the igt@kms_cursor_legacy cursor-vs-flip-legacy test we can observe nearly *13* frames of delay for some flips on Navi. [How] Apply the Raven workaround generically. When close enough to VUPDATE block cursor updates from occurring from the dc_stream_set_cursor_* helpers. This could perhaps be a little smarter by checking if there were pending updates or flips earlier in the frame on the HUBP side before applying the delay, but this should be fine for now. This fixes the kms_cursor_legacy test. Signed-off-by: Nicholas Kazlauskas <[email protected]> Reviewed-by: Aric Cyr <[email protected]> Acked-by: Aurabindo Pillai <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6eb3f7d commit fdfd2a8

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_stream.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,24 +239,24 @@ static void delay_cursor_until_vupdate(struct pipe_ctx *pipe_ctx, struct dc *dc)
239239
struct dc_stream_state *stream = pipe_ctx->stream;
240240
unsigned int us_per_line;
241241

242-
if (stream->ctx->asic_id.chip_family == FAMILY_RV &&
243-
ASICREV_IS_RAVEN(stream->ctx->asic_id.hw_internal_rev)) {
242+
if (!dc->hwss.get_vupdate_offset_from_vsync)
243+
return;
244244

245-
vupdate_line = dc->hwss.get_vupdate_offset_from_vsync(pipe_ctx);
246-
if (!dc_stream_get_crtc_position(dc, &stream, 1, &vpos, &nvpos))
247-
return;
245+
vupdate_line = dc->hwss.get_vupdate_offset_from_vsync(pipe_ctx);
246+
if (!dc_stream_get_crtc_position(dc, &stream, 1, &vpos, &nvpos))
247+
return;
248248

249-
if (vpos >= vupdate_line)
250-
return;
249+
if (vpos >= vupdate_line)
250+
return;
251251

252-
us_per_line = stream->timing.h_total * 10000 / stream->timing.pix_clk_100hz;
253-
lines_to_vupdate = vupdate_line - vpos;
254-
us_to_vupdate = lines_to_vupdate * us_per_line;
252+
us_per_line =
253+
stream->timing.h_total * 10000 / stream->timing.pix_clk_100hz;
254+
lines_to_vupdate = vupdate_line - vpos;
255+
us_to_vupdate = lines_to_vupdate * us_per_line;
255256

256-
/* 70 us is a conservative estimate of cursor update time*/
257-
if (us_to_vupdate < 70)
258-
udelay(us_to_vupdate);
259-
}
257+
/* 70 us is a conservative estimate of cursor update time*/
258+
if (us_to_vupdate < 70)
259+
udelay(us_to_vupdate);
260260
#endif
261261
}
262262

0 commit comments

Comments
 (0)