public inbox for intel-gfx@lists.freedesktop.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 1/2] drm/i915: Tidy reporting busy status during	i915_gem_retire_requests()
Date: Wed, 17 Aug 2016 18:04:51 +0300	[thread overview]
Message-ID: <87d1l7o2r0.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1471362315-505-1-git-send-email-chris@chris-wilson.co.uk>

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

> As we know by inspection whether any engine is still busy as we retire
> all the requests, we can pass that information back via return value
> rather than check again afterwards.
>
> v2: A little more polish missed in patch splitting
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem_request.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index bf62427a35b7..02242736e492 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -727,16 +727,18 @@ complete:
>  	return ret;
>  }
>  
> -static void engine_retire_requests(struct intel_engine_cs *engine)
> +static bool engine_retire_requests(struct intel_engine_cs *engine)
>  {
>  	struct drm_i915_gem_request *request, *next;
>  
>  	list_for_each_entry_safe(request, next, &engine->request_list, link) {
>  		if (!i915_gem_request_completed(request))
> -			break;
> +			return false;
>  
>  		i915_gem_request_retire(request);
>  	}
> +
> +	return true;
>  }
>  
>  void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
> @@ -750,9 +752,8 @@ void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
>  
>  	GEM_BUG_ON(!dev_priv->gt.awake);
>  
> -	for_each_engine(engine, dev_priv) {
> -		engine_retire_requests(engine);
> -		if (!intel_engine_is_active(engine))
> +	for_each_engine_masked(engine, dev_priv, dev_priv->gt.active_engines) {
> +		if (engine_retire_requests(engine))
>  			dev_priv->gt.active_engines &= ~intel_engine_flag(engine);
>  	}
>  
> -- 
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-17 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 15:20 [PATCH] drm/i915: Tidy reporting busy status during i915_gem_retire_requests() Chris Wilson
2016-08-16 15:45 ` [PATCH 1/2] " Chris Wilson
2016-08-16 15:45   ` [PATCH 2/2] drm/i915: Make for_each_engine_masked() more compact and quicker Chris Wilson
2016-08-17 15:12     ` Mika Kuoppala
2016-08-17 10:10   ` [PATCH 1/2] drm/i915: Tidy reporting busy status during i915_gem_retire_requests() Joonas Lahtinen
2016-08-17 15:04   ` Mika Kuoppala [this message]
2016-08-16 15:54 ` ✗ Ro.CI.BAT: failure for " 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=87d1l7o2r0.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox