Igt-dev Archive on lore.kernel.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: [igt-dev] [PATCH i-g-t] i915/gem_eio: Break early for small rings
Date: Mon, 29 Jul 2019 13:27:27 +0100	[thread overview]
Message-ID: <20190729122727.28049-1-chris@chris-wilson.co.uk> (raw)

If the shared legacy ringbuffer is too small to fit 64 new contexts, it
will hang and report -EIO before we are expecting it. Accommodate this
eio as it part of the ABI we are testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_eio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index 4d7362d8f..dcbcefa97 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -559,6 +559,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)
 		const uint32_t bbe = MI_BATCH_BUFFER_END;
 		struct drm_i915_gem_exec_object2 obj[2];
 		struct drm_i915_gem_execbuffer2 execbuf;
+		unsigned int count;
 		igt_spin_t *hang;
 		uint32_t ctx[64];
 		int fence[64];
@@ -587,16 +588,19 @@ static void test_inflight_contexts(int fd, unsigned int wait)
 		execbuf.buffer_count = 2;
 		execbuf.flags = engine | I915_EXEC_FENCE_OUT;
 
+		count = 0;
 		for (unsigned int n = 0; n < ARRAY_SIZE(fence); n++) {
 			execbuf.rsvd1 = ctx[n];
-			gem_execbuf_wr(fd, &execbuf);
+			if (__gem_execbuf_wr(fd, &execbuf))
+				break; /* small shared ring */
 			fence[n] = execbuf.rsvd2 >> 32;
 			igt_assert(fence[n] != -1);
+			count++;
 		}
 
 		check_wait(fd, obj[1].handle, wait, NULL);
 
-		for (unsigned int n = 0; n < ARRAY_SIZE(fence); n++) {
+		for (unsigned int n = 0; n < count; n++) {
 			igt_assert_eq(sync_fence_status(fence[n]), -EIO);
 			close(fence[n]);
 		}
-- 
2.22.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-07-29 12:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 12:27 Chris Wilson [this message]
2019-07-29 14:27 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_eio: Break early for small rings Patchwork
2019-08-06 21:38 ` [Intel-gfx] [igt-dev] [PATCH i-g-t] " Matthew Auld

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=20190729122727.28049-1-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