[igt-dev] [PATCH i-g-t 03/12] tests/gem_gpgpu_fill: Convert from simple to standard igt_main

Matthew Auld matthew.auld at intel.com
Tue May 11 16:51:08 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: Zbigniew Kempczyński <zbigniew.kempczynski at linux.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 igt-dev mailing list