All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/18] drm/i915/selftests: Force bonded submission to overlap
@ 2019-11-18 18:49 ` Chris Wilson
  0 siblings, 0 replies; 42+ messages in thread
From: Chris Wilson @ 2019-11-18 18:49 UTC (permalink / raw)
  To: intel-gfx

Bonded request submission is designed to allow requests to execute in
parallel as laid out by the user. If the master request is already
finished before its bonded pair is submitted, the pair were not destined
to run in parallel and we lose the information about the master engine
to dictate selection of the secondary. If the second request was
required to be run on a particular engine in a virtual set, that should
have been specified, rather than left to the whims of a random
unconnected requests!

In the selftest, I made the mistake of not ensuring the master would
overlap with its bonded pairs, meaning that it could indeed complete
before we submitted the bonds. Those bonds were then free to select any
available engine in their virtual set, and not the one expected by the
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_lrc.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 16ebe4d2308e..f3b0610d1f10 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -3036,15 +3036,21 @@ static int bond_virtual_engine(struct intel_gt *gt,
 	struct i915_gem_context *ctx;
 	struct i915_request *rq[16];
 	enum intel_engine_id id;
+	struct igt_spinner spin;
 	unsigned long n;
 	int err;
 
 	GEM_BUG_ON(nsibling >= ARRAY_SIZE(rq) - 1);
 
-	ctx = kernel_context(gt->i915);
-	if (!ctx)
+	if (igt_spinner_init(&spin, gt))
 		return -ENOMEM;
 
+	ctx = kernel_context(gt->i915);
+	if (!ctx) {
+		err = -ENOMEM;
+		goto err_spin;
+	}
+
 	err = 0;
 	rq[0] = ERR_PTR(-ENOMEM);
 	for_each_engine(master, gt, id) {
@@ -3055,7 +3061,7 @@ static int bond_virtual_engine(struct intel_gt *gt,
 
 		memset_p((void *)rq, ERR_PTR(-EINVAL), ARRAY_SIZE(rq));
 
-		rq[0] = igt_request_alloc(ctx, master);
+		rq[0] = spinner_create_request(&spin, ctx, master, MI_NOOP);
 		if (IS_ERR(rq[0])) {
 			err = PTR_ERR(rq[0]);
 			goto out;
@@ -3068,10 +3074,17 @@ static int bond_virtual_engine(struct intel_gt *gt,
 							       &fence,
 							       GFP_KERNEL);
 		}
+
 		i915_request_add(rq[0]);
 		if (err < 0)
 			goto out;
 
+		if (!(flags & BOND_SCHEDULE) &&
+		    !igt_wait_for_spinner(&spin, rq[0])) {
+			err = -EIO;
+			goto out;
+		}
+
 		for (n = 0; n < nsibling; n++) {
 			struct intel_context *ve;
 
@@ -3119,6 +3132,8 @@ static int bond_virtual_engine(struct intel_gt *gt,
 			}
 		}
 		onstack_fence_fini(&fence);
+		intel_engine_flush_submission(master);
+		igt_spinner_end(&spin);
 
 		if (i915_request_wait(rq[0], 0, HZ / 10) < 0) {
 			pr_err("Master request did not execute (on %s)!\n",
@@ -3156,6 +3171,8 @@ static int bond_virtual_engine(struct intel_gt *gt,
 		err = -EIO;
 
 	kernel_context_close(ctx);
+err_spin:
+	igt_spinner_fini(&spin);
 	return err;
 }
 
-- 
2.24.0

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

^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2019-11-19 10:09 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-18 18:49 [PATCH 01/18] drm/i915/selftests: Force bonded submission to overlap Chris Wilson
2019-11-18 18:49 ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 02/18] drm/i915/gem: Manually dump the debug trace on GEM_BUG_ON Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 03/18] drm/i915/gt: Close race between engine_park and intel_gt_retire_requests Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 04/18] drm/i915/gt: Unlock engine-pm after queuing the kernel context switch Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 05/18] drm/i915/gt: Schedule request retirement when submission idles Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 06/18] drm/i915: Mark up the calling context for intel_wakeref_put() Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 07/18] drm/i915/gem: Merge GGTT vma flush into a single loop Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 08/18] drm/i915/gt: Only wait for register chipset flush if active Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-19 10:08   ` Mika Kuoppala
2019-11-19 10:08     ` [Intel-gfx] " Mika Kuoppala
2019-11-18 18:49 ` [PATCH 09/18] drm/i915: Protect the obj->vma.list during iteration Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 10/18] drm/i915: Wait until the intel_wakeref idle callback is complete Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 11/18] drm/i915/gt: Declare timeline.lock to be irq-free Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 12/18] drm/i915/gt: Move new timelines to the end of active_list Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 13/18] drm/i915/gt: Schedule next retirement worker first Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 14/18] drm/i915/gt: Flush the requests after wedging on suspend Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 15/18] drm/i915/selftests: Flush the active callbacks Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 16/18] drm/i915/selftests: Be explicit in ERR_PTR handling Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 17/18] drm/i915/selftests: Exercise rc6 handling Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 18:49 ` [PATCH 18/18] drm/i915/gt: Track engine round-trip times Chris Wilson
2019-11-18 18:49   ` [Intel-gfx] " Chris Wilson
2019-11-18 20:29 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/18] drm/i915/selftests: Force bonded submission to overlap Patchwork
2019-11-18 20:29   ` [Intel-gfx] " Patchwork
2019-11-18 20:54 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-11-18 20:54   ` [Intel-gfx] " Patchwork

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.