public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t 6/9] i915/gem_exec_schedule: Check timeslice
Date: Tue, 13 Aug 2019 07:20:13 +0100	[thread overview]
Message-ID: <20190813062016.7870-6-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20190813062016.7870-1-chris@chris-wilson.co.uk>

Check that we can run a second request even if an equal priority spinner
is hogging the engine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_exec_schedule.c | 36 ++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 058102103..04cede9c9 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -1033,6 +1033,39 @@ static void preempt_queue(int fd, unsigned ring, unsigned int flags)
 	}
 }
 
+static void preempt_timeslice(int fd, unsigned ring)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	struct drm_i915_gem_exec_object2 obj = {
+		.handle = gem_create(fd, 4096)
+	};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&obj),
+		.buffer_count = 1,
+		.flags = ring,
+		.rsvd1 = gem_context_create(fd),
+	};
+	igt_spin_t *spin;
+
+	/*
+	 * Launch a spinner to occupy the target engine, and then
+	 * check we execute a ping underneath it from a second context.
+	 */
+	spin = igt_spin_new(fd, .engine = ring, .flags = IGT_SPIN_POLL_RUN);
+	igt_spin_busywait_until_started(spin);
+
+	/* Both the active spinner and this are at the same priority */
+	gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
+	gem_execbuf(fd, &execbuf);
+	gem_sync(fd, obj.handle);
+
+	igt_assert(gem_bo_busy(fd, spin->handle));
+	igt_spin_free(fd, spin);
+
+	gem_context_destroy(fd, execbuf.rsvd1);
+	gem_close(fd, obj.handle);
+}
+
 static void preempt_self(int fd, unsigned ring)
 {
 	uint32_t result = gem_create(fd, 4096);
@@ -1740,6 +1773,9 @@ igt_main
 					igt_subtest_f("preempt-queue-contexts-chain-%s", e->name)
 						preempt_queue(fd, e->exec_id | e->flags, CONTEXTS | CHAIN);
 
+					igt_subtest_f("preempt-timeslice-%s", e->name)
+						preempt_timeslice(fd, e->exec_id | e->flags);
+
 					igt_subtest_group {
 						igt_hang_t hang;
 
-- 
2.23.0.rc1

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

  parent reply	other threads:[~2019-08-13  6:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  6:20 [igt-dev] [PATCH i-g-t 1/9] i915/gem_exec_schedule: Limit the plug to fit small rings Chris Wilson
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 2/9] i915/gem_eio: Restrict number of batches of submitted Chris Wilson
2019-08-13 14:21   ` [igt-dev] [Intel-gfx] " Andi Shyti
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 3/9] i915/gem_mmap_gtt: Test mmap_offset lifetime Chris Wilson
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 4/9] i915/gem_shrink: Make some pages dirty Chris Wilson
2019-08-13 15:37   ` Andi Shyti
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 5/9] i915/gem_userptr_blits: Apply some THP pressure Chris Wilson
2019-08-13 15:37   ` [Intel-gfx] " Andi Shyti
2019-08-13  6:20 ` Chris Wilson [this message]
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 7/9] i915/perf_pmu: Flush idle work before waiting for suspend Chris Wilson
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 8/9] Force spin-batch to cause a hang as required Chris Wilson
2019-08-13  6:20 ` [igt-dev] [PATCH i-g-t 9/9] i915/gem_ctx_engine: Drip feed requests into 'independent' Chris Wilson
2019-08-13 15:37   ` Andi Shyti
2019-08-13  7:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/9] i915/gem_exec_schedule: Limit the plug to fit small rings Patchwork
2019-08-13 14:20 ` [igt-dev] [PATCH i-g-t 1/9] " Andi Shyti

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=20190813062016.7870-6-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --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