[PATCH 3/3] drm/i915: Yet another glk+ FBC corruption w/a

Ville Syrjala ville.syrjala at linux.intel.com
Fri Jun 4 19:14:39 UTC 2021


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Found another way to to reproduce the glk+ top of screen FBC
corruption :(

Can be reproduced with the following sequence:
 1. plane update
 2. wait for 1 vblank
 3. wait for >=2 scanlines (past frame start?)
 4. FBC nuke
 5. FBC disable
 6. wait for >=1 vblanks
 7. FBC enable
 8. wait for >=3 vblanks
 9. goto 1.

Couple of ways to avoid the issue:
- vblank wait and FBC nuke after FBC enable
- vblank wait between FBC nuke and FBC disable
- extra vblank wait between plane update and FBC nuke

For simplicity I'm going for the first option here. And since
we're limiting that to only the cases where FBC is getting enabled
(ie. not done for flip nukes) I'm hoping the extra vblank wait
isn't too egregious. Though we should think about ways to avoid
these blocking vblank waits...

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index a65239c1c25f..e09e426b185c 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -353,8 +353,21 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv)
 
 	intel_de_write(dev_priv, ILK_DPFC_CONTROL, dpfc_ctl | DPFC_CTL_EN);
 
-	if (!fbc->active)
+	if (!fbc->active) {
+		/*
+		 * Certain timing sensitive sequences of plane update +
+		 * FBC nuke + FBC disable + FBC enable may cause FBC
+		 * corruption. A vblank wait + FBC nuke after the FBC
+		 * enable seems to help. A vblank wait between the
+		 * FBC nuke and FBC disable also seems effective.
+		 *
+		 * TODO: think about avoiding the blocking vblank wait...
+		 */
+		if (DISPLAY_VER(dev_priv) >= 10)
+			intel_wait_for_vblank(dev_priv, params->crtc.pipe);
+
 		intel_fbc_recompress(dev_priv);
+	}
 }
 
 static bool intel_fbc_hw_is_active(struct drm_i915_private *dev_priv)
-- 
2.26.3



More information about the Intel-gfx-trybot mailing list