Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Skip request serialisation if the timeline is already complete
Date: Wed, 7 Feb 2018 10:45:58 +0000	[thread overview]
Message-ID: <c9b25353-e83f-b804-97ff-c14aa148c160@linux.intel.com> (raw)
In-Reply-To: <20180207084350.3929-2-chris@chris-wilson.co.uk>


On 07/02/2018 08:43, Chris Wilson wrote:
> If the last request on the timeline is already complete, we do not need
> to emit the serialisation barriers.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem_request.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index 384cb49ae4cc..8a35b5591e0e 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -995,7 +995,8 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches)
>   	lockdep_assert_held(&request->i915->drm.struct_mutex);
>   	trace_i915_gem_request_add(request);
>   
> -	/* Make sure that no request gazumped us - if it was allocated after
> +	/*
> +	 * Make sure that no request gazumped us - if it was allocated after
>   	 * our i915_gem_request_alloc() and called __i915_add_request() before
>   	 * us, the timeline will hold its seqno which is later than ours.
>   	 */
> @@ -1022,7 +1023,8 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches)
>   		WARN(err, "engine->emit_flush() failed: %d!\n", err);
>   	}
>   
> -	/* Record the position of the start of the breadcrumb so that
> +	/*
> +	 * Record the position of the start of the breadcrumb so that
>   	 * should we detect the updated seqno part-way through the
>   	 * GPU processing the request, we never over-estimate the
>   	 * position of the ring's HEAD.
> @@ -1031,7 +1033,8 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches)
>   	GEM_BUG_ON(IS_ERR(cs));
>   	request->postfix = intel_ring_offset(request, cs);
>   
> -	/* Seal the request and mark it as pending execution. Note that
> +	/*
> +	 * Seal the request and mark it as pending execution. Note that
>   	 * we may inspect this state, without holding any locks, during
>   	 * hangcheck. Hence we apply the barrier to ensure that we do not
>   	 * see a more recent value in the hws than we are tracking.
> @@ -1039,7 +1042,7 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches)
>   
>   	prev = i915_gem_active_raw(&timeline->last_request,
>   				   &request->i915->drm.struct_mutex);
> -	if (prev) {
> +	if (prev && !i915_gem_request_completed(prev)) {
>   		i915_sw_fence_await_sw_fence(&request->submit, &prev->submit,
>   					     &request->submitq);
>   		if (engine->schedule)
> @@ -1059,7 +1062,8 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches)
>   	list_add_tail(&request->ring_link, &ring->request_list);
>   	request->emitted_jiffies = jiffies;
>   
> -	/* Let the backend know a new request has arrived that may need
> +	/*
> +	 * Let the backend know a new request has arrived that may need
>   	 * to adjust the existing execution schedule due to a high priority
>   	 * request - i.e. we may want to preempt the current request in order
>   	 * to run a high priority dependency chain *before* we can execute this
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

  reply	other threads:[~2018-02-07 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07  8:43 [PATCH 1/2] drm/i915: Trim the retired request queue after submitting Chris Wilson
2018-02-07  8:43 ` [PATCH 2/2] drm/i915: Skip request serialisation if the timeline is already complete Chris Wilson
2018-02-07 10:45   ` Tvrtko Ursulin [this message]
2018-02-07  9:21 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Trim the retired request queue after submitting Patchwork
2018-02-07 10:45 ` [PATCH 1/2] " Tvrtko Ursulin

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=c9b25353-e83f-b804-97ff-c14aa148c160@linux.intel.com \
    --to=tvrtko.ursulin@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