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 09/13] drm/i915: Move execbuf object synchronisation to i915_gem_execbuffer
Date: Fri, 26 Aug 2016 14:29:30 +0100	[thread overview]
Message-ID: <f52f0f16-3113-0efa-e1f8-49fbc701497d@Intel.com> (raw)
In-Reply-To: <20160825090839.9952-10-chris@chris-wilson.co.uk>


[-- Attachment #1.1: Type: text/plain, Size: 2796 bytes --]

On 25/08/2016 10:08, Chris Wilson wrote:
> We are about to specialize object synchronisation to enable nonblocking
> execbuf submission. First we make a copy of the current object
> synchronisation for execbuffer. The general i915_gem_object_sync() will
> be removed following the removal of CS flips in the near future.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_gem_execbuffer.c | 64 +++++++++++++++++++++++++++++-
>   1 file changed, 63 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 601156c353cc..b7cc158733ad 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1122,6 +1122,68 @@ static unsigned int eb_other_engines(struct drm_i915_gem_request *req)
>   }
>   
>   static int
> +__eb_sync(struct drm_i915_gem_request *to,
> +	  struct drm_i915_gem_request *from)
> +{
> +	int idx, ret;
> +
> +	if (to->engine == from->engine)
> +		return 0;
> +
> +	idx = intel_engine_sync_index(from->engine, to->engine);
> +	if (from->fence.seqno <= from->engine->semaphore.sync_seqno[idx])
> +		return 0;
> +
> +	trace_i915_gem_ring_sync_to(to, from);
> +	if (!i915.semaphores) {
> +		ret = i915_wait_request(from, true, NULL, NO_WAITBOOST);
> +		if (ret)
> +			return ret;
> +	} else {
> +		ret = to->engine->semaphore.sync_to(to, from);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	from->engine->semaphore.sync_seqno[idx] = from->fence.seqno;
> +	return 0;
> +}
> +
> +static int
> +eb_sync(struct drm_i915_gem_object *obj,
> +	struct drm_i915_gem_request *to,
> +	bool write)
> +{
> +	struct i915_gem_active *active;
> +	unsigned long active_mask;
> +	int idx;
> +
> +	if (write) {
> +		active_mask = i915_gem_object_get_active(obj);
> +		active = obj->last_read;
> +	} else {
> +		active_mask = 1;
> +		active = &obj->last_write;
> +	}
> +
> +	for_each_active(active_mask, idx) {
> +		struct drm_i915_gem_request *request;
> +		int ret;
> +
> +		request = i915_gem_active_peek(&active[idx],
> +					       &obj->base.dev->struct_mutex);
> +		if (!request)
> +			continue;
> +
> +		ret = __eb_sync(to, request);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static int
>   i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
>   				struct list_head *vmas)
>   {
> @@ -1133,7 +1195,7 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
>   		struct drm_i915_gem_object *obj = vma->obj;
>   
>   		if (obj->flags & other_rings) {
> -			ret = i915_gem_object_sync(obj, req);
> +			ret = eb_sync(obj, req, obj->base.pending_write_domain);
>   			if (ret)
>   				return ret;
>   		}

Reviewed-by: John Harrison <john.c.harrison@intel.com>


[-- Attachment #1.2: Type: text/html, Size: 3210 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

  reply	other threads:[~2016-08-26 13:29 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 [this message]
2016-08-25  9:08 ` [PATCH 10/13] drm/i915: Nonblocking request submission Chris Wilson
2016-08-26 13:39   ` John Harrison
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=f52f0f16-3113-0efa-e1f8-49fbc701497d@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.