[igt-dev] [PATCH i-g-t 29/77] tests/i915/gem_create: Convert to intel_ctx_t

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Jun 14 17:39:51 UTC 2021


On Mon, Jun 14, 2021 at 11:36:44AM -0500, Jason Ekstrand wrote:
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  tests/i915/gem_create.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
> index 167d7d28a..1acf8ee6a 100644
> --- a/tests/i915/gem_create.c
> +++ b/tests/i915/gem_create.c
> @@ -246,20 +246,24 @@ static void always_clear(int i915, int timeout)
>  static void busy_create(int i915, int timeout)
>  {
>  	struct intel_execution_engine2 *e;
> +	const intel_ctx_t *ctx;
>  	igt_spin_t *spin[I915_EXEC_RING_MASK + 1];
>  	unsigned long count = 0;
>  
> +	ctx = intel_ctx_create_all_physical(i915);
> +
>  	igt_fork_hang_detector(i915);
> -	__for_each_physical_engine(i915, e)
> -		spin[e->flags] = igt_spin_new(i915, .engine = e->flags);
> +	for_each_ctx_engine(i915, ctx, e)
> +		spin[e->flags] = igt_spin_new(i915, .ctx = ctx,
> +					      .engine = e->flags);
>  
>  	igt_until_timeout(timeout) {
> -		__for_each_physical_engine(i915, e) {
> +		for_each_ctx_engine(i915, ctx, e) {
>  			uint32_t handle;
>  			igt_spin_t *next;
>  
>  			handle = gem_create(i915, 4096);
> -			next = igt_spin_new(i915,
> +			next = igt_spin_new(i915, .ctx = ctx,
>  					    .engine = e->flags,
>  					    .dependency = handle,
>  					    .flags = IGT_SPIN_SOFTDEP);
> @@ -272,6 +276,8 @@ static void busy_create(int i915, int timeout)
>  		}
>  	}
>  
> +	intel_ctx_destroy(i915, ctx);
> +
>  	igt_info("Created %ld objects while busy\n", count);
>  
>  	gem_quiescent_gpu(i915);

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

--
Zbigniew

> -- 
> 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