[igt-dev] [PATCH i-g-t] test/i915/gem_ringfill: Create contexts on the right FD with NEW_FD

Jason Ekstrand jason at jlekstrand.net
Wed Jul 14 11:56:12 UTC 2021


We originally did the re-open dance because we were copying engines from
ctx0 on one FD to ctx0 on the other and we needed both FDs.  When we
converted to intel_ctx_t in 81e16a59d788 ("tests/i915/gem_ringfill:
Convert to intel_ctx_t"), we got the FDs wrong in the context create.
This both fixes the bug and avoids the whold FD dance.

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Fixes: 81e16a59d788 ("tests/i915/gem_ringfill: Convert to intel_ctx_t")
---
 tests/i915/gem_ringfill.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tests/i915/gem_ringfill.c b/tests/i915/gem_ringfill.c
index 5d2169d65..d32d47994 100644
--- a/tests/i915/gem_ringfill.c
+++ b/tests/i915/gem_ringfill.c
@@ -203,11 +203,8 @@ static void run_test(int fd, const intel_ctx_t *ctx, unsigned ring,
 		igt_fork(child, nchild) {
 			const intel_ctx_t *child_ctx = NULL;
 			if (flags & NEWFD) {
-				int this;
-
-				this = gem_reopen_driver(fd);
+				fd = gem_reopen_driver(fd);
 				child_ctx = intel_ctx_create(fd, &ctx->cfg);
-				fd = this;
 
 				setup_execbuf(fd, child_ctx, &execbuf, obj, reloc, ring);
 			}
-- 
2.31.1



More information about the igt-dev mailing list