All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Check the ring is empty when declaring the engines are idle
Date: Tue, 30 May 2017 15:33:41 +0300	[thread overview]
Message-ID: <87tw42sevu.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170530121334.17364-3-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> As another precaution when testing whether the CS engine is actually
> idle, also inspect the ring's HEAD/TAIL registers, which should be equal
> when there are no commands left to execute by the GPU.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 699f2d3861c7..bc38bd128b76 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1212,6 +1212,11 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
>  
>  	intel_runtime_pm_get(dev_priv);
>  
> +	/* First check that no commands are left in the ring */
> +	if ((I915_READ_HEAD(engine) & HEAD_ADDR) !=
> +	    (I915_READ_TAIL(engine) & TAIL_ADDR))
> +		idle = false;
> +

You are already certain that is not idle so why not goto out?
-Mika

>  	/* No bit for gen2, so assume the CS parser is idle */
>  	if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE))
>  		idle = false;
> -- 
> 2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-05-31 13:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 12:13 [PATCH 1/3] drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle Chris Wilson
2017-05-30 12:13 ` [PATCH 2/3] drm/i915: Hold a wakeref for probing the ring registers Chris Wilson
2017-05-30 12:37   ` Tvrtko Ursulin
2017-05-30 12:50     ` Chris Wilson
2017-05-30 13:09       ` Tvrtko Ursulin
2017-05-30 12:38   ` Mika Kuoppala
2017-05-30 12:13 ` [PATCH 3/3] drm/i915: Check the ring is empty when declaring the engines are idle Chris Wilson
2017-05-30 12:33   ` Mika Kuoppala [this message]
2017-05-31 13:58     ` Chris Wilson
2017-05-31 14:01       ` Mika Kuoppala
2017-06-01 13:24         ` Chris Wilson
2017-05-30 12:21 ` [PATCH 1/3] drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle Tvrtko Ursulin
2017-05-30 12:36   ` Chris Wilson
2017-05-30 12:37 ` Mika Kuoppala
2017-05-30 12:41 ` Joonas Lahtinen
2017-05-30 12:46   ` Chris Wilson
2017-05-30 14:09 ` ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2017-05-30 16:20   ` Chris Wilson
2017-05-30 19:18     ` Saarinen, Jani
2017-05-30 19:39       ` Chris Wilson

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=87tw42sevu.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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.