From: Jani Nikula <jani.nikula@linux.intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: workaround bad DSL readout v3
Date: Wed, 23 Sep 2015 10:48:26 +0300 [thread overview]
Message-ID: <87mvwdpodx.fsf@intel.com> (raw)
In-Reply-To: <1442949354-25306-1-git-send-email-jbarnes@virtuousgeek.org>
On Tue, 22 Sep 2015, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> 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.
> Avoid the problem by making sure we don't return scanline_offset from
> the get_crtc_scanline function. In moving the code there, I add to add
> an additional delay since it could be called and have a legitimate 0
> result for some time (depending on the pixel clock).
>
> v2: move hsw dsl read hack to get_crtc_scanline (Ville)
> v3: use break instead of goto (Ville)
> update comment with workaround details (Ville)
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=91579
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Pushed to drm-intel-fixes, thanks for the patch and review.
Sorry for the delay, I failed to notice the patch had been reviewed. It
would have helped if the patch had the Reviewed-by: tag already in
place, or the reviewer (or someone else pointing at the review) had
replied with the Reviewed-by: tag. I spend very little time looking at
individual patches, especially if the appearance is that there's
discussion going on.
BR,
Jani.
> ---
> drivers/gpu/drm/i915/i915_irq.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 1f53061..a8aa797 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -697,6 +697,32 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
> position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3;
>
> /*
> + * On HSW, the DSL reg (0x70000) appears to return 0 if we
> + * read it just before the start of vblank. So try it again
> + * so we don't accidentally end up spanning a vblank frame
> + * increment, causing the pipe_update_end() code to squak at us.
> + *
> + * The nature of this problem means we can't simply check the ISR
> + * bit and return the vblank start value; nor can we use the scanline
> + * debug register in the transcoder as it appears to have the same
> + * problem. We may need to extend this to include other platforms,
> + * but so far testing only shows the problem on HSW.
> + */
> + if (IS_HASWELL(dev) && !position) {
> + int i, temp;
> +
> + for (i = 0; i < 100; i++) {
> + udelay(1);
> + temp = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) &
> + DSL_LINEMASK_GEN3;
> + if (temp != position) {
> + position = temp;
> + break;
> + }
> + }
> + }
> +
> + /*
> * See update_scanline_offset() for the details on the
> * scanline_offset adjustment.
> */
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2015-09-23 7:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 15:34 [PATCH 1/2] drm/i915: workaround bad DSL readout in start of pipe update Jesse Barnes
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 [this message]
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=87mvwdpodx.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox