From: Michael Strauss <[email protected]> [WHY] A frame-lock reset trigger sets OTG_AUTO_FORCE_VSYNC_MODE. If the bit is not cleared when the OTG is released, the OTG keeps forcing vsync on every trigger event.
When a display stream later reuses that OTG with DRR enabled, each DRR manual trigger forces an early vsync and cuts the frame short. The display then runs above its programmed refresh rate and underflows, leaving the external monitor with no signal. [HOW] Clear OTG_AUTO_FORCE_VSYNC_MODE in the DCN31/314/35 disable_crtc so a released OTG is left clean. Cc: Aric Cyr <[email protected]> Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Michael Strauss <[email protected]> Signed-off-by: James Lin <[email protected]> --- drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c | 4 ++++ drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c | 4 ++++ drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c index ce9cd32b807a..7706f5f16a68 100644 --- a/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c @@ -143,6 +143,10 @@ static bool optc31_disable_crtc(struct timing_generator *optc) 1, 100000); optc1_clear_optc_underflow(optc); + /* a stale frame-lock force-vsync would cut every DRR-triggered frame short on reuse */ + REG_UPDATE(OTG_VERT_SYNC_CONTROL, + OTG_AUTO_FORCE_VSYNC_MODE, 0); + return true; } /* diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c index f5faa49680ef..5ec70e849cce 100644 --- a/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn314/dcn314_optc.c @@ -142,6 +142,10 @@ static bool optc314_disable_crtc(struct timing_generator *optc) OTG_BUSY, 0, 1, 100000); + /* a stale frame-lock force-vsync would cut every DRR-triggered frame short on reuse */ + REG_UPDATE(OTG_VERT_SYNC_CONTROL, + OTG_AUTO_FORCE_VSYNC_MODE, 0); + return true; } diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c index 406446e5eae5..b4b4792167dd 100644 --- a/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c @@ -162,6 +162,10 @@ static bool optc35_disable_crtc(struct timing_generator *optc) optc1_clear_optc_underflow(optc); + /* a stale frame-lock force-vsync would cut every DRR-triggered frame short on reuse */ + REG_UPDATE(OTG_VERT_SYNC_CONTROL, + OTG_AUTO_FORCE_VSYNC_MODE, 0); + return true; } -- 2.43.0
