[igt-dev] [PATCH i-g-t 39/79] tests/i915/gem_exec_create: Convert to intel_ctx_t
Jason Ekstrand
jason at jlekstrand.net
Thu Jun 17 19:12:46 UTC 2021
Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
tests/i915/gem_exec_create.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c
index 8556cb213..612eb032f 100644
--- a/tests/i915/gem_exec_create.c
+++ b/tests/i915/gem_exec_create.c
@@ -61,16 +61,21 @@ static void all(int fd, unsigned flags, int timeout, int ncpus)
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 obj;
unsigned engines[I915_EXEC_RING_MASK + 1], nengine;
+ const intel_ctx_t *ctx;
nengine = 0;
if (flags & ENGINES) { /* Modern API to iterate over *all* engines */
const struct intel_execution_engine2 *e;
- __for_each_physical_engine(fd, e)
+ ctx = intel_ctx_create_all_physical(fd);
+
+ for_each_ctx_engine(fd, ctx, e)
engines[nengine++] = e->flags;
/* Note: modifies engine map on context 0 */
} else {
+ ctx = intel_ctx_0(fd);
+
for_each_physical_ring(e, fd)
engines[nengine++] = eb_ring(e);
}
@@ -85,6 +90,7 @@ static void all(int fd, unsigned flags, int timeout, int ncpus)
execbuf.buffer_count = 1;
execbuf.flags |= I915_EXEC_HANDLE_LUT;
execbuf.flags |= I915_EXEC_NO_RELOC;
+ execbuf.rsvd1 = ctx->id;
if (__gem_execbuf(fd, &execbuf)) {
execbuf.flags = 0;
gem_execbuf(fd, &execbuf);
@@ -132,6 +138,7 @@ static void all(int fd, unsigned flags, int timeout, int ncpus)
}
igt_waitchildren();
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
+ intel_ctx_destroy(fd, ctx);
}
igt_main
--
2.31.1
More information about the igt-dev
mailing list