All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 10/12] drm/i915/gem: Allow combining submit-fences with syncobj
Date: Wed, 11 Mar 2020 13:30:45 +0000	[thread overview]
Message-ID: <20200311133047.30696-10-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20200311133047.30696-1-chris@chris-wilson.co.uk>

Fixes: a88b6e4cbafd ("drm/i915: Allow specification of parallel execbuf")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++++---
 include/uapi/drm/i915_drm.h                    |  7 ++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 3c427bdfbb2d..96a1f36f161c 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -2456,7 +2456,7 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args,
 		BUILD_BUG_ON(~(ARCH_KMALLOC_MINALIGN - 1) &
 			     ~__I915_EXEC_FENCE_UNKNOWN_FLAGS);
 
-		fences[n] = ptr_pack_bits(syncobj, fence.flags, 2);
+		fences[n] = ptr_pack_bits(syncobj, fence.flags, 3);
 	}
 
 	return fences;
@@ -2487,7 +2487,7 @@ await_fence_array(struct i915_execbuffer *eb,
 		struct dma_fence *fence;
 		unsigned int flags;
 
-		syncobj = ptr_unpack_bits(fences[n], &flags, 2);
+		syncobj = ptr_unpack_bits(fences[n], &flags, 3);
 		if (!(flags & I915_EXEC_FENCE_WAIT))
 			continue;
 
@@ -2511,7 +2511,11 @@ await_fence_array(struct i915_execbuffer *eb,
 			spin_unlock(&syncobj->lock);
 		}
 
-		err = i915_request_await_dma_fence(eb->request, fence);
+		if (flags & I915_EXEC_FENCE_WAIT_SUBMIT)
+			err = i915_request_await_execution(eb->request, fence,
+							   eb->engine->bond_execute);
+		else
+			err = i915_request_await_dma_fence(eb->request, fence);
 		dma_fence_put(fence);
 		if (err < 0)
 			return err;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 2813e579b480..3a24817ca25b 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1040,9 +1040,10 @@ struct drm_i915_gem_exec_fence {
 	 */
 	__u32 handle;
 
-#define I915_EXEC_FENCE_WAIT            (1<<0)
-#define I915_EXEC_FENCE_SIGNAL          (1<<1)
-#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
+#define I915_EXEC_FENCE_WAIT            (1u << 0)
+#define I915_EXEC_FENCE_SIGNAL          (1u << 1)
+#define I915_EXEC_FENCE_WAIT_SUBMIT     (1u << 2)
+#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_WAIT_SUBMIT << 1))
 	__u32 flags;
 };
 
-- 
2.20.1

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

  parent reply	other threads:[~2020-03-11 13:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 13:30 [Intel-gfx] [PATCH 01/12] drm/i915/selftests: Add request throughput measurement to perf Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 02/12] drm/i915: Wrap i915_active in a simple kreffed struct Chris Wilson
2020-03-12 19:37   ` Ruhl, Michael J
2020-03-11 13:30 ` [Intel-gfx] [PATCH 03/12] drm/i915/perf: Schedule oa_config after modifying the contexts Chris Wilson
2020-03-12 10:27   ` Lionel Landwerlin
2020-03-11 13:30 ` [Intel-gfx] [PATCH 04/12] dma-buf: Prettify typecasts for dma-fence-chain Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 05/12] dma-buf: Report signaled links inside dma-fence-chain Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 06/12] dma-buf: Exercise dma-fence-chain under selftests Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 07/12] dma-buf: Proxy fence, an unsignaled fence placeholder Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 08/12] drm/syncobj: Allow use of dma-fence-proxy Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 09/12] drm/i915/gem: Teach execbuf how to wait on future syncobj Chris Wilson
2020-03-11 13:30 ` Chris Wilson [this message]
2020-03-11 13:30 ` [Intel-gfx] [PATCH 11/12] drm/i915/gt: Declare when we enabled timeslicing Chris Wilson
2020-03-11 13:30 ` [Intel-gfx] [PATCH 12/12] drm/i915/gt: Yield the timeslice if caught waiting on a user semaphore Chris Wilson
2020-03-11 17:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/12] drm/i915/selftests: Add request throughput measurement to perf Patchwork
2020-03-11 18:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-12 10:46 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-03-17 12:27 [Intel-gfx] [PATCH 01/12] " Chris Wilson
2020-03-17 12:27 ` [Intel-gfx] [PATCH 10/12] drm/i915/gem: Allow combining submit-fences with syncobj Chris Wilson
2020-03-23 13:43 [Intel-gfx] [PATCH 01/12] drm/i915/selftests: Add request throughput measurement to perf Chris Wilson
2020-03-23 13:43 ` [Intel-gfx] [PATCH 10/12] drm/i915/gem: Allow combining submit-fences with syncobj Chris Wilson
2020-03-26 14:51 [Intel-gfx] [PATCH 01/12] drm/i915/selftests: Add request throughput measurement to perf Chris Wilson
2020-03-26 14:51 ` [Intel-gfx] [PATCH 10/12] drm/i915/gem: Allow combining submit-fences with syncobj 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=20200311133047.30696-10-chris@chris-wilson.co.uk \
    --to=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 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.