Skip to content

Commit

Permalink
drm/amd/display: fix corruption with high refresh rates on DCN 3.0
Browse files Browse the repository at this point in the history
This reverts commit bc87d66 and the
register changes from commit 6d4279c.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3412
Cc: mikhail.v.gavrilov@gmail.com
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.10.x
  • Loading branch information
Alex Deucher committed Jul 17, 2024
1 parent 4b0eb9c commit e3615bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
15 changes: 3 additions & 12 deletions drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,19 +945,10 @@ void optc1_set_drr(
OTG_FORCE_LOCK_ON_EVENT, 0,
OTG_SET_V_TOTAL_MIN_MASK_EN, 0,
OTG_SET_V_TOTAL_MIN_MASK, 0);

// Setup manual flow control for EOF via TRIG_A
optc->funcs->setup_manual_trigger(optc);

} else {
REG_UPDATE_4(OTG_V_TOTAL_CONTROL,
OTG_SET_V_TOTAL_MIN_MASK, 0,
OTG_V_TOTAL_MIN_SEL, 0,
OTG_V_TOTAL_MAX_SEL, 0,
OTG_FORCE_LOCK_ON_EVENT, 0);

optc->funcs->set_vtotal_min_max(optc, 0, 0);
}

// Setup manual flow control for EOF via TRIG_A
optc->funcs->setup_manual_trigger(optc);
}

void optc1_set_vtotal_min_max(struct timing_generator *optc, int vtotal_min, int vtotal_max)
Expand Down
10 changes: 10 additions & 0 deletions drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,16 @@ void optc2_setup_manual_trigger(struct timing_generator *optc)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);

/* Set the min/max selectors unconditionally so that
* DMCUB fw may change OTG timings when necessary
* TODO: Remove the w/a after fixing the issue in DMCUB firmware
*/
REG_UPDATE_4(OTG_V_TOTAL_CONTROL,
OTG_V_TOTAL_MIN_SEL, 1,
OTG_V_TOTAL_MAX_SEL, 1,
OTG_FORCE_LOCK_ON_EVENT, 0,
OTG_SET_V_TOTAL_MIN_MASK, (1 << 1)); /* TRIGA */

REG_SET_8(OTG_TRIGA_CNTL, 0,
OTG_TRIGA_SOURCE_SELECT, 21,
OTG_TRIGA_SOURCE_PIPE_SELECT, optc->inst,
Expand Down

0 comments on commit e3615bd

Please sign in to comment.