summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-07-29 13:25:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-08-06 22:43:42 +0100
commitbe535f1ef1eacb418ed7ae23c6f7efe84abd1780 (patch)
tree73850b7d952cde47ecf5808e11c33e276ebb6f23
parenta9d229327f512ee51d80b05325541f6f562a0f96 (diff)
i915/gem_eio: Break early for small rings
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> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
-rw-r--r--tests/i915/gem_eio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index 4d7362d8..dcbcefa9 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]);
}