All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/2] drm/i915: workaround bad DSL readout in start of pipe update
Date: Thu, 10 Sep 2015 08:34:22 -0700	[thread overview]
Message-ID: <1441899263-12986-1-git-send-email-jbarnes@virtuousgeek.org> (raw)

On HSW at least (still testing other platforms, but should be harmless
elsewhere), the DSL reg reads back as 0 when read around vblank start
time.  This ends up confusing the atomic start/end checking code, since
it causes the update to appear as if it crossed a frame count boundary.
Workaround that by avoiding updates in the first couple of scanlines.
In testing, even a delay of a single microsecond is enough to give us a
good DSL value again, so the millisecond we'll wait when we hit this
case occasionally ought to be plenty.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91579
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_sprite.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index ca7e264..0c2c62f 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -113,8 +113,16 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
 		 */
 		prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
 
+		/*
+		 * On HSW, the DSL reg (0x70000) appears to return 0 if we
+		 * read it right around the start of vblank.  So skip past it
+		 * so we don't accidentally end up spanning a vblank frame
+		 * increment, causing the update_end() code to squak at us.
+		 * (We use 2 in the comparison to account for the
+		 * scanline_offset used to correct the DSL readout.)
+		 */
 		scanline = intel_get_crtc_scanline(crtc);
-		if (scanline < min || scanline > max)
+		if (scanline > 2 && (scanline < min || scanline > max))
 			break;
 
 		if (timeout <= 0) {
-- 
1.9.1

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

             reply	other threads:[~2015-09-10 15:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 15:34 Jesse Barnes [this message]
2015-09-10 15:34 ` [PATCH 2/2] drm/i915: add more debug info for when atomic updates fail Jesse Barnes
2015-09-10 16:05   ` Ville Syrjälä
2015-09-10 16:14     ` Jesse Barnes
2015-09-10 20:23     ` Jesse Barnes
2015-09-14  9:04       ` Daniel Vetter
2015-09-15 17:03   ` [PATCH] drm/i915: add more debug info for when atomic updates fail v2 Jesse Barnes
2015-09-15 17:47     ` Ville Syrjälä
2015-09-10 16:11 ` [PATCH 1/2] drm/i915: workaround bad DSL readout in start of pipe update Ville Syrjälä
2015-09-10 16:17   ` Jesse Barnes
2015-09-10 16:27     ` Ville Syrjälä
2015-09-10 21:38 ` [PATCH] drm/i915: workaround bad DSL readout v2 Jesse Barnes
2015-09-10 21:53   ` Ville Syrjälä
2015-09-10 21:57     ` Jesse Barnes
2015-09-10 22:33       ` Ville Syrjälä
2015-09-14  9:10         ` Daniel Vetter
2015-09-14 13:02           ` Ville Syrjälä
2015-09-14 14:29             ` Daniel Vetter
2015-09-15 21:00         ` Jesse Barnes
2015-09-14 18:47   ` Ville Syrjälä
2015-09-22 16:41   ` Ville Syrjälä
2015-09-22 19:15     ` [PATCH] drm/i915: workaround bad DSL readout v3 Jesse Barnes
2015-09-23  7:48       ` Jani Nikula

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=1441899263-12986-1-git-send-email-jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.