drm/amd/display: Program OTG vtotal min/max selectors unconditionally for DCN1+
Subsystems (3)
PATCH v2 1/1 drm/amd/display: Program OTG vtotal min/max selectors unconditionally for DCN1+
For FPO/FAMS, DMCUB will try to change the output timings by writing to the OTG registers. However, the timings written directly to the OTG registers will not be honoured unless VMIN/VMAX selector registers are programmed with the right bits and trigger source is selected correctly. Proper solution needs to go into DMCUB but will require additional state tracking to ensure that the selectors are set and reset correctly as per driver state. Until fix is merged into firmware, apply the workaround in driver to unconditionally write OTG vmin/vmax selectors.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 15 +++------------ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +3 -12
@@ -930,19 +930,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)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +10 -0
@@ -455,6 +455,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,
Signature · 1 line
2.40.1
Quoted 53 lines · Aurabindo Pillai
For FPO/FAMS, DMCUB will try to change the output timings by writing to the OTG registers. However, the timings written directly to the OTG registers will not be honoured unless VMIN/VMAX selector registers are programmed with the right bits and trigger source is selected correctly. Proper solution needs to go into DMCUB but will require additional state tracking to ensure that the selectors are set and reset correctly as per driver state. Until fix is merged into firmware, apply the workaround in driver to unconditionally write OTG vmin/vmax selectors.
Signed-off-by Aurabindo Pillai <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 15 +++------------ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +3
-12@@ -930,19 +930,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)drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +3
-0@@ -455,6 +455,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
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c void optc2_setup_manual_trigger(struct timing_generator *optc) · line 470
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +7
-0+*/ +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,