[Intel-gfx] [PATCH] lib: Add argc/argv to igt_simple_init

Daniel Vetter daniel.vetter at ffwll.ch
Mon Jul 14 14:44:44 CEST 2014


There's a pile of ideas around to add generally useful options like
--debug to all igt tests. Or unify the runtime behaviour between
simple and subtest tests a bit more.

The first step to get there is to add argc/argv to igt_simple_init so
that we can get at the argument list.

Cc: Tim Gore <tim.gore at intel.com>
Cc: Thomas Wood <thomas.wood at intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt_core.c                   | 4 +++-
 lib/igt_core.h                   | 9 ++-------
 tests/gem_ctx_basic.c            | 2 +-
 tests/gem_exec_blt.c             | 2 +-
 tests/gem_gtt_speed.c            | 2 +-
 tests/gem_hang.c                 | 2 +-
 tests/gem_render_copy.c          | 2 +-
 tests/gem_render_linear_blits.c  | 2 +-
 tests/gem_render_tiled_blits.c   | 2 +-
 tests/gem_seqno_wrap.c           | 2 +-
 tests/gem_stress.c               | 2 +-
 tests/gen3_mixed_blits.c         | 2 +-
 tests/gen3_render_linear_blits.c | 2 +-
 tests/gen3_render_mixed_blits.c  | 2 +-
 tests/gen3_render_tiledx_blits.c | 2 +-
 tests/gen3_render_tiledy_blits.c | 2 +-
 tests/igt_simulation.c           | 2 +-
 tests/kms_force_connector.c      | 2 +-
 18 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index b7bd16928351..1015b91d8b04 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -451,6 +451,8 @@ void igt_subtest_init(int argc, char **argv)
 
 /**
  * igt_simple_init:
+ * @argc: argc from the test's main()
+ * @argv: argv from the test's main()
  *
  * This initializes a simple test without any support for subtests.
  *
@@ -458,7 +460,7 @@ void igt_subtest_init(int argc, char **argv)
  * #igt_simple_main block instead of stitching the tests's main() function together
  * manually.
  */
-void igt_simple_init(void)
+void igt_simple_init(int argc, char **argv)
 {
 	print_version();
 
diff --git a/lib/igt_core.h b/lib/igt_core.h
index e252eba7be53..8438d0063d81 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -161,12 +161,7 @@ bool igt_only_list_subtests(void);
 	} \
 	static void igt_tokencat(__real_main, __LINE__)(void) \
 
-/**
- * igt_simple_init:
- *
- * Init for simple tests without subtests
- */
-void igt_simple_init(void);
+void igt_simple_init(int argc, char **argv);
 
 /**
  * igt_simple_main:
@@ -178,7 +173,7 @@ void igt_simple_init(void);
 #define igt_simple_main \
 	static void igt_tokencat(__real_main, __LINE__)(void); \
 	int main(int argc, char **argv) { \
-		igt_simple_init(); \
+		igt_simple_init(argc, argv); \
 		igt_tokencat(__real_main, __LINE__)(); \
 		exit(0); \
 	} \
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c
index 3e9b68806c6f..a2464fde0e47 100644
--- a/tests/gem_ctx_basic.c
+++ b/tests/gem_ctx_basic.c
@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
 {
 	int i;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any_render();
 	devid = intel_get_drm_devid(fd);
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index 3bcef1838017..db997b335197 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
 {
 	int i;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	igt_skip_on_simulation();
 
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index 385eeb739eaa..5125078d36e8 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -59,7 +59,7 @@ int main(int argc, char **argv)
 	int loop, i, tiling;
 	int fd;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	igt_skip_on_simulation();
 
diff --git a/tests/gem_hang.c b/tests/gem_hang.c
index 6248244aab5b..d5eb56416114 100644
--- a/tests/gem_hang.c
+++ b/tests/gem_hang.c
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
 {
 	int fd;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	igt_assert_f(argc == 2,
 		     "usage: %s <disabled pipe number>\n",
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index fd26b43f8cdf..76ba40ed05f4 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
 	int opt_dump_png = false;
 	int opt_dump_aub = igt_aub_dump_enabled();
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	while ((opt = getopt(argc, argv, "d")) != -1) {
 		switch (opt) {
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index f847486348dc..ee99deaa7b70 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
 	uint32_t start = 0;
 	int i, j, fd, count;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any();
 
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
index f63c57e3cbcd..3d83f7c530c6 100644
--- a/tests/gem_render_tiled_blits.c
+++ b/tests/gem_render_tiled_blits.c
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
 	int i, j, fd, count;
 	uint32_t devid;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	igt_skip_on_simulation();
 
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index beda28b8eaa9..0fa722d48f3d 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -538,7 +538,7 @@ int main(int argc, char **argv)
 	int wcount = 0;
 	int r = -1;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	parse_options(argc, argv);
 
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 2ccb6fcee2d5..c8d739312e73 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -865,7 +865,7 @@ int main(int argc, char **argv)
 	int i, j;
 	unsigned *current_permutation, *tmp_permutation;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	drm_fd = drm_open_any();
 	devid = intel_get_drm_devid(drm_fd);
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 75d61a58d46b..33eea746cb4b 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -463,7 +463,7 @@ int main(int argc, char **argv)
 	uint32_t start = 0;
 	int i, fd, count;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any();
 
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index 7fe368d61822..7d4a228f4269 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -331,7 +331,7 @@ int main(int argc, char **argv)
 	uint32_t start = 0;
 	int i, fd, count;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any();
 
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index 77ac0e2f28c8..1fe323c49ad7 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -351,7 +351,7 @@ int main(int argc, char **argv)
 	uint32_t start = 0;
 	int i, fd, count;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any();
 
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 95c0c96bba6b..d8e2e87f852d 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -338,7 +338,7 @@ int main(int argc, char **argv)
 	uint32_t start = 0;
 	int i, fd, count;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any();
 
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 1b9a41961dd2..1a819e564687 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -338,7 +338,7 @@ int main(int argc, char **argv)
 	uint32_t start = 0;
 	int i, fd, count;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	fd = drm_open_any();
 
diff --git a/tests/igt_simulation.c b/tests/igt_simulation.c
index 15cbe642e7fa..a1aa2f46076b 100644
--- a/tests/igt_simulation.c
+++ b/tests/igt_simulation.c
@@ -53,7 +53,7 @@ static int do_fork(void)
 		assert(0);
 	case 0:
 		if (simple) {
-			igt_simple_init();
+			igt_simple_init(1, argv_run);
 
 			igt_skip_on_simulation();
 
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index 39cacb93fb85..47e2b484fa85 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -36,7 +36,7 @@ main (int argc, char **argv)
 	drmModeConnector *connector, *temp;
 	igt_display_t display;
 
-	igt_simple_init();
+	igt_simple_init(argc, argv);
 
 	drm_fd = drm_open_any();
 	res = drmModeGetResources(drm_fd);
-- 
2.0.0




More information about the Intel-gfx mailing list