@@ -738,6 +738,18 @@ static void intel_psr_exit(struct drm_i915_private *dev_priv)
WARN_ON(!(val & EDP_PSR2_ENABLE));
I915_WRITE(EDP_PSR2_CTL, val & ~EDP_PSR2_ENABLE);
} else {
+
+ /* Wait for about 6 frames in case we just enabled PSR,
+ * this prevents the screen from freezing as the HW does
+ * not seem to be able to back off cleanly it is already
+ * trying to enter PSR.
+ */
+ intel_wait_for_register(dev_priv,
+ EDP_PSR_STATUS,
+ EDP_PSR_STATUS_STATE_MASK,
+ EDP_PSR_STATUS_STATE_SRDENT,
+ 100);
+
val = I915_READ(EDP_PSR_CTL);
WARN_ON(!(val & EDP_PSR_ENABLE));
I915_WRITE(EDP_PSR_CTL, val & ~EDP_PSR_ENABLE);
With fbdev, screen freezes after a few continuous PSR exit->enter cycles. Printing out the PSR status register clearly showed this freeze coincided with exiting when the hardware is in a transitory state. So wait for a max of 100 ms (~6 frames) for PSR to become active and then exit. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> --- drivers/gpu/drm/i915/intel_psr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)