[Intel-gfx] [PATCH i-g-t v3 4/9] tests/gem_gpgpu_fill: Convert from simple to standard igt_main
Matthew Auld
matthew.auld at intel.com
Wed May 26 13:00:20 UTC 2021
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: Matthew Auld <matthew.auld at intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Acked-by: Petri Latvala <petri.latvala at intel.com>
---
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
More information about the Intel-gfx
mailing list