From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: check gtfifodbg after possibly failed writes
Date: Wed, 8 Feb 2012 11:15:58 +0100 [thread overview]
Message-ID: <20120208101558.GB5030@phenom.ffwll.local> (raw)
In-Reply-To: <1328628110-5954-4-git-send-email-ben@bwidawsk.net>
On Tue, Feb 07, 2012 at 04:21:50PM +0100, Ben Widawsky wrote:
> If we don't have a sufficient number of free entries in the FIFO, we
> proceed to do a write anyway. With this check we should have a clue if
> that write actually failed or not.
>
> After some discussion with Daniel Vetter regarding his original
> complaint, we agreed upon this.
>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 15 ++++++++++++---
> drivers/gpu/drm/i915/i915_drv.h | 2 +-
> 2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index a7858a1..ff5c3c7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -413,8 +413,10 @@ void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
> dev_priv->display.force_wake_put(dev_priv);
> }
>
> -void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
> +int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
> {
> + int ret = 0;
> +
> if (dev_priv->gt_fifo_count < GT_FIFO_NUM_RESERVED_ENTRIES) {
> int loop = 500;
> u32 fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES);
> @@ -422,10 +424,13 @@ void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
> udelay(10);
> fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES);
> }
> - WARN_ON(loop < 0 && fifo <= GT_FIFO_NUM_RESERVED_ENTRIES);
> + WARN_ON(loop < 0 && fifo <= GT_FIFO_NUM_RESERVED_ENTRIES &&
> + ++ret);
Bit a bikeshed comment, but I prefer explicit control flow instead of
playing tricks with the short-circuiting behaviour of &&. Mind if you can
change that, too?
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2012-02-08 10:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 15:21 [PATCH 0/3] GTFIFODBG Ben Widawsky
2012-02-07 15:21 ` [PATCH 1/3 v2] drm/i915: use gtfifodbg Ben Widawsky
2012-02-07 15:21 ` [PATCH 2/3 v3] drm/i915: catch gtfifo errors on forcewake_put Ben Widawsky
2012-02-07 16:41 ` Ben Widawsky
2012-02-08 10:14 ` Daniel Vetter
2012-02-07 15:21 ` [PATCH 3/3] drm/i915: check gtfifodbg after possibly failed writes Ben Widawsky
2012-02-08 10:15 ` Daniel Vetter [this message]
2012-02-08 10:28 ` Chris Wilson
2012-02-08 10:34 ` Ben Widawsky
-- strict thread matches above, loose matches on Subject: below --
2012-02-09 9:15 [PATCH 0/3 v3] GTFIFODBG Ben Widawsky
2012-02-09 9:15 ` [PATCH 3/3] drm/i915: check gtfifodbg after possibly failed writes Ben Widawsky
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=20120208101558.GB5030@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ben@bwidawsk.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox