diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2020-05-04 10:37:05 +0300 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2020-05-05 09:46:39 +0300 |
commit | 1175d802189072457764642d4dc0111d0603d0cf (patch) | |
tree | 46b23f238d9cca083d4f759c5e9ffccd08a852df /lib/igt_core.c | |
parent | d9b69b3e0f0e48e55a3a0b5af36fc11e92f75f30 (diff) |
lib: Support multiple filters
This patch brings back support for multiple filters that was in the
original series by Zbyszek.
We can now take multiple, semicolon separated filters. Right now the
tests are using only the first filter.
v2: drop unnecessary check before for-loop (Petri)
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Zbigniew KempczyĆski <zbigniew.kempczynski@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 3f7b9f68..bb8d0177 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -249,7 +249,7 @@ * FrameDumpPath=/tmp # The path to dump frames that fail comparison checks * * # Device selection filter - * Device=pci:vendor=8086,card=0;vgem: + * Device=pci:vendor=8086,card=0;sys:/sys/devices/platform/vgem * * # The following section is used for configuring the Device Under Test. * # It is not mandatory and allows overriding default values. @@ -685,7 +685,7 @@ static void print_usage(const char *help_str, bool output_on_stderr) " --skip-crc-compare\n" " --help-description\n" " --describe\n" - " --device filter\n" + " --device filters\n" " --version\n" " --help|-h\n"); if (help_str) @@ -778,7 +778,7 @@ static void common_init_config(void) igt_set_autoresume_delay(ret); /* Adding filters, order .igtrc, IGT_DEVICE, --device filter */ - if (igt_device_is_filter_set()) + if (igt_device_filter_count() > 0) igt_debug("Notice: using --device filters:\n"); else { if (igt_rc_device) { @@ -793,14 +793,14 @@ static void common_init_config(void) "Common::Device:\n"); } if (igt_rc_device) { - igt_device_filter_set(igt_rc_device); + igt_device_filter_add(igt_rc_device); free(igt_rc_device); igt_rc_device = NULL; } } - if (igt_device_is_filter_set()) - igt_debug("[%s]\n", igt_device_filter_get()); + for (int i = 0; i < igt_device_filter_count(); i++) + igt_debug("[%s]\n", igt_device_filter_get(i)); } static void common_init_env(void) @@ -999,7 +999,7 @@ static int common_init(int *argc, char **argv, free(igt_rc_device); igt_rc_device = NULL; } - igt_device_filter_set(optarg); + igt_device_filter_add(optarg); break; case OPT_VERSION: print_version(); |