[Intel-gfx] [igt-dev] [PATCH i-g-t 4/9] tests/gem_gpgpu_fill: Convert from simple to standard igt_main

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon May 24 06:32:17 UTC 2021


On Wed, May 19, 2021 at 03:53:32PM +0100, Matthew Auld wrote:
> From: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> 
> As we need to add new test variants, convert the code to standard
> igt_main format so those variants can be easily accommodated.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at linux.intel.com>
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>

I'm not sure but Janusz likely started migration so you can remove
me from SoB. Then I can give:

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

--
Zbigniew

> ---
>  tests/i915/gem_gpgpu_fill.c | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
> index c605629f..5b11fb35 100644
> --- a/tests/i915/gem_gpgpu_fill.c
> +++ b/tests/i915/gem_gpgpu_fill.c
> @@ -123,20 +123,27 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
>  
>  	munmap(ptr, buf->surface[0].size);
>  }
> -
> -igt_simple_main
> +igt_main
>  {
>  	data_t data = {0, };
>  	igt_fillfunc_t fill_fn = NULL;
>  
> -	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
> -	data.devid = intel_get_drm_devid(data.drm_fd);
> -	igt_require_gem(data.drm_fd);
> -	data.bops = buf_ops_create(data.drm_fd);
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
> +		data.devid = intel_get_drm_devid(data.drm_fd);
> +		igt_require_gem(data.drm_fd);
> +		data.bops = buf_ops_create(data.drm_fd);
> +
> +		fill_fn = igt_get_gpgpu_fillfunc(data.devid);
> +
> +		igt_require_f(fill_fn, "no gpgpu-fill function\n");
>  
> -	fill_fn = igt_get_gpgpu_fillfunc(data.devid);
> +	}
>  
> -	igt_require_f(fill_fn, "no gpgpu-fill function\n");
> +	igt_subtest("basic")
> +		gpgpu_fill(&data, fill_fn);
>  
> -	gpgpu_fill(&data, fill_fn);
> +	igt_fixture {
> +		buf_ops_destroy(data.bops);
> +	}
>  }
> -- 
> 2.26.3
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the Intel-gfx mailing list