[igt-dev] [PATCH i-g-t 2/3] tests/gem_shrink: Add allocator support

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Aug 19 06:22:54 UTC 2021


On Thu, Aug 19, 2021 at 06:49:40AM +0200, Zbigniew Kempczyński wrote:
> From: Ch Sai Gowtham <sai.gowtham.ch at intel.com>
> 
> Signed-off-by: Ch Sai Gowtham <sai.gowtham.ch at intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> ---
>  tests/i915/gem_shrink.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
> index ae61d0759..729ddd7ec 100644
> --- a/tests/i915/gem_shrink.c
> +++ b/tests/i915/gem_shrink.c
> @@ -369,6 +369,7 @@ static void reclaim(unsigned engine, int timeout)
>  	int debugfs = igt_debugfs_dir(fd);
>  	igt_spin_t *spin;
>  	volatile uint32_t *shared;
> +	uint64_t ahnd = get_reloc_ahnd(fd, 0);
>  
>  	shared = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
>  	igt_assert(shared != MAP_FAILED);
> @@ -380,9 +381,9 @@ static void reclaim(unsigned engine, int timeout)
>  		} while (!*shared);
>  	}
>  
> -	spin = igt_spin_new(fd, .engine = engine);
> +	spin = igt_spin_new(fd, .ahnd = ahnd, .engine = engine);
>  	igt_until_timeout(timeout) {
> -		igt_spin_t *next = __igt_spin_new(fd, .engine = engine);
> +		igt_spin_t *next = __igt_spin_new(fd, .ahnd = ahnd, .engine = engine);
>  
>  		igt_spin_set_timeout(spin, timeout_100ms);
>  		gem_sync(fd, spin->handle);
> @@ -391,6 +392,7 @@ static void reclaim(unsigned engine, int timeout)
>  		spin = next;
>  	}
>  	igt_spin_free(fd, spin);
> +	put_ahnd(ahnd);
>  
>  	*shared = 1;
>  	igt_waitchildren();
> -- 
> 2.26.0
>

Looks ok,

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

--
Zbigniew 


More information about the igt-dev mailing list