All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Harrison <John.C.Harrison@Intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 10/13] drm/i915: Nonblocking request submission
Date: Fri, 26 Aug 2016 14:39:01 +0100	[thread overview]
Message-ID: <b7b3d6c3-cba3-4302-fd8f-421db555e28a@Intel.com> (raw)
In-Reply-To: <20160825090839.9952-11-chris@chris-wilson.co.uk>

On 25/08/2016 10:08, Chris Wilson wrote:
> Now that we have fences in place to drive request submission, we can
> employ those to queue requests after their dependencies as opposed to
> stalling in the middle of an execbuf ioctl. (However, we still choose to
> spin before enabling the IRQ as that is faster - though contentious.)
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++++++---
>   drivers/gpu/drm/i915/i915_gem_request.c    | 14 +++++++++++++-
>   2 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index b7cc158733ad..104c713ec681 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1136,9 +1136,13 @@ __eb_sync(struct drm_i915_gem_request *to,
>   
>   	trace_i915_gem_ring_sync_to(to, from);
>   	if (!i915.semaphores) {
> -		ret = i915_wait_request(from, true, NULL, NO_WAITBOOST);
> -		if (ret)
> -			return ret;
> +		if (!i915_spin_request(from, TASK_INTERRUPTIBLE, 2)) {
> +			ret = i915_sw_fence_await_dma_fence(&to->submit,
> +							    &from->fence,
Why not use 'i915_sw_fence_await_sw_fence(from->submit)' as below? Or 
conversely, why not use '_await_dma_fence(prev->fence)' below?


> +							    GFP_KERNEL);
> +			if (ret < 0)
> +				return ret;
> +		}
>   	} else {
>   		ret = to->engine->semaphore.sync_to(to, from);
>   		if (ret)
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index db45482ea194..d3477dabb534 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -345,7 +345,7 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
>   {
>   	struct drm_i915_private *dev_priv = engine->i915;
>   	unsigned int reset_counter = i915_reset_counter(&dev_priv->gpu_error);
> -	struct drm_i915_gem_request *req;
> +	struct drm_i915_gem_request *req, *prev;
>   	u32 seqno;
>   	int ret;
>   
> @@ -441,6 +441,18 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
>   	 */
>   	req->head = req->ring->tail;
>   
> +	prev = i915_gem_active_peek(&engine->last_request,
> +				    &req->i915->drm.struct_mutex);
> +	if (prev) {
> +		ret = i915_sw_fence_await_sw_fence(&req->submit,
> +						   &prev->submit,
> +						   GFP_KERNEL);
Is this only required to guarantee seqno ordering?

If the previous request is not sharing any objects, context, etc. then 
there is no fundamental reason why this request should be dependent upon 
the last one.


> +		if (ret < 0) {
> +			i915_add_request(req);
> +			return ERR_PTR(ret);
> +		}
> +	}
> +
>   	return req;
>   
>   err_ctx:
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-26 13:39 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25  9:08 Shortest path to EGL_ANDRIOD_native_sync Chris Wilson
2016-08-25  9:08 ` [PATCH 01/13] drm/i915: Add a sw fence for collecting up dma fences Chris Wilson
2016-08-25 10:42   ` John Harrison
2016-08-25 10:51     ` Chris Wilson
2016-08-25 11:49   ` Joonas Lahtinen
2016-08-25 12:25     ` Chris Wilson
2016-08-25 16:52     ` Chris Wilson
2016-08-25  9:08 ` [PATCH 02/13] drm/i915: Only queue requests during execlists submission Chris Wilson
2016-08-26  9:41   ` Mika Kuoppala
2016-08-26  9:51     ` Chris Wilson
2016-08-26  9:54     ` Chris Wilson
2016-08-26 10:43       ` Mika Kuoppala
2016-08-26 10:53         ` Chris Wilson
2016-08-25  9:08 ` [PATCH 03/13] drm/i915: Record the position of the workarounds in the tail of the request Chris Wilson
2016-08-25  9:35   ` Mika Kuoppala
2016-08-25  9:08 ` [PATCH 04/13] drm/i915: Compute the ELSP register location once Chris Wilson
2016-08-25  9:51   ` Mika Kuoppala
2016-08-25 10:37     ` Chris Wilson
2016-08-25  9:08 ` [PATCH 05/13] drm/i915: Reorder submitting the requests to ELSP Chris Wilson
2016-08-25 13:02   ` Mika Kuoppala
2016-08-25  9:08 ` [PATCH 06/13] drm/i915: Simplify ELSP queue request tracking Chris Wilson
2016-08-25  9:08 ` [PATCH 07/13] drm/i915: Update reset path to fix incomplete requests Chris Wilson
2016-08-25  9:08 ` [PATCH 08/13] drm/i915: Drive request submission through fence callbacks Chris Wilson
2016-08-25 12:08   ` Joonas Lahtinen
2016-08-25 12:35     ` Chris Wilson
2016-08-26 12:47   ` John Harrison
2016-08-26 16:20     ` Chris Wilson
2016-08-25  9:08 ` [PATCH 09/13] drm/i915: Move execbuf object synchronisation to i915_gem_execbuffer Chris Wilson
2016-08-26 13:29   ` John Harrison
2016-08-25  9:08 ` [PATCH 10/13] drm/i915: Nonblocking request submission Chris Wilson
2016-08-26 13:39   ` John Harrison [this message]
2016-08-26 16:14     ` Chris Wilson
2016-08-25  9:08 ` [PATCH 11/13] drm/i915: Serialise execbuf operation after a dma-buf reservation object Chris Wilson
2016-08-26 13:52   ` John Harrison
2016-08-25  9:08 ` [PATCH 12/13] drm/i915: Enable userspace to opt-out of implicit fencing Chris Wilson
2016-08-25  9:08 ` [PATCH 13/13] drm/i915: Support explicit fencing for execbuf Chris Wilson
2016-08-26 15:08   ` John Harrison
2016-08-26 15:29     ` John Harrison
2016-08-26 15:44       ` Chris Wilson
2016-08-25  9:08 ` [PATCH libdrm 14/15] intel: Allow the client to control implicit synchronisation Chris Wilson
2016-08-25  9:08 ` [PATCH libdrm 15/15] intel: Support passing of explicit fencing from execbuf Chris Wilson
2016-09-30 20:53   ` Rafael Antognolli
2016-10-01  8:36     ` Chris Wilson
2016-08-25  9:08 ` [PATCH 16/21] i965: Add explicit fence tracking to batch flush Chris Wilson
2016-08-25  9:08 ` [PATCH 17/21] i965: Split intel_syncobject into vfuncs Chris Wilson
2016-08-25  9:08 ` [PATCH 18/21] i965: Add fd-fence backend to intel_syncobject Chris Wilson
2016-08-25  9:08 ` [PATCH 19/21] rfc! i965: Add intel_screen::has_fence_fd Chris Wilson
2016-08-25  9:08 ` [PATCH 20/21] i965: Implement EGL_ANDROID_native_fence_sync support for DRI2_FENCE Chris Wilson
2016-08-25  9:08 ` [PATCH 21/21] i965: Disable implicit sync when using EGL_ANDROID_native_fence_sync 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=b7b3d6c3-cba3-4302-fd8f-421db555e28a@Intel.com \
    --to=john.c.harrison@intel.com \
    --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.