mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-22 13:52:54 +00:00
lib: Add a user data pointer to the argument parsing functions
It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
@@ -120,7 +120,7 @@ static void *work(void *arg)
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static int opt_handler(int opt, int opt_index)
|
||||
static int opt_handler(int opt, int opt_index, void *data)
|
||||
{
|
||||
switch (opt) {
|
||||
case 'i':
|
||||
@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
|
||||
int i;
|
||||
|
||||
igt_simple_init_parse_opts(&argc, argv, "i:c:n:mu", NULL, NULL,
|
||||
opt_handler);
|
||||
opt_handler, NULL);
|
||||
|
||||
fd = drm_open_any_render();
|
||||
devid = intel_get_drm_devid(fd);
|
||||
|
||||
Reference in New Issue
Block a user