public inbox for intel-gfx@lists.freedesktop.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 1/2] drm/i915: Only wake the waiter from the interrupt if passed
Date: Tue, 19 Sep 2017 10:23:03 +0100	[thread overview]
Message-ID: <14d0691c-1b15-8ed8-e068-9cec39574a61@linux.intel.com> (raw)
In-Reply-To: <20170918162734.21294-1-chris@chris-wilson.co.uk>


On 18/09/2017 17:27, Chris Wilson wrote:
> As we now check if the seqno is complete in order to signal the fence,
> we can also decide not to wake up the first_waiter until it is ready
> (since it is waiting on the same seqno). The only caveat is that if we
> need the engine->irq_seqno_barrier to enforce some coherency between an
> interrupt and the seqno read, we have to always wake the waiter in order
> to perform that heavyweight barrier.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_irq.c | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 4d0e8f76ed1a..bb69c5b0efc4 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1038,6 +1038,8 @@ static void notify_ring(struct intel_engine_cs *engine)
>   	spin_lock(&engine->breadcrumbs.irq_lock);
>   	wait = engine->breadcrumbs.irq_wait;
>   	if (wait) {
> +		bool wakeup = engine->irq_seqno_barrier;
> +
>   		/* We use a callback from the dma-fence to submit
>   		 * requests after waiting on our own requests. To
>   		 * ensure minimum delay in queuing the next request to
> @@ -1050,12 +1052,15 @@ static void notify_ring(struct intel_engine_cs *engine)
>   		 * and many waiters.
>   		 */
>   		if (i915_seqno_passed(intel_engine_get_seqno(engine),
> -				      wait->seqno) &&
> -		    !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
> -			      &wait->request->fence.flags))
> -			rq = i915_gem_request_get(wait->request);
> +				      wait->seqno)) {
> +			wakeup = true;
> +			if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
> +				      &wait->request->fence.flags))
> +				rq = i915_gem_request_get(wait->request);
> +		}
>   
> -		wake_up_process(wait->tsk);
> +		if (wakeup)
> +			wake_up_process(wait->tsk);
>   	} else {
>   		__intel_engine_disarm_breadcrumbs(engine);
>   	}
> 

Looks straightforward enough.

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

      parent reply	other threads:[~2017-09-19  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 16:27 [PATCH 1/2] drm/i915: Only wake the waiter from the interrupt if passed Chris Wilson
2017-09-18 16:27 ` [PATCH 2/2] drm/i915: Check waiter->seqno carefully in case of preemption Chris Wilson
2017-09-19  9:28   ` Tvrtko Ursulin
2017-09-19 10:07     ` Chris Wilson
2017-09-21 13:45       ` Michał Winiarski
2017-09-18 17:11 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Only wake the waiter from the interrupt if passed Patchwork
2017-09-19  9:00 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-09-19  9:23 ` Tvrtko Ursulin [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=14d0691c-1b15-8ed8-e068-9cec39574a61@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