All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args
@ 2019-05-23 12:26 Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 02/36] lib: Document igt_opt_handler_t semantics Petri Latvala
                   ` (38 more replies)
  0 siblings, 39 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Instead of using a custom main function and calling
igt_subtest_init_parse_opts / igt_simple_init_parse_opts, the _args
variants of igt_main and igt_simple_main take the relevant parameters
and pass them along to the correct init function.

Open-coding a custom main function is no longer necessary and not
recommended.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.h | 64 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 48 insertions(+), 16 deletions(-)

diff --git a/lib/igt_core.h b/lib/igt_core.h
index 44634e0f..cd89921e 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -250,23 +250,38 @@ void __igt_subtest_group_restore(int);
 			       __igt_subtest_group_restore(igt_tokencat(__save,__LINE__) ))
 
 /**
- * igt_main:
- *
- * This is a magic control flow block used instead of a main() function for
- * tests with subtests. Open-coding the main() function is only recommended if
- * the test needs to parse additional command line arguments of its own.
- */
-#define igt_main \
+ * igt_main_args:
+ * @extra_short_opts: getopt_long() compliant list with additional short options
+ * @extra_long_opts: getopt_long() compliant list with additional long options
+ * @help_str: help string for the additional options
+ * @extra_opt_handler: handler for the additional options
+ * @handler_data: user data given to @extra_opt_handler when invoked
+ *
+ * This is a magic control flow block used instead of a main()
+ * function for tests with subtests, along with custom command line
+ * arguments. The macro parameters are passed directly to
+ * #igt_subtest_init_parse_opts.
+ */
+#define igt_main_args(short_opts, long_opts, help_str, opt_handler, handler_data) \
 	static void igt_tokencat(__real_main, __LINE__)(void); \
 	int main(int argc, char **argv) { \
-		igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, \
-					    NULL, NULL); \
+		igt_subtest_init_parse_opts(&argc, argv, \
+					    short_opts, long_opts, help_str, \
+					    opt_handler, handler_data); \
 		igt_tokencat(__real_main, __LINE__)(); \
 		igt_exit(); \
 	} \
 	static void igt_tokencat(__real_main, __LINE__)(void) \
 
 
+/**
+ * igt_main:
+ *
+ * This is a magic control flow block used instead of a main() function for
+ * tests with subtests. Open-coding the main() function is not recommended.
+ */
+#define igt_main igt_main_args(NULL, NULL, NULL, NULL, NULL)
+
 const char *igt_test_name(void);
 void igt_simple_init_parse_opts(int *argc, char **argv,
 				const char *extra_short_opts,
@@ -289,23 +304,40 @@ void igt_simple_init_parse_opts(int *argc, char **argv,
 #define igt_simple_init(argc, argv) \
 	igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL, NULL);
 
+
 /**
- * igt_simple_main:
+ * igt_simple_main_args:
+ * @extra_short_opts: getopt_long() compliant list with additional short options
+ * @extra_long_opts: getopt_long() compliant list with additional long options
+ * @help_str: help string for the additional options
+ * @extra_opt_handler: handler for the additional options
+ * @handler_data: user data given to @extra_opt_handler when invoked
  *
- * This is a magic control flow block used instead of a main() function for
- * simple tests. Open-coding the main() function is only recommended if
- * the test needs to parse additional command line arguments of its own.
+ * This is a magic control flow block used instead of a main()
+ * function for simple tests with custom command line arguments. The
+ * macro parameters are passed directly to
+ * #igt_simple_init_parse_opts.
  */
-#define igt_simple_main \
+#define igt_simple_main_args(short_opts, long_opts, help_str, opt_handler, handler_data) \
 	static void igt_tokencat(__real_main, __LINE__)(void); \
 	int main(int argc, char **argv) { \
-		igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, \
-					   NULL, NULL); \
+		igt_simple_init_parse_opts(&argc, argv, \
+					   short_opts, long_opts, help_str, \
+					   opt_handler, handler_data);	\
 		igt_tokencat(__real_main, __LINE__)(); \
 		igt_exit(); \
 	} \
 	static void igt_tokencat(__real_main, __LINE__)(void) \
 
+
+/**
+ * igt_simple_main:
+ *
+ * This is a magic control flow block used instead of a main() function for
+ * simple tests. Open-coding the main() function is not recommended.
+ */
+#define igt_simple_main igt_simple_main_args(NULL, NULL, NULL, NULL, NULL)
+
 /**
  * igt_constructor:
  *
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 02/36] lib: Document igt_opt_handler_t semantics
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 03/36] i915/gem_exec_blt: Nuke custom main function Petri Latvala
                   ` (37 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Best practices for the help string formatting, along with explicit
symbols for the possible return values for the callback.

Also documented: Do not call the _parse_opts functions yourself, use
igt_main_args or igt_simple_main_args.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.c | 31 ++++++++++++++++++++++++++++---
 lib/igt_core.h |  2 ++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 9ef18eb1..9c86d664 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -857,8 +857,18 @@ out:
  * additional knobs to tune when run manually like the number of rounds execute
  * or the size of the allocated buffer objects.
  *
- * Tests without special needs should just use igt_subtest_init() or use
- * #igt_main directly instead of their own main() function.
+ * Tests should use #igt_main_args instead of their own main()
+ * function and calling this function.
+ *
+ * The @help_str parameter is printed directly after the help text of
+ * standard arguments. The formatting of the string should be:
+ * - One line per option
+ * - Two spaces, option flag, tab character, help text, newline character
+ *
+ * Example: "  -s\tBuffer size\n"
+ *
+ * The opt handler function must return #IGT_OPT_HANDLER_SUCCESS on
+ * successful handling, #IGT_OPT_HANDLER_ERROR on errors.
  *
  * Returns: Forwards any option parsing errors from getopt_long.
  */
@@ -891,7 +901,22 @@ enum igt_log_level igt_log_level = IGT_LOG_INFO;
  * @handler_data: user data given to @extra_opt_handler when invoked
  *
  * This initializes a simple test without any support for subtests and allows
- * an arbitrary set of additional options.
+ * an arbitrary set of additional options. This is useful for tests which have
+ * additional knobs to tune when run manually like the number of rounds execute
+ * or the size of the allocated buffer objects.
+ *
+ * Tests should use #igt_simple_main_args instead of their own main()
+ * function and calling this function.
+ *
+ * The @help_str parameter is printed directly after the help text of
+ * standard arguments. The formatting of the string should be:
+ * - One line per option
+ * - Two spaces, option flag, tab character, help text, newline character
+ *
+ * Example: "  -s\tBuffer size\n"
+ *
+ * The opt handler function must return #IGT_OPT_HANDLER_SUCCESS on
+ * successful handling, #IGT_OPT_HANDLER_ERROR on errors.
  */
 void igt_simple_init_parse_opts(int *argc, char **argv,
 				const char *extra_short_opts,
diff --git a/lib/igt_core.h b/lib/igt_core.h
index cd89921e..88a95ec2 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -145,6 +145,8 @@ void __igt_fixture_end(void) __attribute__((noreturn));
 /* subtest infrastructure */
 jmp_buf igt_subtest_jmpbuf;
 typedef int (*igt_opt_handler_t)(int opt, int opt_index, void *data);
+#define IGT_OPT_HANDLER_SUCCESS 0
+#define IGT_OPT_HANDLER_ERROR -2
 #ifndef __GTK_DOC_IGNORE__ /* gtkdoc wants to document this forward decl */
 struct option;
 #endif
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 03/36] i915/gem_exec_blt: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 02/36] lib: Document igt_opt_handler_t semantics Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 04/36] i915/gem_gtt_speed: " Petri Latvala
                   ` (36 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_exec_blt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/i915/gem_exec_blt.c b/tests/i915/gem_exec_blt.c
index 00926e55..94de1a82 100644
--- a/tests/i915/gem_exec_blt.c
+++ b/tests/i915/gem_exec_blt.c
@@ -293,7 +293,7 @@ static void set_max_freq(int sysfs)
 }
 
 
-int main(int argc, char **argv)
+igt_main
 {
 	const struct {
 		const char *suffix;
@@ -307,8 +307,6 @@ int main(int argc, char **argv)
 	int min = -1, max = -1;
 	int fd, sysfs;
 
-	igt_subtest_init(argc, argv);
-
 	igt_skip_on_simulation();
 
 	igt_fixture {
@@ -344,6 +342,4 @@ int main(int argc, char **argv)
 		close(sysfs);
 		close(fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 04/36] i915/gem_gtt_speed: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 02/36] lib: Document igt_opt_handler_t semantics Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 03/36] i915/gem_exec_blt: Nuke custom main function Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 05/36] i915/gem_hang: " Petri Latvala
                   ` (35 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The size parameter, previously gotten from argv[1], is now the
parameter -s.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_gtt_speed.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
index 3d726c4e..dfa7216c 100644
--- a/tests/i915/gem_gtt_speed.c
+++ b/tests/i915/gem_gtt_speed.c
@@ -86,26 +86,35 @@ static void streaming_load(void *src, int len)
 }
 #endif
 
-int main(int argc, char **argv)
+int size = OBJECT_SIZE;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 's':
+		size = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -s\tObject size in bytes\n";
+
+igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL)
 {
 	struct timeval start, end;
 	uint8_t *buf;
 	uint32_t handle;
 	unsigned cpu = x86_64_features();
-	int size = OBJECT_SIZE;
 	int loop, i, tiling;
 	int fd;
 
-	igt_simple_init(argc, argv);
-
 	igt_skip_on_simulation();
 
-	if (argc > 1)
-		size = atoi(argv[1]);
-	if (size == 0) {
-		igt_warn("Invalid object size specified\n");
-		return 1;
-	}
+	igt_assert_f(size != 0, "Invalid object size specified\n");
 
 	if (cpu) {
 		char str[1024];
@@ -505,6 +514,4 @@ int main(int argc, char **argv)
 
 	gem_close(fd, handle);
 	close(fd);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 05/36] i915/gem_hang: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (2 preceding siblings ...)
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 04/36] i915/gem_gtt_speed: " Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 06/36] i915/gem_linear_blits: " Petri Latvala
                   ` (34 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The pipe parameter, previously gotten from argv[1], is now the
parameter -p.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_hang.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/i915/gem_hang.c b/tests/i915/gem_hang.c
index f506fc70..2c61cac0 100644
--- a/tests/i915/gem_hang.c
+++ b/tests/i915/gem_hang.c
@@ -64,17 +64,24 @@ gpu_hang(void)
 	intel_batchbuffer_flush(batch);
 }
 
-int main(int argc, char **argv)
+static int opt_handler(int opt, int opt_index, void *data)
 {
-	int fd;
-
-	igt_simple_init(argc, argv);
+	switch (opt) {
+	case 'p':
+		bad_pipe = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
 
-	igt_assert_f(argc == 2,
-		     "usage: %s <disabled pipe number>\n",
-		     argv[0]);
+const char *help_str = "  -p\tDisabled pipe number\n";
 
-	bad_pipe = atoi(argv[1]);
+igt_simple_main_args("p:", NULL, help_str, opt_handler, NULL)
+{
+	int fd;
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
@@ -88,6 +95,4 @@ int main(int argc, char **argv)
 	drm_intel_bufmgr_destroy(bufmgr);
 
 	close(fd);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 06/36] i915/gem_linear_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (3 preceding siblings ...)
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 05/36] i915/gem_hang: " Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 07/36] i915/gem_ppgtt: " Petri Latvala
                   ` (33 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_linear_blits.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/i915/gem_linear_blits.c b/tests/i915/gem_linear_blits.c
index 6afa4e9c..a5359288 100644
--- a/tests/i915/gem_linear_blits.c
+++ b/tests/i915/gem_linear_blits.c
@@ -220,12 +220,10 @@ static void run_test(int fd, int count)
 
 #define MAX_32b ((1ull << 32) - 4096)
 
-int main(int argc, char **argv)
+igt_main
 {
 	int fd = 0;
 
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
@@ -261,6 +259,4 @@ int main(int argc, char **argv)
 		run_test(fd, count);
 		igt_stop_signal_helper();
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 07/36] i915/gem_ppgtt: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (4 preceding siblings ...)
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 06/36] i915/gem_linear_blits: " Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 08/36] i915/gem_pread: " Petri Latvala
                   ` (32 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_ppgtt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index ae9869c2..b905ea55 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -330,10 +330,8 @@ static void flink_and_exit(void)
 }
 
 #define N_CHILD 8
-int main(int argc, char **argv)
+igt_main
 {
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		int fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
@@ -369,6 +367,4 @@ int main(int argc, char **argv)
 
 	igt_subtest("flink-and-exit-vma-leak")
 		flink_and_exit();
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 08/36] i915/gem_pread: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (5 preceding siblings ...)
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 07/36] i915/gem_ppgtt: " Petri Latvala
@ 2019-05-23 12:26 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 09/36] i915/gem_pwrite: " Petri Latvala
                   ` (31 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The object size parameter, previously gotten from argv[1], is now the
parameter -s.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_pread.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tests/i915/gem_pread.c b/tests/i915/gem_pread.c
index 83d878ee..c6478765 100644
--- a/tests/i915/gem_pread.c
+++ b/tests/i915/gem_pread.c
@@ -114,10 +114,25 @@ uint32_t *src, dst;
 uint32_t *dst_user, src_stolen, large_stolen;
 uint32_t *stolen_pf_user, *stolen_nopf_user;
 int fd, count;
+int object_size = 0;
 
-int main(int argc, char **argv)
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 's':
+		object_size = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -s\tObject size in bytes\n";
+
+igt_main_args("s:", NULL, help_str, opt_handler, NULL)
 {
-	int object_size = 0;
 	double usecs;
 	char buf[100];
 	const char* bps;
@@ -131,10 +146,6 @@ int main(int argc, char **argv)
 		{ -1 },
 	}, *c;
 
-	igt_subtest_init(argc, argv);
-
-	if (argc > 1 && atoi(argv[1]))
-		object_size = atoi(argv[1]);
 	if (object_size == 0)
 		object_size = OBJECT_SIZE;
 	object_size = (object_size + 3) & -4;
@@ -278,6 +289,4 @@ int main(int argc, char **argv)
 
 		close(fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 09/36] i915/gem_pwrite: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (6 preceding siblings ...)
  2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 08/36] i915/gem_pread: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 10/36] i915/gem_pwrite_pread: " Petri Latvala
                   ` (30 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The object size parameter, previously gotten from argv[1], is now the
parameter -s.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_pwrite.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tests/i915/gem_pwrite.c b/tests/i915/gem_pwrite.c
index 3fd0ef66..97703a2a 100644
--- a/tests/i915/gem_pwrite.c
+++ b/tests/i915/gem_pwrite.c
@@ -240,10 +240,25 @@ static void test_big_gtt(int fd, int scale, unsigned flags)
 uint32_t *src, dst;
 uint32_t *src_user, dst_stolen;
 int fd;
+int object_size = 0;
 
-int main(int argc, char **argv)
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 's':
+		object_size = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -s\tObject size in bytes\n";
+
+igt_main_args("s:", NULL, help_str, opt_handler, NULL)
 {
-	int object_size = 0;
 	double usecs;
 	const char* bps;
 	char buf[100];
@@ -258,10 +273,6 @@ int main(int argc, char **argv)
 		{ -1 },
 	}, *c;
 
-	igt_subtest_init(argc, argv);
-
-	if (argc > 1 && atoi(argv[1]))
-		object_size = atoi(argv[1]);
 	if (object_size == 0)
 		object_size = OBJECT_SIZE;
 	object_size = (object_size + 3) & -4;
@@ -388,6 +399,4 @@ int main(int argc, char **argv)
 
 	igt_fixture
 		close(fd);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 10/36] i915/gem_pwrite_pread: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (7 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 09/36] i915/gem_pwrite: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 11/36] i915/gem_render_copy: " Petri Latvala
                   ` (29 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The object size parameter, previously gotten from argv[1], is now the
parameter -s.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_pwrite_pread.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/tests/i915/gem_pwrite_pread.c b/tests/i915/gem_pwrite_pread.c
index f91fc7c4..3a58eae6 100644
--- a/tests/i915/gem_pwrite_pread.c
+++ b/tests/i915/gem_pwrite_pread.c
@@ -252,18 +252,30 @@ static const char *bytes_per_sec(char *buf, double v)
 
 uint32_t *tmp, src, dst;
 int fd;
+int object_size = 0;
 
-int main(int argc, char **argv)
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 's':
+		object_size = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -s\tObject size in bytes\n";
+
+igt_main_args("s:", NULL, help_str, opt_handler, NULL)
 {
-	int object_size = 0;
 	uint32_t buf[20];
 	int count;
 
-	igt_subtest_init(argc, argv);
 	igt_skip_on_simulation();
 
-	if (argc > 1)
-		object_size = atoi(argv[1]);
 	if (object_size == 0)
 		object_size = OBJECT_SIZE;
 	object_size = (object_size + 3) & -4;
@@ -405,6 +417,4 @@ int main(int argc, char **argv)
 
 		close(fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 11/36] i915/gem_render_copy: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (8 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 10/36] i915/gem_pwrite_pread: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 12/36] i915/gem_render_copy_redux: " Petri Latvala
                   ` (28 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_render_copy.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/tests/i915/gem_render_copy.c b/tests/i915/gem_render_copy.c
index b5d1f45f..b8149483 100644
--- a/tests/i915/gem_render_copy.c
+++ b/tests/i915/gem_render_copy.c
@@ -678,24 +678,29 @@ static void test(data_t *data, uint32_t tiling, uint64_t ccs_modifier)
 
 static int opt_handler(int opt, int opt_index, void *data)
 {
-	if (opt == 'd') {
+	switch (opt) {
+	case 'd':
 		opt_dump_png = true;
-	}
-
-	if (opt == 'a') {
+		break;
+	case 'a':
 		check_all_pixels = true;
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
-int main(int argc, char **argv)
+const char *help_str =
+	"  -d\tDump PNG\n"
+	"  -a\tCheck all pixels\n"
+	;
+
+igt_main_args("da", NULL, help_str, opt_handler, NULL)
 {
 	data_t data = {0, };
 
-	igt_subtest_init_parse_opts(&argc, argv, "da", NULL, NULL,
-				    opt_handler, NULL);
-
 	igt_fixture {
 		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
 		data.devid = intel_get_drm_devid(data.drm_fd);
@@ -743,6 +748,4 @@ int main(int argc, char **argv)
 		intel_batchbuffer_free(data.batch);
 		drm_intel_bufmgr_destroy(data.bufmgr);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 12/36] i915/gem_render_copy_redux: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (9 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 11/36] i915/gem_render_copy: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 13/36] i915/gem_request_retire: " Petri Latvala
                   ` (27 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_render_copy_redux.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/i915/gem_render_copy_redux.c b/tests/i915/gem_render_copy_redux.c
index 24b838ba..ef601c22 100644
--- a/tests/i915/gem_render_copy_redux.c
+++ b/tests/i915/gem_render_copy_redux.c
@@ -202,12 +202,10 @@ static void copy_flink(data_t *data)
 	data_fini(&local);
 }
 
-int main(int argc, char **argv)
+igt_main
 {
 	data_t data = {0, };
 
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		data_init(&data);
 		igt_require_gem(data.fd);
@@ -240,6 +238,4 @@ int main(int argc, char **argv)
 			copy_flink(&data);
 		igt_stop_signal_helper();
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 13/36] i915/gem_request_retire: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (10 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 12/36] i915/gem_render_copy_redux: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 14/36] i915/gem_stress: " Petri Latvala
                   ` (26 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_request_retire.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/i915/gem_request_retire.c b/tests/i915/gem_request_retire.c
index ea1c7327..304882e2 100644
--- a/tests/i915/gem_request_retire.c
+++ b/tests/i915/gem_request_retire.c
@@ -220,10 +220,8 @@ test_retire_vma_not_inactive(int fd)
 
 int fd;
 
-int main(int argc, char **argv)
+igt_main
 {
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
@@ -233,6 +231,4 @@ int main(int argc, char **argv)
 
 	igt_subtest("retire-vma-not-inactive")
 		test_retire_vma_not_inactive(fd);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 14/36] i915/gem_stress: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (11 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 13/36] i915/gem_request_retire: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 15/36] i915/gem_tiled_blits: " Petri Latvala
                   ` (25 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_stress.c | 262 ++++++++++++++++++++--------------------
 1 file changed, 130 insertions(+), 132 deletions(-)

diff --git a/tests/i915/gem_stress.c b/tests/i915/gem_stress.c
index ef8316f2..57e2909c 100644
--- a/tests/i915/gem_stress.c
+++ b/tests/i915/gem_stress.c
@@ -112,13 +112,30 @@ struct option_struct {
     int use_signal_helper;
 };
 
-struct option_struct options;
-
 #define MAX_BUFS		4096
 #define SCRATCH_BUF_SIZE	1024*1024
 #define BUSY_BUF_SIZE		(256*4096)
 #define TILE_BYTES(size)	((size)*(size)*sizeof(uint32_t))
 
+struct option_struct options = {
+	.scratch_buf_size = BUSY_BUF_SIZE,
+	.no_hw = 0,
+	.use_signal_helper = 1,
+	.gpu_busy_load = 0,
+	.num_buffers = 0,
+	.trace_tile = -1,
+	.use_render = 1,
+	.use_blt = 1,
+	.forced_tiling = -1,
+	.use_cpu_maps = 0,
+	.total_rounds = 512,
+	.fail = 1,
+	.ducttape = 1,
+	.tile_size = 16,
+	.tiles_per_buf = BUSY_BUF_SIZE / TILE_BYTES(16),
+	.check_render_cpyfn = 0,
+};
+
 static struct igt_buf buffers[2][MAX_BUFS];
 /* tile i is at logical position tile_permutation[i] */
 static unsigned *tile_permutation;
@@ -627,93 +644,95 @@ static int parse_options(int opt, int opt_index, void *data)
 	int tmp;
 
 	switch(opt) {
-		case 'd':
-			options.no_hw = 1;
-			igt_info("no-hw debug mode\n");
-			break;
-		case 'S':
-			options.use_signal_helper = 0;
-			igt_info("disabling that pesky nuisance who keeps interrupting us\n");
-			break;
-		case 's':
-			tmp = atoi(optarg);
-			if (tmp < options.tile_size*8192)
-				igt_info("scratch buffer size needs to be at least %i\n", options.tile_size * 8192);
-			else if (tmp & (tmp - 1)) {
-				igt_info("scratch buffer size needs to be a power-of-two\n");
-			} else {
-				igt_info("fixed scratch buffer size to %u\n", tmp);
-				options.scratch_buf_size = tmp;
-				sanitize_tiles_per_buf();
-			}
-			break;
-		case 'g':
-			tmp = atoi(optarg);
-			if (tmp < 0 || tmp > 10)
-				igt_info("gpu busy load needs to be bigger than 0 and smaller than 10\n");
-			else {
-				igt_info("gpu busy load factor set to %i\n", tmp);
-				gpu_busy_load = options.gpu_busy_load = tmp;
-			}
-			break;
-		case 'c':
-			options.num_buffers = atoi(optarg);
-			igt_info("buffer count set to %i\n", options.num_buffers);
-			break;
-		case 't':
-			options.trace_tile = atoi(optarg);
-			igt_info("tracing tile %i\n", options.trace_tile);
-			break;
-		case 'r':
-			options.use_render = 0;
-			igt_info("disabling render copy\n");
-			break;
-		case 'b':
-			options.use_blt = 0;
-			igt_info("disabling blt copy\n");
-			break;
-		case 'u':
-			options.forced_tiling = I915_TILING_NONE;
-			igt_info("disabling tiling\n");
-			break;
-		case 'x':
-			if (options.use_cpu_maps) {
-				igt_info("tiling not possible with cpu maps\n");
-			} else {
-				options.forced_tiling = I915_TILING_X;
-				igt_info("using only X-tiling\n");
-			}
-			break;
-		case 'm':
-			options.use_cpu_maps = 1;
-			options.forced_tiling = I915_TILING_NONE;
-			igt_info("disabling tiling\n");
-			break;
-		case 'o':
-			options.total_rounds = atoi(optarg);
-			igt_info("total rounds %i\n", options.total_rounds);
-			break;
-		case 'f':
-			options.fail = 0;
-			igt_info("not failing when detecting errors\n");
-			break;
-		case 'p':
-			options.tiles_per_buf = atoi(optarg);
-			igt_info("tiles per buffer %i\n", options.tiles_per_buf);
-			break;
-		case DUCTAPE:
-			options.ducttape = 0;
-			igt_info("applying duct-tape\n");
-			break;
-		case TILESZ:
-			options.tile_size = atoi(optarg);
+	case 'd':
+		options.no_hw = 1;
+		igt_info("no-hw debug mode\n");
+		break;
+	case 'S':
+		options.use_signal_helper = 0;
+		igt_info("disabling that pesky nuisance who keeps interrupting us\n");
+		break;
+	case 's':
+		tmp = atoi(optarg);
+		if (tmp < options.tile_size*8192)
+			igt_info("scratch buffer size needs to be at least %i\n", options.tile_size * 8192);
+		else if (tmp & (tmp - 1)) {
+			igt_info("scratch buffer size needs to be a power-of-two\n");
+		} else {
+			igt_info("fixed scratch buffer size to %u\n", tmp);
+			options.scratch_buf_size = tmp;
 			sanitize_tiles_per_buf();
-			igt_info("til size %i\n", options.tile_size);
-			break;
-		case CHCK_RENDER:
-			options.check_render_cpyfn = 1;
-			igt_info("checking render copy function\n");
-			break;
+		}
+		break;
+	case 'g':
+		tmp = atoi(optarg);
+		if (tmp < 0 || tmp > 10)
+			igt_info("gpu busy load needs to be bigger than 0 and smaller than 10\n");
+		else {
+			igt_info("gpu busy load factor set to %i\n", tmp);
+			gpu_busy_load = options.gpu_busy_load = tmp;
+		}
+		break;
+	case 'c':
+		options.num_buffers = atoi(optarg);
+		igt_info("buffer count set to %i\n", options.num_buffers);
+		break;
+	case 't':
+		options.trace_tile = atoi(optarg);
+		igt_info("tracing tile %i\n", options.trace_tile);
+		break;
+	case 'r':
+		options.use_render = 0;
+		igt_info("disabling render copy\n");
+		break;
+	case 'b':
+		options.use_blt = 0;
+		igt_info("disabling blt copy\n");
+		break;
+	case 'u':
+		options.forced_tiling = I915_TILING_NONE;
+		igt_info("disabling tiling\n");
+		break;
+	case 'x':
+		if (options.use_cpu_maps) {
+			igt_info("tiling not possible with cpu maps\n");
+		} else {
+			options.forced_tiling = I915_TILING_X;
+			igt_info("using only X-tiling\n");
+		}
+		break;
+	case 'm':
+		options.use_cpu_maps = 1;
+		options.forced_tiling = I915_TILING_NONE;
+		igt_info("disabling tiling\n");
+		break;
+	case 'o':
+		options.total_rounds = atoi(optarg);
+		igt_info("total rounds %i\n", options.total_rounds);
+		break;
+	case 'f':
+		options.fail = 0;
+		igt_info("not failing when detecting errors\n");
+		break;
+	case 'p':
+		options.tiles_per_buf = atoi(optarg);
+		igt_info("tiles per buffer %i\n", options.tiles_per_buf);
+		break;
+	case DUCTAPE:
+		options.ducttape = 0;
+		igt_info("applying duct-tape\n");
+		break;
+	case TILESZ:
+		options.tile_size = atoi(optarg);
+		sanitize_tiles_per_buf();
+		igt_info("til size %i\n", options.tile_size);
+		break;
+	case CHCK_RENDER:
+		options.check_render_cpyfn = 1;
+		igt_info("checking render copy function\n");
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
 	/* actually 32767, according to docs, but that kills our nice pot calculations. */
@@ -726,7 +745,7 @@ static int parse_options(int opt, int opt_index, void *data)
 	}
 	igt_info("Limiting buffer to %dx%d\n", options.max_dimension, options.max_dimension);
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
 static void init(void)
@@ -809,51 +828,32 @@ static void check_render_copyfunc(void)
 	}
 }
 
+static struct option long_options[] = {
+	{"no-hw", 0, 0, 'd'},
+	{"buf-size", 1, 0, 's'},
+	{"gpu-busy-load", 1, 0, 'g'},
+	{"no-signals", 0, 0, 'S'},
+	{"buffer-count", 1, 0, 'c'},
+	{"trace-tile", 1, 0, 't'},
+	{"disable-blt", 0, 0, 'b'},
+	{"disable-render", 0, 0, 'r'},
+	{"untiled", 0, 0, 'u'},
+	{"x-tiled", 0, 0, 'x'},
+	{"use-cpu-maps", 0, 0, 'm'},
+	{"rounds", 1, 0, 'o'},
+	{"no-fail", 0, 0, 'f'},
+	{"tiles-per-buf", 0, 0, 'p'},
+	{"remove-duct-tape", 0, 0, DUCTAPE},
+	{"tile-size", 1, 0, TILESZ},
+	{"check-render-cpyfn", 0, 0, CHCK_RENDER},
+	{NULL, 0, 0, 0},
+};
 
-int main(int argc, char **argv)
+igt_simple_main_args("ds:g:c:t:rbuxmo:fp:",
+		     long_options, NULL, parse_options, NULL)
 {
 	int i, j;
 	unsigned *current_permutation, *tmp_permutation;
-	static struct option long_options[] = {
-		{"no-hw", 0, 0, 'd'},
-		{"buf-size", 1, 0, 's'},
-		{"gpu-busy-load", 1, 0, 'g'},
-		{"no-signals", 0, 0, 'S'},
-		{"buffer-count", 1, 0, 'c'},
-		{"trace-tile", 1, 0, 't'},
-		{"disable-blt", 0, 0, 'b'},
-		{"disable-render", 0, 0, 'r'},
-		{"untiled", 0, 0, 'u'},
-		{"x-tiled", 0, 0, 'x'},
-		{"use-cpu-maps", 0, 0, 'm'},
-		{"rounds", 1, 0, 'o'},
-		{"no-fail", 0, 0, 'f'},
-		{"tiles-per-buf", 0, 0, 'p'},
-		{"remove-duct-tape", 0, 0, DUCTAPE},
-		{"tile-size", 1, 0, TILESZ},
-		{"check-render-cpyfn", 0, 0, CHCK_RENDER},
-		{NULL, 0, 0, 0},
-	};
-
-	options.scratch_buf_size = 256*4096;
-	options.no_hw = 0;
-	options.use_signal_helper = 1;
-	options.gpu_busy_load = 0;
-	options.num_buffers = 0;
-	options.trace_tile = -1;
-	options.use_render = 1;
-	options.use_blt = 1;
-	options.forced_tiling = -1;
-	options.use_cpu_maps = 0;
-	options.total_rounds = 512;
-	options.fail = 1;
-	options.ducttape = 1;
-	options.tile_size = 16;
-	options.tiles_per_buf = options.scratch_buf_size / TILE_BYTES(options.tile_size);
-	options.check_render_cpyfn = 0;
-
-	igt_simple_init_parse_opts(&argc, argv,"ds:g:c:t:rbuxmo:fp:",
-				   long_options, NULL, parse_options, NULL);
 
 	drm_fd = drm_open_driver(DRIVER_INTEL);
 	devid = intel_get_drm_devid(drm_fd);
@@ -910,6 +910,4 @@ int main(int argc, char **argv)
 	close(drm_fd);
 
 	igt_stop_signal_helper();
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 15/36] i915/gem_tiled_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (12 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 14/36] i915/gem_stress: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 16/36] i915/gem_userptr_blits: " Petri Latvala
                   ` (24 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_tiled_blits.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/i915/gem_tiled_blits.c b/tests/i915/gem_tiled_blits.c
index 51c1b584..28861d0b 100644
--- a/tests/i915/gem_tiled_blits.c
+++ b/tests/i915/gem_tiled_blits.c
@@ -198,10 +198,8 @@ static void run_test(int count)
 
 int fd;
 
-int main(int argc, char **argv)
+igt_main
 {
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
@@ -249,6 +247,4 @@ int main(int argc, char **argv)
 
 		close(fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 16/36] i915/gem_userptr_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (13 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 15/36] i915/gem_tiled_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 17/36] i915/gen3_mixed_blits: " Petri Latvala
                   ` (23 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The buffer count parameter, previously gotten from argv[1], is now the
parameter -c.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_userptr_blits.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index 8f8ddf43..1373f160 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -1776,13 +1776,25 @@ uint64_t total_ram;
 uint64_t aperture_size;
 int fd, count;
 
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 'c':
+		count = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
 
-int main(int argc, char **argv)
+const char *help_str = "  -c\tBuffer count\n";
+
+igt_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	int size = sizeof(linear);
 
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_assert(fd >= 0);
@@ -1793,8 +1805,6 @@ int main(int argc, char **argv)
 		aperture_size = gem_aperture_size(fd);
 		igt_info("Aperture size is %lu MiB\n", (long)(aperture_size / (1024*1024)));
 
-		if (argc > 1)
-			count = atoi(argv[1]);
 		if (count == 0)
 			count = 2 * aperture_size / (1024*1024) / 3;
 
@@ -2044,6 +2054,4 @@ int main(int argc, char **argv)
 
 	igt_subtest("access-control")
 		test_access_control(fd);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 17/36] i915/gen3_mixed_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (14 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 16/36] i915/gem_userptr_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 18/36] i915/gen3_render_linear_blits: " Petri Latvala
                   ` (22 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The buffer count parameter, previously gotten from argv[1], is now the
parameter -c.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gen3_mixed_blits.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gen3_mixed_blits.c b/tests/i915/gen3_mixed_blits.c
index 447d2e5d..03a289df 100644
--- a/tests/i915/gen3_mixed_blits.c
+++ b/tests/i915/gen3_mixed_blits.c
@@ -442,21 +442,33 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	munmap(v, WIDTH*HEIGHT*4);
 }
 
-int main(int argc, char **argv)
+int count;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 'c':
+		count = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -c\tBuffer count\n";
+
+igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	uint32_t *handle, *tiling, *start_val;
 	uint32_t start = 0;
-	int i, fd, count;
-
-	igt_simple_init(argc, argv);
+	int i, fd;
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
-	count = 0;
-	if (argc > 1)
-		count = atoi(argv[1]);
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
@@ -518,6 +530,4 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 18/36] i915/gen3_render_linear_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (15 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 17/36] i915/gen3_mixed_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 19/36] i915/gen3_render_mixed_blits: " Petri Latvala
                   ` (21 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The buffer count parameter, previously gotten from argv[1], is now the
parameter -c.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gen3_render_linear_blits.c | 28 ++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gen3_render_linear_blits.c b/tests/i915/gen3_render_linear_blits.c
index 9d1499a5..d3fc8055 100644
--- a/tests/i915/gen3_render_linear_blits.c
+++ b/tests/i915/gen3_render_linear_blits.c
@@ -315,21 +315,33 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	}
 }
 
-int main(int argc, char **argv)
+int count;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 'c':
+		count = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -c\tBuffer count\n";
+
+igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	uint32_t *handle, *start_val;
 	uint32_t start = 0;
-	int i, fd, count;
-
-	igt_simple_init(argc, argv);
+	int i, fd;
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
-	count = 0;
-	if (argc > 1)
-		count = atoi(argv[1]);
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
@@ -383,6 +395,4 @@ int main(int argc, char **argv)
 	}
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 19/36] i915/gen3_render_mixed_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (16 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 18/36] i915/gen3_render_linear_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 20/36] i915/gen3_render_tiledx_blits: " Petri Latvala
                   ` (20 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The buffer count parameter, previously gotten from argv[1], is now the
parameter -c.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gen3_render_mixed_blits.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gen3_render_mixed_blits.c b/tests/i915/gen3_render_mixed_blits.c
index 6dd7392b..15895c21 100644
--- a/tests/i915/gen3_render_mixed_blits.c
+++ b/tests/i915/gen3_render_mixed_blits.c
@@ -336,21 +336,33 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	munmap(v, WIDTH*HEIGHT*4);
 }
 
-int main(int argc, char **argv)
+int count;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 'c':
+		count = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -c\tBuffer count\n";
+
+igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	uint32_t *handle, *tiling, *start_val;
 	uint32_t start = 0;
-	int i, fd, count;
-
-	igt_simple_init(argc, argv);
+	int i, fd;
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
-	count = 0;
-	if (argc > 1)
-		count = atoi(argv[1]);
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
@@ -412,6 +424,4 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 20/36] i915/gen3_render_tiledx_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (17 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 19/36] i915/gen3_render_mixed_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 21/36] i915/gen3_render_tiledy_blits: " Petri Latvala
                   ` (19 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The buffer count parameter, previously gotten from argv[1], is now the
parameter -c.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gen3_render_tiledx_blits.c | 28 ++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gen3_render_tiledx_blits.c b/tests/i915/gen3_render_tiledx_blits.c
index 7efef589..f1a17714 100644
--- a/tests/i915/gen3_render_tiledx_blits.c
+++ b/tests/i915/gen3_render_tiledx_blits.c
@@ -323,21 +323,33 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	munmap(v, WIDTH*HEIGHT*4);
 }
 
-int main(int argc, char **argv)
+int count;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 'c':
+		count = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -c\tBuffer count\n";
+
+igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	uint32_t *handle, *start_val;
 	uint32_t start = 0;
-	int i, fd, count;
-
-	igt_simple_init(argc, argv);
+	int i, fd;
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
-	count = 0;
-	if (argc > 1)
-		count = atoi(argv[1]);
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
@@ -391,6 +403,4 @@ int main(int argc, char **argv)
 	}
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 21/36] i915/gen3_render_tiledy_blits: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (18 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 20/36] i915/gen3_render_tiledx_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 22/36] i915/i915_pm_rpm: " Petri Latvala
                   ` (18 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The buffer count parameter, previously gotten from argv[1], is now the
parameter -c.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gen3_render_tiledy_blits.c | 28 ++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gen3_render_tiledy_blits.c b/tests/i915/gen3_render_tiledy_blits.c
index 6d1d8bca..94127b62 100644
--- a/tests/i915/gen3_render_tiledy_blits.c
+++ b/tests/i915/gen3_render_tiledy_blits.c
@@ -323,21 +323,33 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	munmap(v, WIDTH*HEIGHT*4);
 }
 
-int main(int argc, char **argv)
+int count;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+	case 'c':
+		count = atoi(optarg);
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str = "  -c\tBuffer count\n";
+
+igt_simple_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	uint32_t *handle, *start_val;
 	uint32_t start = 0;
-	int i, fd, count;
-
-	igt_simple_init(argc, argv);
+	int i, fd;
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	igt_require(IS_GEN3(intel_get_drm_devid(fd)));
 
-	count = 0;
-	if (argc > 1)
-		count = atoi(argv[1]);
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
@@ -398,6 +410,4 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 22/36] i915/i915_pm_rpm: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (19 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 21/36] i915/gen3_render_tiledy_blits: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 23/36] kms_concurrent: " Petri Latvala
                   ` (17 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/i915_pm_rpm.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index a2c9d0ed..736cf72b 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -1950,26 +1950,23 @@ static int opt_handler(int opt, int opt_index, void *data)
 		stay = true;
 		break;
 	default:
-		igt_assert(0);
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
-int main(int argc, char *argv[])
-{
-	const char *help_str =
-	       "  --stress\t\tMake the stress-tests more stressful.\n"
-	       "  --stay\t\tDisable all screen and try to go into runtime pm. Useful for debugging.";
-	static struct option long_options[] = {
-		{"stress", 0, 0, 'l'},
-		{"stay", 0, 0, 's'},
-		{ 0, 0, 0, 0 }
-	};
-
-	igt_subtest_init_parse_opts(&argc, argv, "", long_options,
-				    help_str, opt_handler, NULL);
+const char *help_str =
+	"  --stress\t\tMake the stress-tests more stressful.\n"
+	"  --stay\t\tDisable all screen and try to go into runtime pm. Useful for debugging.";
+static struct option long_options[] = {
+	{"stress", 0, 0, 'l'},
+	{"stay", 0, 0, 's'},
+	{ 0, 0, 0, 0 }
+};
 
+igt_main_args("", long_options, help_str, opt_handler, NULL)
+{
 	igt_subtest("basic-rte") {
 		igt_assert(setup_environment());
 		basic_subtest();
@@ -2120,6 +2117,4 @@ int main(int argc, char *argv[])
 		/* Remove our mmio_debugging module */
 		igt_i915_driver_unload();
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 23/36] kms_concurrent: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (20 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 22/36] i915/i915_pm_rpm: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 24/36] kms_cursor_edge_walk: " Petri Latvala
                   ` (16 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_concurrent.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index d82ca040..23b05ea1 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -372,30 +372,27 @@ static int opt_handler(int option, int option_index, void *input)
 		opt.seed = strtol(optarg, NULL, 0);
 		break;
 	default:
-		igt_assert(false);
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
 const char *help_str =
 	"  --iterations Number of iterations for test coverage. -1 loop forever, default 1 iteration\n"
 	"  --seed       Seed for random number generator\n";
+struct option long_options[] = {
+	{ "iterations", required_argument, NULL, 'i'},
+	{ "seed",    required_argument, NULL, 's'},
+	{ 0, 0, 0, 0 }
+};
 
 static data_t data;
 
-int main(int argc, char *argv[])
+igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
-	struct option long_options[] = {
-		{ "iterations", required_argument, NULL, 'i'},
-		{ "seed",    required_argument, NULL, 's'},
-		{ 0, 0, 0, 0 }
-	};
 	enum pipe pipe;
 
-	igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
-				    opt_handler, NULL);
-
 	igt_skip_on_simulation();
 
 	igt_fixture {
@@ -414,6 +411,4 @@ int main(int argc, char *argv[])
 		igt_display_fini(&data.display);
 		close(data.drm_fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 24/36] kms_cursor_edge_walk: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (21 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 23/36] kms_concurrent: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 25/36] kms_flip: " Petri Latvala
                   ` (15 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_cursor_edge_walk.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/tests/kms_cursor_edge_walk.c b/tests/kms_cursor_edge_walk.c
index 86629555..809dca42 100644
--- a/tests/kms_cursor_edge_walk.c
+++ b/tests/kms_cursor_edge_walk.c
@@ -285,31 +285,27 @@ static int opt_handler(int opt, int opt_index, void *_data)
 		data->jump = true;
 		break;
 	default:
-		break;
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
 static data_t data;
 static uint64_t max_curw = 64, max_curh = 64;
+static const struct option long_opts[] = {
+	{ .name = "colored", .val = 'c' },
+	{ .name = "disable", .val = 'd'},
+	{ .name = "jump", .val = 'j' },
+	{}
+};
+static const char *help_str =
+	"  --colored\t\tUse a colored cursor (disables CRC checks)\n"
+	"  --disable\t\tDisable the cursor between each step\n"
+	"  --jump\t\tJump the cursor to middle of the screen between each step)\n";
 
-int main(int argc, char **argv)
+igt_main_args("", long_opts, help_str, opt_handler, &data)
 {
-	static const struct option long_opts[] = {
-                { .name = "colored", .val = 'c' },
-                { .name = "disable", .val = 'd'},
-                { .name = "jump", .val = 'j' },
-                {}
-        };
-        static const char *help_str =
-		"  --colored\t\tUse a colored cursor (disables CRC checks)\n"
-		"  --disable\t\tDisable the cursor between each step\n"
-		"  --jump\t\tJump the cursor to middle of the screen between each step)\n";
-
-	igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str,
-                                    opt_handler, &data);
-
 	igt_skip_on_simulation();
 
 	igt_fixture {
@@ -370,6 +366,4 @@ int main(int argc, char **argv)
 
 	igt_fixture
 		igt_display_fini(&data.display);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 25/36] kms_flip: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (22 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 24/36] kms_cursor_edge_walk: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 26/36] kms_force_connector_basic: " Petri Latvala
                   ` (14 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_flip.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 8c17c8da..d7c1f9cf 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1481,7 +1481,7 @@ static void test_nonblocking_read(int in)
 	close(fd);
 }
 
-int main(int argc, char **argv)
+igt_main
 {
 	struct {
 		int duration;
@@ -1530,8 +1530,6 @@ int main(int argc, char **argv)
 	};
 	int i;
 
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		drm_fd = drm_open_driver_master(DRIVER_ANY);
 
@@ -1591,11 +1589,4 @@ int main(int argc, char **argv)
 			run_pair(tests[i].duration, tests[i].flags);
 	}
 	igt_stop_signal_helper();
-
-	/*
-	 * Let drm_fd leak, since it's needed by the dpms restore
-	 * exit_handler and igt_exit() won't return.
-	 */
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 26/36] kms_force_connector_basic: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (23 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 25/36] kms_flip: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 27/36] kms_frontbuffer_tracking: " Petri Latvala
                   ` (13 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_force_connector_basic.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index b8246e66..20812d5e 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -65,25 +65,23 @@ static int opt_handler(int opt, int opt_index, void *data)
 		break;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
-int main(int argc, char **argv)
+struct option long_opts[] = {
+	{"reset", 0, 0, 'r'},
+	{0, 0, 0, 0}
+};
+const char *help_str =
+	"  --reset\t\tReset all connector force states and edid.\n";
+
+igt_main_args("", long_opts, help_str, opt_handler, NULL)
 {
 	/* force the VGA output and test that it worked */
 	int drm_fd = 0;
 	drmModeRes *res;
 	drmModeConnector *vga_connector = NULL, *temp;
 	int start_n_modes, start_connection;
-	struct option long_opts[] = {
-		{"reset", 0, 0, 'r'},
-		{0, 0, 0, 0}
-	};
-	const char *help_str =
-	       "  --reset\t\tReset all connector force states and edid.\n";
-
-	igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str,
-				    opt_handler, NULL);
 
 	igt_fixture {
 		unsigned vga_connector_id = 0;
@@ -320,6 +318,4 @@ int main(int argc, char **argv)
 
 		reset_connectors();
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 27/36] kms_frontbuffer_tracking: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (24 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 26/36] kms_force_connector_basic: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 28/36] kms_mmap_write_crc: " Petri Latvala
                   ` (12 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_frontbuffer_tracking.c | 62 ++++++++++++++++----------------
 1 file changed, 32 insertions(+), 30 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index ee13b138..1037faf8 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -3070,19 +3070,23 @@ static int opt_handler(int option, int option_index, void *data)
 	case 'x':
 		errno = 0;
 		opt.shared_fb_x_offset = strtol(optarg, NULL, 0);
-		igt_assert(errno == 0);
+		if (errno != 0)
+			return IGT_OPT_HANDLER_ERROR;
 		break;
 	case 'y':
 		errno = 0;
 		opt.shared_fb_y_offset = strtol(optarg, NULL, 0);
-		igt_assert(errno == 0);
+		if (errno != 0)
+			return IGT_OPT_HANDLER_ERROR;
 		break;
 	case '1':
-		igt_assert_eq(opt.only_pipes, PIPE_COUNT);
+		if (opt.only_pipes != PIPE_COUNT)
+			return IGT_OPT_HANDLER_ERROR;
 		opt.only_pipes = PIPE_SINGLE;
 		break;
 	case '2':
-		igt_assert_eq(opt.only_pipes, PIPE_COUNT);
+		if (opt.only_pipes != PIPE_COUNT)
+			return IGT_OPT_HANDLER_ERROR;
 		opt.only_pipes = PIPE_DUAL;
 		break;
 	case 'l':
@@ -3090,14 +3094,16 @@ static int opt_handler(int option, int option_index, void *data)
 			opt.tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 		else if (!strcmp(optarg, "y"))
 			opt.tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
-		else
-			igt_assert_f(false, "Bad tiling value: %s\n", optarg);
+		else {
+			igt_warn("Bad tiling value: %s\n", optarg);
+			return IGT_OPT_HANDLER_ERROR;
+		}
 		break;
 	default:
-		igt_assert(false);
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
 const char *help_str =
@@ -3245,28 +3251,26 @@ static const char *flip_str(enum flip_type flip)
 
 #define TEST_MODE_ITER_END } } } } } }
 
-int main(int argc, char *argv[])
+struct option long_options[] = {
+	{ "no-status-check",          0, 0, 's'},
+	{ "no-crc-check",             0, 0, 'c'},
+	{ "no-fbc-compression-check", 0, 0, 'o'},
+	{ "no-fbc-action-check",      0, 0, 'a'},
+	{ "no-edp",                   0, 0, 'e'},
+	{ "use-small-modes",          0, 0, 'm'},
+	{ "show-hidden",              0, 0, 'i'},
+	{ "step",                     0, 0, 't'},
+	{ "shared-fb-x",              1, 0, 'x'},
+	{ "shared-fb-y",              1, 0, 'y'},
+	{ "1p-only",                  0, 0, '1'},
+	{ "2p-only",                  0, 0, '2'},
+	{ "tiling",                   1, 0, 'l'},
+	{ 0, 0, 0, 0 }
+};
+
+igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
 	struct test_mode t;
-	struct option long_options[] = {
-		{ "no-status-check",          0, 0, 's'},
-		{ "no-crc-check",             0, 0, 'c'},
-		{ "no-fbc-compression-check", 0, 0, 'o'},
-		{ "no-fbc-action-check",      0, 0, 'a'},
-		{ "no-edp",                   0, 0, 'e'},
-		{ "use-small-modes",          0, 0, 'm'},
-		{ "show-hidden",              0, 0, 'i'},
-		{ "step",                     0, 0, 't'},
-		{ "shared-fb-x",              1, 0, 'x'},
-		{ "shared-fb-y",              1, 0, 'y'},
-		{ "1p-only",                  0, 0, '1'},
-		{ "2p-only",                  0, 0, '2'},
-		{ "tiling",                   1, 0, 'l'},
-		{ 0, 0, 0, 0 }
-	};
-
-	igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
-				    opt_handler, NULL);
 
 	igt_fixture
 		setup_environment();
@@ -3473,6 +3477,4 @@ int main(int argc, char *argv[])
 
 	igt_fixture
 		teardown_environment();
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 28/36] kms_mmap_write_crc: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (25 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 27/36] kms_frontbuffer_tracking: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 29/36] kms_plane_multiple: " Petri Latvala
                   ` (11 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_mmap_write_crc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tests/kms_mmap_write_crc.c b/tests/kms_mmap_write_crc.c
index bf2b0c29..73606b16 100644
--- a/tests/kms_mmap_write_crc.c
+++ b/tests/kms_mmap_write_crc.c
@@ -258,18 +258,18 @@ static int opt_handler(int opt, int opt_index, void *data)
 	if (opt == 'n') {
 		ioctl_sync = false;
 		igt_info("set via cmd line to not use sync ioctls\n");
+	} else {
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
 static data_t data;
 
-int main(int argc, char **argv)
+igt_main_args("n", NULL, NULL, opt_handler, NULL)
 {
 	int i;
-	igt_subtest_init_parse_opts(&argc, argv, "n", NULL, NULL,
-				    opt_handler, NULL);
 
 	igt_skip_on_simulation();
 
@@ -299,6 +299,4 @@ int main(int argc, char **argv)
 
 		igt_stop_helper(&hog);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 29/36] kms_plane_multiple: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (26 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 28/36] kms_mmap_write_crc: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 30/36] kms_psr2_su: " Petri Latvala
                   ` (10 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_plane_multiple.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index d2d02a5f..a28b30cc 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -346,8 +346,8 @@ static int opt_handler(int option, int option_index, void *input)
 		opt.iterations = strtol(optarg, NULL, 0);
 
 		if (opt.iterations < LOOP_FOREVER || opt.iterations == 0) {
-			igt_info("incorrect number of iterations\n");
-			igt_assert(false);
+			igt_info("incorrect number of iterations: %d\n", opt.iterations);
+			return IGT_OPT_HANDLER_ERROR;
 		}
 
 		break;
@@ -356,28 +356,26 @@ static int opt_handler(int option, int option_index, void *input)
 		opt.seed = strtol(optarg, NULL, 0);
 		break;
 	default:
-		igt_assert(false);
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
 const char *help_str =
 	"  --iterations Number of iterations for test coverage. -1 loop forever, default 64 iterations\n"
 	"  --seed       Seed for random number generator\n";
 
-int main(int argc, char *argv[])
+struct option long_options[] = {
+	{ "iterations", required_argument, NULL, 'i'},
+	{ "seed",    required_argument, NULL, 's'},
+	{ 0, 0, 0, 0 }
+};
+
+igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
-	struct option long_options[] = {
-		{ "iterations", required_argument, NULL, 'i'},
-		{ "seed",    required_argument, NULL, 's'},
-		{ 0, 0, 0, 0 }
-	};
 	enum pipe pipe;
 
-	igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
-				    opt_handler, NULL);
-
 	igt_skip_on_simulation();
 
 	igt_fixture {
@@ -396,6 +394,4 @@ int main(int argc, char *argv[])
 	igt_fixture {
 		igt_display_fini(&data.display);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 30/36] kms_psr2_su: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (27 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 29/36] kms_plane_multiple: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 31/36] kms_psr: " Petri Latvala
                   ` (9 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_psr2_su.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/kms_psr2_su.c b/tests/kms_psr2_su.c
index b9a57582..a9f675d1 100644
--- a/tests/kms_psr2_su.c
+++ b/tests/kms_psr2_su.c
@@ -228,12 +228,10 @@ static void cleanup(data_t *data)
 	igt_remove_fb(data->drm_fd, &data->fb[0]);
 }
 
-int main(int argc, char *argv[])
+igt_main
 {
 	data_t data = {};
 
-	igt_subtest_init_parse_opts(&argc, argv, "", NULL,
-				    NULL, NULL, NULL);
 	igt_skip_on_simulation();
 
 	igt_fixture {
@@ -287,6 +285,4 @@ int main(int argc, char *argv[])
 		drm_intel_bufmgr_destroy(data.bufmgr);
 		display_fini(&data);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 31/36] kms_psr: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (28 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 30/36] kms_psr2_su: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 32/36] kms_setmode: " Petri Latvala
                   ` (8 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_psr.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/tests/kms_psr.c b/tests/kms_psr.c
index 3e16a6bf..39de0112 100644
--- a/tests/kms_psr.c
+++ b/tests/kms_psr.c
@@ -411,29 +411,28 @@ static int opt_handler(int opt, int opt_index, void *_data)
 		data->with_psr_disabled = true;
 		break;
 	default:
-		igt_assert(0);
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
-int main(int argc, char *argv[])
+const char *help_str =
+	"  --no-psr\tRun test without PSR/PSR2.";
+static struct option long_options[] = {
+	{"no-psr", 0, 0, 'n'},
+	{ 0, 0, 0, 0 }
+};
+data_t data = {};
+
+igt_main_args("", long_options, help_str, opt_handler, &data)
 {
-	const char *help_str =
-	       "  --no-psr\tRun test without PSR/PSR2.";
-	static struct option long_options[] = {
-		{"no-psr", 0, 0, 'n'},
-		{ 0, 0, 0, 0 }
-	};
-	data_t data = {};
 	enum operations op;
 	const char *append_subtest_name[2] = {
 		"",
 		"psr2_"
 	};
 
-	igt_subtest_init_parse_opts(&argc, argv, "", long_options,
-				    help_str, opt_handler, &data);
 	igt_skip_on_simulation();
 
 	igt_fixture {
@@ -533,6 +532,4 @@ int main(int argc, char *argv[])
 		drm_intel_bufmgr_destroy(data.bufmgr);
 		display_fini(&data);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 32/36] kms_setmode: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (29 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 31/36] kms_psr: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 33/36] kms_tv_load_detect: " Petri Latvala
                   ` (7 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_setmode.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index c40c723d..68b89b43 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -821,13 +821,17 @@ static int opt_handler(int opt, int opt_index, void *data)
 		filter_test_id = atoi(optarg);
 		break;
 	default:
-		igt_assert(0);
+		return IGT_OPT_HANDLER_ERROR;
 	}
 
-	return 0;
+	return IGT_OPT_HANDLER_SUCCESS;
 }
 
-int main(int argc, char **argv)
+const char *help_str =
+	"  -d\t\tDon't run any test, only print what would be done. (still needs DRM access)\n"
+	"  -t <test id>\tRun only the test with this id.";
+
+igt_main_args("dt:", NULL, help_str, opt_handler, NULL)
 {
 	const struct {
 		enum test_flags flags;
@@ -845,16 +849,7 @@ int main(int argc, char **argv)
 		{ TEST_INVALID | TEST_CLONE | TEST_SINGLE_CRTC_CLONE | TEST_STEALING,
 					"invalid-clone-single-crtc-stealing" }
 	};
-	const char *help_str =
-	       "  -d\t\tDon't run any test, only print what would be done. (still needs DRM access)\n"
-	       "  -t <test id>\tRun only the test with this id.";
 	int i;
-	int ret;
-
-	ret = igt_subtest_init_parse_opts(&argc, argv, "dt:", NULL, help_str,
-					  opt_handler, NULL);
-	if (ret < 0)
-		return ret == -1 ? 0 : ret;
 
 	igt_skip_on_simulation();
 
@@ -886,6 +881,4 @@ int main(int argc, char **argv)
 
 		close(drm_fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 33/36] kms_tv_load_detect: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (30 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 32/36] kms_setmode: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 34/36] prime_mmap_coherency: " Petri Latvala
                   ` (6 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_tv_load_detect.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/kms_tv_load_detect.c b/tests/kms_tv_load_detect.c
index 012d0629..89f587d5 100644
--- a/tests/kms_tv_load_detect.c
+++ b/tests/kms_tv_load_detect.c
@@ -26,15 +26,13 @@
 
 IGT_TEST_DESCRIPTION("Check tv load detection works correctly.");
 
-int main(int argc, char **argv)
+igt_main
 {
 	/* force the VGA output and test that it worked */
 	int drm_fd = 0;
 	drmModeRes *res;
 	drmModeConnector *tv_connector = NULL, *temp;
 
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
@@ -87,6 +85,4 @@ int main(int argc, char **argv)
 		drmModeFreeConnector(tv_connector);
 		close(drm_fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 34/36] prime_mmap_coherency: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (31 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 33/36] kms_tv_load_detect: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 35/36] testdisplay: " Petri Latvala
                   ` (5 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/prime_mmap_coherency.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/prime_mmap_coherency.c b/tests/prime_mmap_coherency.c
index 04b15ddd..39538767 100644
--- a/tests/prime_mmap_coherency.c
+++ b/tests/prime_mmap_coherency.c
@@ -279,10 +279,8 @@ static void test_ioctl_errors(void)
 	}
 }
 
-int main(int argc, char **argv)
+igt_main
 {
-	igt_subtest_init(argc, argv);
-
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
@@ -321,6 +319,4 @@ int main(int argc, char **argv)
 
 		close(fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 35/36] testdisplay: Nuke custom main function
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (32 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 34/36] prime_mmap_coherency: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 36/36] tests: Remove redundant igt_exit() calls Petri Latvala
                   ` (4 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/testdisplay.c | 230 ++++++++++++++++++++------------------------
 1 file changed, 103 insertions(+), 127 deletions(-)

diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 67d1b68a..b4f0d45f 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -69,10 +69,8 @@
 #include <stdlib.h>
 #include <signal.h>
 
-#define SUBTEST_OPTS	 1
-#define HELP_DESCRIPTION 2
-#define Yb_OPT		 3
-#define Yf_OPT		 4
+#define Yb_OPT		 5
+#define Yf_OPT		 6
 
 static int tio_fd;
 struct termios saved_tio;
@@ -87,6 +85,7 @@ int do_dpms = 0; /* This aliases to DPMS_ON */
 uint32_t depth = 24, stride, bpp;
 int qr_code = 0;
 int specified_mode_num = -1, specified_disp_id = -1;
+bool opt_dump_info = false;
 
 drmModeModeInfo force_timing;
 
@@ -519,29 +518,6 @@ int update_display(bool probe)
 	return 1;
 }
 
-static char optstr[] = "3hiaf:s:d:p:mrto:j:y";
-
-static void __attribute__((noreturn)) usage(char *name, char opt)
-{
-	igt_info("usage: %s [-hiasdpmtf]\n", name);
-	igt_info("\t-i\tdump info\n");
-	igt_info("\t-a\ttest all modes\n");
-	igt_info("\t-s\t<duration>\tsleep between each mode test (default: 0)\n");
-	igt_info("\t-d\t<depth>\tbit depth of scanout buffer\n");
-	igt_info("\t-p\t<planew,h>,<crtcx,y>,<crtcw,h> test overlay plane\n");
-	igt_info("\t-m\ttest the preferred mode\n");
-	igt_info("\t-3\ttest all 3D modes\n");
-	igt_info("\t-t\tuse a tiled framebuffer\n");
-	igt_info("\t-j\tdo dpms off, optional arg to select dpms leve (1-3)\n");
-	igt_info("\t-r\tprint a QR code on the screen whose content is \"pass\" for the automatic test\n");
-	igt_info("\t-o\t<id of the display>,<number of the mode>\tonly test specified mode on the specified display\n");
-	igt_info("\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n");
-	igt_info("\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
-	igt_info("\t\ttest force mode\n");
-	igt_info("\tDefault is to test all modes.\n");
-	exit((opt != 'h') ? -1 : 0);
-}
-
 #define dump_resource(res) if (res) dump_##res()
 
 static void __attribute__((noreturn)) cleanup_and_exit(int ret)
@@ -564,17 +540,12 @@ static gboolean input_event(GIOChannel *source, GIOCondition condition,
 	return TRUE;
 }
 
-static void enter_exec_path(const char **argv)
+static void enter_exec_path(void)
 {
-	char *argv0, *exec_path;
-	int ret;
+	char path[PATH_MAX];
 
-	argv0 = strdup(argv[0]);
-	igt_assert(argv0);
-	exec_path = dirname(argv0);
-	ret = chdir(exec_path);
-	igt_assert_eq(ret, 0);
-	free(argv0);
+	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
+		chdir(dirname(path));
 }
 
 static void restore_termio_mode(int sig)
@@ -600,101 +571,108 @@ static void set_termio_mode(void)
 	tcsetattr(tio_fd, TCSANOW, &tio);
 }
 
-int main(int argc, char **argv)
+static char optstr[] = "3iaf:s:d:p:mrto:j:y";
+static struct option long_opts[] = {
+	{"yb", 0, 0, Yb_OPT},
+	{"yf", 0, 0, Yf_OPT},
+	{ 0, 0, 0, 0 }
+};
+
+static const char *help_str =
+	"  -i\tdump info\n"
+	"  -a\ttest all modes\n"
+	"  -s\t<duration>\tsleep between each mode test (default: 0)\n"
+	"  -d\t<depth>\tbit depth of scanout buffer\n"
+	"  -p\t<planew,h>,<crtcx,y>,<crtcw,h> test overlay plane\n"
+	"  -m\ttest the preferred mode\n"
+	"  -3\ttest all 3D modes\n"
+	"  -t\tuse an X-tiled framebuffer\n"
+	"  -y, --yb\n"
+	"  \tuse a Y-tiled framebuffer\n"
+	"  --yf\tuse a Yf-tiled framebuffer\n"
+	"  -j\tdo dpms off, optional arg to select dpms level (1-3)\n"
+	"  -r\tprint a QR code on the screen whose content is \"pass\" for the automatic test\n"
+	"  -o\t<id of the display>,<number of the mode>\tonly test specified mode on the specified display\n"
+	"  -f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n"
+	"  \t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n"
+	"  \ttest force mode\n"
+	"  \tDefault is to test all modes.\n"
+	;
+
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	float force_clock;
+
+	switch (opt) {
+	case '3':
+		test_stereo_modes = 1;
+		break;
+	case 'i':
+		opt_dump_info = true;
+		break;
+	case 'a':
+		test_all_modes = 1;
+		break;
+	case 'f':
+		force_mode = 1;
+		if (sscanf(optarg,"%f,%hu,%hu,%hu,%hu,%hu,%hu,%hu,%hu",
+			   &force_clock,&force_timing.hdisplay, &force_timing.hsync_start,&force_timing.hsync_end,&force_timing.htotal,
+			   &force_timing.vdisplay, &force_timing.vsync_start, &force_timing.vsync_end, &force_timing.vtotal)!= 9)
+			return IGT_OPT_HANDLER_ERROR;
+		force_timing.clock = force_clock*1000;
+
+		break;
+	case 's':
+		sleep_between_modes = atoi(optarg);
+		break;
+	case 'j':
+		do_dpms = atoi(optarg);
+		if (do_dpms == 0)
+			do_dpms = DRM_MODE_DPMS_OFF;
+		break;
+	case 'd':
+		depth = atoi(optarg);
+		igt_info("using depth %d\n", depth);
+		break;
+	case 'p':
+		if (sscanf(optarg, "%d,%d,%d,%d,%d,%d", &plane_width,
+			   &plane_height, &crtc_x, &crtc_y,
+			   &crtc_w, &crtc_h) != 6)
+			return IGT_OPT_HANDLER_ERROR;
+		test_plane = 1;
+		break;
+	case 'm':
+		test_preferred_mode = 1;
+		break;
+	case 't':
+		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
+		break;
+	case 'y':
+	case Yb_OPT:
+		tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
+		break;
+	case Yf_OPT:
+		tiling = LOCAL_I915_FORMAT_MOD_Yf_TILED;
+		break;
+	case 'r':
+		qr_code = 1;
+		break;
+	case 'o':
+		sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num);
+		break;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+igt_simple_main_args(optstr, long_opts, help_str, opt_handler, NULL)
 {
-	int c;
 	int ret = 0;
 	GIOChannel *stdinchannel;
 	GMainLoop *mainloop;
-	float force_clock;
-	bool opt_dump_info = false;
-	struct option long_opts[] = {
-		{"list-subtests", 0, 0, SUBTEST_OPTS},
-		{"run-subtest", 1, 0, SUBTEST_OPTS},
-		{"help-description", 0, 0, HELP_DESCRIPTION},
-		{"help", 0, 0, 'h'},
-		{"yb", 0, 0, Yb_OPT},
-		{"yf", 0, 0, Yf_OPT},
-		{ 0, 0, 0, 0 }
-	};
-
 	igt_skip_on_simulation();
 
-	enter_exec_path((const char **) argv);
-
-	while ((c = getopt_long(argc, argv, optstr, long_opts, NULL)) != -1) {
-		switch (c) {
-		case '3':
-			test_stereo_modes = 1;
-			break;
-		case 'i':
-			opt_dump_info = true;
-			break;
-		case 'a':
-			test_all_modes = 1;
-			break;
-		case 'f':
-			force_mode = 1;
-			if(sscanf(optarg,"%f,%hu,%hu,%hu,%hu,%hu,%hu,%hu,%hu",
-				&force_clock,&force_timing.hdisplay, &force_timing.hsync_start,&force_timing.hsync_end,&force_timing.htotal,
-				&force_timing.vdisplay, &force_timing.vsync_start, &force_timing.vsync_end, &force_timing.vtotal)!= 9)
-				usage(argv[0], c);
-			force_timing.clock = force_clock*1000;
-
-			break;
-		case 's':
-			sleep_between_modes = atoi(optarg);
-			break;
-		case 'j':
-			do_dpms = atoi(optarg);
-			if (do_dpms == 0)
-				do_dpms = DRM_MODE_DPMS_OFF;
-			break;
-		case 'd':
-			depth = atoi(optarg);
-			igt_info("using depth %d\n", depth);
-			break;
-		case 'p':
-			if (sscanf(optarg, "%d,%d,%d,%d,%d,%d", &plane_width,
-				   &plane_height, &crtc_x, &crtc_y,
-				   &crtc_w, &crtc_h) != 6)
-				usage(argv[0], c);
-			test_plane = 1;
-			break;
-		case 'm':
-			test_preferred_mode = 1;
-			break;
-		case 't':
-			tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
-			break;
-		case 'y':
-		case Yb_OPT:
-			tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
-			break;
-		case Yf_OPT:
-			tiling = LOCAL_I915_FORMAT_MOD_Yf_TILED;
-			break;
-		case 'r':
-			qr_code = 1;
-			break;
-		case 'o':
-			sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num);
-			break;
-		case SUBTEST_OPTS:
-			/* invalid subtest options */
-			exit(IGT_EXIT_INVALID);
-			break;
-		case HELP_DESCRIPTION:
-			igt_info("Tests display functionality.");
-			exit(0);
-			break;
-		default:
-			/* fall through */
-		case 'h':
-			usage(argv[0], c);
-			break;
-		}
-	}
+	enter_exec_path();
 
 	set_termio_mode();
 
@@ -771,6 +749,4 @@ out_close:
 	close(drm_fd);
 
 	igt_assert_eq(ret, 0);
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] [PATCH i-g-t 36/36] tests: Remove redundant igt_exit() calls
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (33 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 35/36] testdisplay: " Petri Latvala
@ 2019-05-23 12:27 ` Petri Latvala
  2019-05-23 14:29 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args Patchwork
                   ` (3 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Petri Latvala @ 2019-05-23 12:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/kms_dp_dsc.c       | 1 -
 tests/kms_plane_lowres.c | 2 --
 tests/prime_mmap_kms.c   | 2 --
 3 files changed, 5 deletions(-)

diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
index 1bfefbf2..e2e3aaa0 100644
--- a/tests/kms_dp_dsc.c
+++ b/tests/kms_dp_dsc.c
@@ -311,5 +311,4 @@ igt_main
 		close(data.drm_fd);
 		igt_display_fini(&data.display);
 	}
-	igt_exit();
 }
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index 0b78573f..68b85025 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -262,6 +262,4 @@ igt_main
 	igt_fixture {
 		igt_display_fini(&data.display);
 	}
-
-	igt_exit();
 }
diff --git a/tests/prime_mmap_kms.c b/tests/prime_mmap_kms.c
index fdc37214..1c963e01 100644
--- a/tests/prime_mmap_kms.c
+++ b/tests/prime_mmap_kms.c
@@ -258,6 +258,4 @@ igt_main
 		igt_display_fini(&gpu.display);
 		close(gpu.drm_fd);
 	}
-
-	igt_exit();
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (34 preceding siblings ...)
  2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 36/36] tests: Remove redundant igt_exit() calls Petri Latvala
@ 2019-05-23 14:29 ` Patchwork
  2019-05-24 13:50 ` [igt-dev] [PATCH i-g-t 01/36] " Arkadiusz Hiler
                   ` (2 subsequent siblings)
  38 siblings, 0 replies; 41+ messages in thread
From: Patchwork @ 2019-05-23 14:29 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args
URL   : https://patchwork.freedesktop.org/series/61037/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6131 -> IGTPW_3047
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/61037/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_3047 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@module-reload:
    - fi-skl-6770hq:      [PASS][1] -> [FAIL][2] ([fdo#108511])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live_hangcheck:
    - fi-apl-guc:         [PASS][3] -> [DMESG-FAIL][4] ([fdo#110620])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-apl-guc/igt@i915_selftest@live_hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-apl-guc/igt@i915_selftest@live_hangcheck.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [PASS][5] -> [FAIL][6] ([fdo#109485])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Possible fixes ####

  * igt@gem_exec_fence@basic-wait-default:
    - {fi-icl-u3}:        [DMESG-WARN][7] ([fdo#107724]) -> [PASS][8] +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-icl-u3/igt@gem_exec_fence@basic-wait-default.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-icl-u3/igt@gem_exec_fence@basic-wait-default.html

  * igt@i915_selftest@live_execlists:
    - fi-apl-guc:         [INCOMPLETE][9] ([fdo#103927] / [fdo#109720]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-apl-guc/igt@i915_selftest@live_execlists.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-apl-guc/igt@i915_selftest@live_execlists.html

  
#### Warnings ####

  * igt@i915_pm_rpm@basic-rte:
    - fi-pnv-d510:        [SKIP][11] ([fdo#109271]) -> [INCOMPLETE][12] ([fdo#110740])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-pnv-d510/igt@i915_pm_rpm@basic-rte.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-pnv-d510/igt@i915_pm_rpm@basic-rte.html

  * igt@runner@aborted:
    - fi-apl-guc:         [FAIL][13] ([fdo#108622] / [fdo#109720]) -> [FAIL][14] ([fdo#110622])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/fi-apl-guc/igt@runner@aborted.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/fi-apl-guc/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
  [fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
  [fdo#110620]: https://bugs.freedesktop.org/show_bug.cgi?id=110620
  [fdo#110622]: https://bugs.freedesktop.org/show_bug.cgi?id=110622
  [fdo#110740]: https://bugs.freedesktop.org/show_bug.cgi?id=110740


Participating hosts (53 -> 46)
------------------------------

  Missing    (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * IGT: IGT_5010 -> IGTPW_3047

  CI_DRM_6131: bbf52691a94cc57dc9191e36dcca0361a72b178b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3047: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/
  IGT_5010: 631f3ac2e78c8d6332afc693bf290ae23d8d5685 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (35 preceding siblings ...)
  2019-05-23 14:29 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args Patchwork
@ 2019-05-24 13:50 ` Arkadiusz Hiler
  2019-05-24 18:14   ` Daniel Vetter
  2019-05-24 18:26 ` Hiatt, Don
  2019-05-24 19:38 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,01/36] " Patchwork
  38 siblings, 1 reply; 41+ messages in thread
From: Arkadiusz Hiler @ 2019-05-24 13:50 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Thu, May 23, 2019 at 03:26:52PM +0300, Petri Latvala wrote:
> Instead of using a custom main function and calling
> igt_subtest_init_parse_opts / igt_simple_init_parse_opts, the _args
> variants of igt_main and igt_simple_main take the relevant parameters
> and pass them along to the correct init function.
> 
> Open-coding a custom main function is no longer necessary and not
> recommended.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>

For the whole series:

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

If you get bored again you can reformat all the long_options[] in a
consistelnt manner :->

-- 
Cheers,
Arek
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args
  2019-05-24 13:50 ` [igt-dev] [PATCH i-g-t 01/36] " Arkadiusz Hiler
@ 2019-05-24 18:14   ` Daniel Vetter
  0 siblings, 0 replies; 41+ messages in thread
From: Daniel Vetter @ 2019-05-24 18:14 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev, Petri Latvala

On Fri, May 24, 2019 at 04:50:52PM +0300, Arkadiusz Hiler wrote:
> On Thu, May 23, 2019 at 03:26:52PM +0300, Petri Latvala wrote:
> > Instead of using a custom main function and calling
> > igt_subtest_init_parse_opts / igt_simple_init_parse_opts, the _args
> > variants of igt_main and igt_simple_main take the relevant parameters
> > and pass them along to the correct init function.
> > 
> > Open-coding a custom main function is no longer necessary and not
> > recommended.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> 
> For the whole series:
> 
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> 
> If you get bored again you can reformat all the long_options[] in a
> consistelnt manner :->

This is really awesome stuff, I like!
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (36 preceding siblings ...)
  2019-05-24 13:50 ` [igt-dev] [PATCH i-g-t 01/36] " Arkadiusz Hiler
@ 2019-05-24 18:26 ` Hiatt, Don
  2019-05-24 19:38 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,01/36] " Patchwork
  38 siblings, 0 replies; 41+ messages in thread
From: Hiatt, Don @ 2019-05-24 18:26 UTC (permalink / raw)
  To: Latvala, Petri, igt-dev; +Cc: Latvala, Petri

From: igt-dev [mailto:igt-dev-bounces@lists.freedesktop.org] On Behalf Of Petri Latvala
Sent: Thursday, May 23, 2019 5:27 AM
To: igt-dev@lists.freedesktop.org
Cc: Latvala, Petri <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args

Instead of using a custom main function and calling igt_subtest_init_parse_opts / igt_simple_init_parse_opts, the _args variants of igt_main and igt_simple_main take the relevant parameters and pass them along to the correct init function.

Open-coding a custom main function is no longer necessary and not recommended.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.h | 64 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 48 insertions(+), 16 deletions(-)

diff --git a/lib/igt_core.h b/lib/igt_core.h index 44634e0f..cd89921e 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -250,23 +250,38 @@ void __igt_subtest_group_restore(int);
 			       __igt_subtest_group_restore(igt_tokencat(__save,__LINE__) ))
 
 /**
- * igt_main:
- *
- * This is a magic control flow block used instead of a main() function for
- * tests with subtests. Open-coding the main() function is only recommended if
- * the test needs to parse additional command line arguments of its own.
- */
-#define igt_main \
+ * igt_main_args:
+ * @extra_short_opts: getopt_long() compliant list with additional 
+short options
+ * @extra_long_opts: getopt_long() compliant list with additional long 
+options
+ * @help_str: help string for the additional options
+ * @extra_opt_handler: handler for the additional options
+ * @handler_data: user data given to @extra_opt_handler when invoked
+ *
+ * This is a magic control flow block used instead of a main()
+ * function for tests with subtests, along with custom command line
+ * arguments. The macro parameters are passed directly to
+ * #igt_subtest_init_parse_opts.
+ */
+#define igt_main_args(short_opts, long_opts, help_str, opt_handler, 
+handler_data) \
 	static void igt_tokencat(__real_main, __LINE__)(void); \
 	int main(int argc, char **argv) { \
-		igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, \
-					    NULL, NULL); \
+		igt_subtest_init_parse_opts(&argc, argv, \
+					    short_opts, long_opts, help_str, \
+					    opt_handler, handler_data); \
 		igt_tokencat(__real_main, __LINE__)(); \
 		igt_exit(); \
 	} \
 	static void igt_tokencat(__real_main, __LINE__)(void) \
 
 
+/**
+ * igt_main:
+ *
+ * This is a magic control flow block used instead of a main() function 
+for
+ * tests with subtests. Open-coding the main() function is not recommended.
+ */
+#define igt_main igt_main_args(NULL, NULL, NULL, NULL, NULL)
+
 const char *igt_test_name(void);
 void igt_simple_init_parse_opts(int *argc, char **argv,
 				const char *extra_short_opts,
@@ -289,23 +304,40 @@ void igt_simple_init_parse_opts(int *argc, char **argv,  #define igt_simple_init(argc, argv) \
 	igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL, NULL);
 
+
 /**
- * igt_simple_main:
+ * igt_simple_main_args:
+ * @extra_short_opts: getopt_long() compliant list with additional 
+ short options
+ * @extra_long_opts: getopt_long() compliant list with additional long 
+ options
+ * @help_str: help string for the additional options
+ * @extra_opt_handler: handler for the additional options
+ * @handler_data: user data given to @extra_opt_handler when invoked
  *
- * This is a magic control flow block used instead of a main() function for
- * simple tests. Open-coding the main() function is only recommended if
- * the test needs to parse additional command line arguments of its own.
+ * This is a magic control flow block used instead of a main()
+ * function for simple tests with custom command line arguments. The
+ * macro parameters are passed directly to
+ * #igt_simple_init_parse_opts.
  */
-#define igt_simple_main \
+#define igt_simple_main_args(short_opts, long_opts, help_str, 
+opt_handler, handler_data) \
 	static void igt_tokencat(__real_main, __LINE__)(void); \
 	int main(int argc, char **argv) { \
-		igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, \
-					   NULL, NULL); \
+		igt_simple_init_parse_opts(&argc, argv, \
+					   short_opts, long_opts, help_str, \
+					   opt_handler, handler_data);	\
 		igt_tokencat(__real_main, __LINE__)(); \
 		igt_exit(); \
 	} \
 	static void igt_tokencat(__real_main, __LINE__)(void) \
 
+
+/**
+ * igt_simple_main:
+ *
+ * This is a magic control flow block used instead of a main() function 
+for
+ * simple tests. Open-coding the main() function is not recommended.
+ */
+#define igt_simple_main igt_simple_main_args(NULL, NULL, NULL, NULL, 
+NULL)
+
 /**
  * igt_constructor:
  *
--
2.19.1

This is really awesome! I was just looking at how to add some custom arguments to a gem_exec_parallel to aid in my debugging 
and was thinking something like this would be super useful. Thank you!

Reviewed-by: Don Hiatt <don.hiatt@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args
  2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
                   ` (37 preceding siblings ...)
  2019-05-24 18:26 ` Hiatt, Don
@ 2019-05-24 19:38 ` Patchwork
  38 siblings, 0 replies; 41+ messages in thread
From: Patchwork @ 2019-05-24 19:38 UTC (permalink / raw)
  To: Hiatt, Don; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args
URL   : https://patchwork.freedesktop.org/series/61037/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6131_full -> IGTPW_3047_full
====================================================

Summary
-------

  **WARNING**

  Minor unknown changes coming with IGTPW_3047_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3047_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/61037/revisions/1/mbox/

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_3047_full:

### IGT changes ###

#### Warnings ####

  * igt@prime_vgem@sync-bsd1:
    - shard-snb:          [INCOMPLETE][1] ([fdo#105411]) -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-snb1/igt@prime_vgem@sync-bsd1.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-snb4/igt@prime_vgem@sync-bsd1.html

  
Known issues
------------

  Here are the changes found in IGTPW_3047_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_mmap_gtt@hang:
    - shard-iclb:         [PASS][3] -> [FAIL][4] ([fdo#109677])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb8/igt@gem_mmap_gtt@hang.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb4/igt@gem_mmap_gtt@hang.html

  * igt@i915_pm_rps@min-max-config-loaded:
    - shard-iclb:         [PASS][5] -> [FAIL][6] ([fdo#108059])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb8/igt@i915_pm_rps@min-max-config-loaded.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb6/igt@i915_pm_rps@min-max-config-loaded.html

  * igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
    - shard-iclb:         [PASS][7] -> [INCOMPLETE][8] ([fdo#107713]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb2/igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb5/igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions.html

  * igt@kms_flip@flip-vs-modeset-vs-hang:
    - shard-hsw:          [PASS][9] -> [INCOMPLETE][10] ([fdo#103540])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-hsw5/igt@kms_flip@flip-vs-modeset-vs-hang.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-hsw7/igt@kms_flip@flip-vs-modeset-vs-hang.html

  * igt@kms_flip@flip-vs-suspend:
    - shard-apl:          [PASS][11] -> [DMESG-WARN][12] ([fdo#108566]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-apl8/igt@kms_flip@flip-vs-suspend.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-apl5/igt@kms_flip@flip-vs-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt:
    - shard-iclb:         [PASS][13] -> [FAIL][14] ([fdo#103167]) +6 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         [PASS][15] -> [FAIL][16] ([fdo#103166])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb1/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         [PASS][17] -> [SKIP][18] ([fdo#109642])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb2/igt@kms_psr2_su@page_flip.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb3/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [PASS][19] -> [SKIP][20] ([fdo#109441])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb1/igt@kms_psr@psr2_sprite_mmap_gtt.html

  * igt@kms_setmode@basic:
    - shard-hsw:          [PASS][21] -> [FAIL][22] ([fdo#99912])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-hsw5/igt@kms_setmode@basic.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-hsw1/igt@kms_setmode@basic.html

  
#### Possible fixes ####

  * igt@gem_tiled_swapping@non-threaded:
    - shard-iclb:         [FAIL][23] ([fdo#108686]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb6/igt@gem_tiled_swapping@non-threaded.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb5/igt@gem_tiled_swapping@non-threaded.html

  * igt@gem_workarounds@suspend-resume:
    - shard-apl:          [DMESG-WARN][25] ([fdo#108566]) -> [PASS][26] +6 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-apl7/igt@gem_workarounds@suspend-resume.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-apl4/igt@gem_workarounds@suspend-resume.html

  * igt@kms_flip@2x-plain-flip-interruptible:
    - shard-hsw:          [SKIP][27] ([fdo#109271]) -> [PASS][28] +26 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-hsw5/igt@kms_flip@2x-plain-flip-interruptible.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-hsw6/igt@kms_flip@2x-plain-flip-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-badstride:
    - shard-iclb:         [FAIL][29] ([fdo#103167]) -> [PASS][30] +4 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-badstride.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb3/igt@kms_frontbuffer_tracking@fbc-badstride.html

  * igt@kms_psr@psr2_cursor_render:
    - shard-iclb:         [SKIP][31] ([fdo#109441]) -> [PASS][32] +1 similar issue
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb3/igt@kms_psr@psr2_cursor_render.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb2/igt@kms_psr@psr2_cursor_render.html

  * igt@kms_setmode@basic:
    - shard-apl:          [FAIL][33] ([fdo#99912]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-apl7/igt@kms_setmode@basic.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-apl4/igt@kms_setmode@basic.html

  * igt@kms_sysfs_edid_timing:
    - shard-hsw:          [FAIL][35] ([fdo#100047]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-hsw5/igt@kms_sysfs_edid_timing.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-hsw7/igt@kms_sysfs_edid_timing.html

  * igt@perf_pmu@rc6-runtime-pm:
    - shard-hsw:          [FAIL][37] ([fdo#105010]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-hsw4/igt@perf_pmu@rc6-runtime-pm.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-hsw5/igt@perf_pmu@rc6-runtime-pm.html

  
#### Warnings ####

  * igt@gem_mmap_gtt@forked-big-copy-odd:
    - shard-iclb:         [TIMEOUT][39] ([fdo#109673]) -> [INCOMPLETE][40] ([fdo#107713] / [fdo#109100]) +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-iclb4/igt@gem_mmap_gtt@forked-big-copy-odd.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-iclb2/igt@gem_mmap_gtt@forked-big-copy-odd.html

  * igt@prime_vgem@busy-bsd1:
    - shard-snb:          [FAIL][41] -> [INCOMPLETE][42] ([fdo#105411])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6131/shard-snb6/igt@prime_vgem@busy-bsd1.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/shard-snb2/igt@prime_vgem@busy-bsd1.html

  
  [fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108059]: https://bugs.freedesktop.org/show_bug.cgi?id=108059
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#109673]: https://bugs.freedesktop.org/show_bug.cgi?id=109673
  [fdo#109677]: https://bugs.freedesktop.org/show_bug.cgi?id=109677
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 6)
------------------------------

  Missing    (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005 


Build changes
-------------

  * IGT: IGT_5010 -> IGTPW_3047
  * Piglit: piglit_4509 -> None

  CI_DRM_6131: bbf52691a94cc57dc9191e36dcca0361a72b178b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3047: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/
  IGT_5010: 631f3ac2e78c8d6332afc693bf290ae23d8d5685 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3047/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2019-05-24 19:38 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 12:26 [igt-dev] [PATCH i-g-t 01/36] lib: Introduce main function macros with custom args Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 02/36] lib: Document igt_opt_handler_t semantics Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 03/36] i915/gem_exec_blt: Nuke custom main function Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 04/36] i915/gem_gtt_speed: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 05/36] i915/gem_hang: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 06/36] i915/gem_linear_blits: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 07/36] i915/gem_ppgtt: " Petri Latvala
2019-05-23 12:26 ` [igt-dev] [PATCH i-g-t 08/36] i915/gem_pread: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 09/36] i915/gem_pwrite: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 10/36] i915/gem_pwrite_pread: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 11/36] i915/gem_render_copy: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 12/36] i915/gem_render_copy_redux: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 13/36] i915/gem_request_retire: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 14/36] i915/gem_stress: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 15/36] i915/gem_tiled_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 16/36] i915/gem_userptr_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 17/36] i915/gen3_mixed_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 18/36] i915/gen3_render_linear_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 19/36] i915/gen3_render_mixed_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 20/36] i915/gen3_render_tiledx_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 21/36] i915/gen3_render_tiledy_blits: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 22/36] i915/i915_pm_rpm: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 23/36] kms_concurrent: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 24/36] kms_cursor_edge_walk: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 25/36] kms_flip: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 26/36] kms_force_connector_basic: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 27/36] kms_frontbuffer_tracking: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 28/36] kms_mmap_write_crc: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 29/36] kms_plane_multiple: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 30/36] kms_psr2_su: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 31/36] kms_psr: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 32/36] kms_setmode: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 33/36] kms_tv_load_detect: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 34/36] prime_mmap_coherency: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 35/36] testdisplay: " Petri Latvala
2019-05-23 12:27 ` [igt-dev] [PATCH i-g-t 36/36] tests: Remove redundant igt_exit() calls Petri Latvala
2019-05-23 14:29 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/36] lib: Introduce main function macros with custom args Patchwork
2019-05-24 13:50 ` [igt-dev] [PATCH i-g-t 01/36] " Arkadiusz Hiler
2019-05-24 18:14   ` Daniel Vetter
2019-05-24 18:26 ` Hiatt, Don
2019-05-24 19:38 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,01/36] " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.