mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 21:02:59 +00:00
tests: convert simple tests to use igt_simple_init_parse_opts
Convert simple tests to use igt_simple_init_parse_opts if they require extra options. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
+6
-14
@@ -39,7 +39,6 @@
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <getopt.h>
|
||||
#include "drm.h"
|
||||
#include "ioctl_wrappers.h"
|
||||
#include "drmtest.h"
|
||||
@@ -119,11 +118,9 @@ static void *work(void *arg)
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static void parse(int argc, char *argv[])
|
||||
static int opt_handler(int opt, int opt_index)
|
||||
{
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "i:c:n:muh?")) != -1) {
|
||||
switch (opt) {
|
||||
switch (opt) {
|
||||
case 'i':
|
||||
iter = atoi(optarg);
|
||||
break;
|
||||
@@ -136,20 +133,17 @@ static void parse(int argc, char *argv[])
|
||||
case 'u':
|
||||
uncontexted = 1;
|
||||
break;
|
||||
case 'h':
|
||||
case '?':
|
||||
default:
|
||||
igt_success();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
igt_simple_init(argc, argv);
|
||||
igt_simple_init_parse_opts(argc, argv, "i:c:n:mu", NULL, NULL,
|
||||
opt_handler);
|
||||
|
||||
fd = drm_open_any_render();
|
||||
devid = intel_get_drm_devid(fd);
|
||||
@@ -159,8 +153,6 @@ int main(int argc, char *argv[])
|
||||
iter = 4;
|
||||
}
|
||||
|
||||
parse(argc, argv);
|
||||
|
||||
threads = calloc(num_contexts, sizeof(*threads));
|
||||
|
||||
for (i = 0; i < num_contexts; i++)
|
||||
|
||||
Reference in New Issue
Block a user