[PATCH] drm/i915: Force PSR exit before disabling PSR
Jouni Högander
jouni.hogander at intel.com
Thu Jul 7 12:19:50 UTC 2022
FIFO underruns are observed when disabling PSR. We are Suspecting
this is somehow dependent on PSR state machine. This patch is forcing
PSR exit before disabling it.
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
drivers/gpu/drm/i915/display/intel_psr.c | 28 ++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index e6a870641cd2..f64cfbf32457 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1364,6 +1364,33 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp)
intel_dp->psr.psr2_sel_fetch_cff_enabled = false;
}
+static void psr_force_hw_tracking_exit(struct intel_dp *intel_dp)
+{
+ struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
+
+ if (intel_dp->psr.psr2_sel_fetch_enabled)
+ intel_de_write(dev_priv,
+ PSR2_MAN_TRK_CTL(intel_dp->psr.transcoder),
+ man_trk_ctl_enable_bit_get(dev_priv) |
+ man_trk_ctl_partial_frame_bit_get(dev_priv) |
+ man_trk_ctl_single_full_frame_bit_get(dev_priv));
+
+ /*
+ * Display WA #0884: skl+
+ * This documented WA for bxt can be safely applied
+ * broadly so we can force HW tracking to exit PSR
+ * instead of disabling and re-enabling.
+ * Workaround tells us to write 0 to CUR_SURFLIVE_A,
+ * but it makes more sense write to the current active
+ * pipe.
+ *
+ * This workaround do not exist for platforms with display 10 or newer
+ * but testing proved that it works for up display 13, for newer
+ * than that testing will be needed.
+ */
+ intel_de_write(dev_priv, CURSURFLIVE(intel_dp->psr.pipe), 0);
+}
+
/**
* intel_psr_disable - Disable PSR
* @intel_dp: Intel DP
@@ -1384,6 +1411,7 @@ void intel_psr_disable(struct intel_dp *intel_dp,
mutex_lock(&intel_dp->psr.lock);
+ psr_force_hw_tracking_exit(intel_dp);
intel_psr_disable_locked(intel_dp);
mutex_unlock(&intel_dp->psr.lock);
--
2.25.1
More information about the Intel-gfx-trybot
mailing list