All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH 5/5] drm/i915/psr: Wait for PSR transition to complete before exiting.
Date: Thu, 15 Feb 2018 20:33:22 -0800	[thread overview]
Message-ID: <20180216043322.22874-5-dhinakaran.pandiyan@intel.com> (raw)
In-Reply-To: <20180216043322.22874-1-dhinakaran.pandiyan@intel.com>

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 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 2a31c7cbdb41..d6669f5f890f 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -738,6 +738,17 @@ 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);
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-02-16  4:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  4:33 [PATCH 1/5] drm/i915/frontbuffer: Pull frontbuffer_flush out of gem_obj_pin_to_display Dhinakaran Pandiyan
2018-02-16  4:33 ` [PATCH 2/5] drm/i915/psr: Use more PSR HW tracking Dhinakaran Pandiyan
2018-02-16  8:54   ` Chris Wilson
2018-03-07  3:54     ` Pandiyan, Dhinakaran
2018-02-16  4:33 ` [PATCH 3/5] drm/i915/frontbuffer: HW tracking for cursor moves to fix PSR lags Dhinakaran Pandiyan
2018-02-16  4:33 ` [PATCH 4/5] drm/i915/frontbuffer: Remove early frontbuffer flush in prepare_plane_fb() Dhinakaran Pandiyan
2018-02-16  8:55   ` Chris Wilson
2018-02-16 19:27     ` Pandiyan, Dhinakaran
2018-02-19  9:07       ` Maarten Lankhorst
2018-02-24  3:24         ` Pandiyan, Dhinakaran
2018-02-28 20:28           ` Ville Syrjälä
2018-02-28 20:38             ` Ville Syrjälä
2018-02-28 23:38               ` Pandiyan, Dhinakaran
2018-03-01 10:51                 ` Ville Syrjälä
2018-03-01 11:22                   ` Ville Syrjälä
2018-03-01 18:35                     ` Rodrigo Vivi
2018-03-01 18:43                       ` Ville Syrjälä
2018-03-01 19:00                         ` Rodrigo Vivi
2018-03-01 19:21                           ` Pandiyan, Dhinakaran
2018-03-01 19:24                           ` Ville Syrjälä
2018-02-16  4:33 ` Dhinakaran Pandiyan [this message]
2018-02-16  8:58   ` [PATCH 5/5] drm/i915/psr: Wait for PSR transition to complete before exiting Chris Wilson
2018-02-16 18:58     ` Pandiyan, Dhinakaran
2018-02-16  4:38 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/i915/frontbuffer: Pull frontbuffer_flush out of gem_obj_pin_to_display Patchwork
2018-02-16  4:54 ` ✓ Fi.CI.BAT: success " Patchwork
2018-02-16  8:52 ` [PATCH 1/5] " Chris Wilson
2018-02-16 19:22   ` Pandiyan, Dhinakaran
2018-02-16 11:55 ` ✓ Fi.CI.IGT: success for series starting with [1/5] " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180216043322.22874-5-dhinakaran.pandiyan@intel.com \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.