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

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Wed Jul 14 12:09:19 UTC 2021


On Wed, Jul 14, 2021 at 06:56:12AM -0500, Jason Ekstrand wrote:
> 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")

LGTM

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew

> ---
>  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
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list