mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 05:13:47 +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 @@ scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
|
||||
color, val, x, y);
|
||||
}
|
||||
|
||||
static int opt_handler(int opt, int opt_index)
|
||||
static int opt_handler(int opt, int opt_index, void *data)
|
||||
{
|
||||
if (opt == 'd') {
|
||||
opt_dump_png = true;
|
||||
@@ -141,7 +141,8 @@ int main(int argc, char **argv)
|
||||
igt_render_copyfunc_t render_copy = NULL;
|
||||
int opt_dump_aub = igt_aub_dump_enabled();
|
||||
|
||||
igt_simple_init_parse_opts(&argc, argv, "da", NULL, NULL, opt_handler);
|
||||
igt_simple_init_parse_opts(&argc, argv, "da", NULL, NULL,
|
||||
opt_handler, NULL);
|
||||
|
||||
igt_fixture {
|
||||
data.drm_fd = drm_open_any_render();
|
||||
|
||||
Reference in New Issue
Block a user