From: Alex Deucher <alexander.deucher@xxxxxxx> commit e3615bd198289f319172c428f20857accb46b830 upstream. This reverts commit bc87d666c05a13e6d4ae1ddce41fc43d2567b9a2 and the register changes from commit 6d4279cb99ac4f51d10409501d29969f687ac8dc. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3412 Cc: mikhail.v.gavrilov@xxxxxxxxx Cc: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx> Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@xxxxxxxxx> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # 6.10.x Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c | 15 +++------------ drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) --- a/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c @@ -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) --- a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c @@ -462,6 +462,16 @@ void optc2_setup_manual_trigger(struct t { 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, Patches currently in stable-queue which might be from alexander.deucher@xxxxxxx are queue-6.10/drm-amd-pm-fix-aldebaran-pcie-speed-reporting.patch queue-6.10/drm-amdgpu-remove-gc-hw-ip-9.3.0-from-noretry-1.patch queue-6.10/drm-amdgpu-check-if-nbio-funcs-are-null-in-amdgpu_de.patch queue-6.10/drm-amdkfd-fix-cu-masking-for-gfx-9.4.3.patch queue-6.10/drm-amd-display-use-pre-allocated-temp-structure-for.patch queue-6.10/drm-amd-display-check-for-null-pointer.patch queue-6.10/drm-amd-display-dynamically-allocate-dml2_configurat.patch queue-6.10/drm-amd-display-move-struct-scaler_data-off-stack.patch queue-6.10/drm-amd-display-fix-corruption-with-high-refresh-rates-on-dcn-3.0.patch queue-6.10/drm-amdgpu-fix-memory-range-calculation.patch queue-6.10/drm-amdgpu-fix-type-mismatch-in-amdgpu_gfx_kiq_init_.patch queue-6.10/drm-amdgpu-fix-snprintf-usage-in-amdgpu_gfx_kiq_init.patch queue-6.10/drm-amd-display-fix-graphics_object_id-size.patch queue-6.10/drm-amd-display-add-null-check-before-access-structs.patch