[igt-dev] [PATCH i-g-t 5/9] tests/gem_exec_capture: Support gens without relocations

Dixit, Ashutosh ashutosh.dixit at intel.com
Sat Aug 14 01:29:28 UTC 2021


On Fri, 13 Aug 2021 00:46:59 -0700, Zbigniew Kempczyński wrote:
>
> @@ -512,10 +545,13 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
>		.rsvd1 = ctx->id,
>	};
>	int64_t timeout = NSEC_PER_SEC; /* 1s, feeling generous, blame debug */
> -	uint64_t ram, gtt, size = 4 << 20;
> +	uint64_t ram, gtt, ahnd, size = 4 << 20;
>	unsigned long count;
>	int link[2], dummy;
>
> +	ahnd = get_reloc_ahnd(fd, ctx->id);
> +	obj.offset = get_offset(ahnd, obj.handle, 4096, 0);
> +
>	igt_require(gem_scheduler_enabled(fd));
>	igt_require(igt_params_set(fd, "reset", "%u", -1)); /* engine resets! */
>	igt_require(gem_gpu_reset_type(fd) > 1);
> @@ -544,7 +580,14 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
>		fd = gem_reopen_driver(fd);
>		igt_debug("Submitting large capture [%ld x %dMiB objects]\n",
>			  count, (int)(size >> 20));
> -		free(__captureN(fd, dir, ring, size, count, ASYNC));
> +
> +		intel_allocator_init();
> +		/* Reopen the allocator in the new process. */
> +		ahnd = get_reloc_ahnd(fd, 0);
> +
> +		free(__captureN(fd, dir, ahnd, ring, size, count, ASYNC));
> +		put_ahnd(ahnd);
> +
>		write(link[1], &fd, sizeof(fd)); /* wake the parent up */
>		igt_force_gpu_reset(fd);
>		write(link[1], &fd, sizeof(fd)); /* wake the parent up */
> @@ -567,19 +610,26 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
>	close(link[1]);
>
>	gem_quiescent_gpu(fd);
> +	put_offset(ahnd, obj.handle);
> +	put_ahnd(ahnd);
> +	intel_allocator_multiprocess_stop();

Is this asymmetric intel_allocator_multiprocess_stop without a start
needed? Otherwise this is:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>


More information about the igt-dev mailing list