Skip to contentSkip to conversation

drm/amd/display: fix corruption with high refresh rates on DCN 3.0

PATCH In review Alex Deucher 4 participants 4 messages Jul 16, 2024 – Jul 29, 2024

Subsystems (5)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: fix corruption with high refresh rates on DCN 3.0

This reverts commit bc87d666c05a13e6d4ae1ddce41fc43d2567b9a2 and the register changes from commit 6d4279cb99ac4f51d10409501d29969f687ac8dc.

---
 .../drm/amd/display/dc/optc/dcn10/dcn10_optc.c    | 15 +++------------
 .../drm/amd/display/dc/optc/dcn20/dcn20_optc.c    | 10 ++++++++++
 2 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +3 -12
index 4f82146d94b1..f00d27b7c6fe 100644
@@ -950,19 +950,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/optc/dcn20/dcn20_optc.c +10 -0
index 43417cff2c9b..b4694985a40a 100644
@@ -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,
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 50 lines · Alex Deucher

This reverts commit bc87d666c05a13e6d4ae1ddce41fc43d2567b9a2 and the register changes from commit 6d4279cb99ac4f51d10409501d29969f687ac8dc.

---
  .../drm/amd/display/dc/optc/dcn10/dcn10_optc.c    | 15 +++------------
  .../drm/amd/display/dc/optc/dcn20/dcn20_optc.c    | 10 ++++++++++
  2 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +3 -12
index 4f82146d94b1..f00d27b7c6fe 100644
@@ -950,19 +950,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/optc/dcn20/dcn20_optc.c +3 -0
index 43417cff2c9b..b4694985a40a 100644
@@ -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

drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c void optc2_setup_manual_trigger(struct timing_generator *optc) · line 468

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/optc/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,

(+Jay)

#2 lore raw
In reply to Alex Deucher
Quoted 8 lines · Alex Deucher

This reverts commit bc87d666c05a13e6d4ae1ddce41fc43d2567b9a2 and the register changes from commit 6d4279cb99ac4f51d10409501d29969f687ac8dc.

Hi Greg, quick note, as I don't see the quoted patch in your 6.10-queue
yet: you might want to pick up e3615bd198289f ("drm/amd/display: fix corruption with high refresh rates on DCN 3.0") [v6.11-rc1, contains table tag] rather sooner than later for 6.10.y, as the problem apparently hit a few people and even made the news:
https://lore.kernel.org/all/[email protected]/
https://www.reddit.com/r/archlinux/comments/1eaxjzo/linux_610_causes_screen_flicker_on_amd_gpus/

Ciao, Thorsten

maintainer
#3 lore raw
Quoted 10 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 8 lines · Alex Deucher

This reverts commit bc87d666c05a13e6d4ae1ddce41fc43d2567b9a2 and the register changes from commit 6d4279cb99ac4f51d10409501d29969f687ac8dc.

Quoted 7 lines

Hi Greg, quick note, as I don't see the quoted patch in your 6.10-queue
yet: you might want to pick up e3615bd198289f ("drm/amd/display: fix corruption with high refresh rates on DCN 3.0") [v6.11-rc1, contains table tag] rather sooner than later for 6.10.y, as the problem apparently hit a few people and even made the news:
https://lore.kernel.org/all/[email protected]/
https://www.reddit.com/r/archlinux/comments/1eaxjzo/linux_610_causes_screen_flicker_on_amd_gpus/

Thanks, now queued up.

greg k-h