All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters
@ 2020-05-04  7:37 Arkadiusz Hiler
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another Arkadiusz Hiler
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Arkadiusz Hiler @ 2020-05-04  7:37 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

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>
---
 lib/drmtest.c          |  8 ++--
 lib/igt_core.c         | 14 +++----
 lib/igt_device_scan.c  | 87 +++++++++++++++++++++++++++++++-----------
 lib/igt_device_scan.h  |  8 ++--
 tests/core_hotunplug.c |  3 +-
 5 files changed, 81 insertions(+), 39 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 1fc39925..7b2fd337 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -324,8 +324,8 @@ static bool __get_the_first_card(struct igt_device_card *card)
 {
 	const char *filter;
 
-	if (igt_device_is_filter_set()) {
-		filter = igt_device_filter_get();
+	if (igt_device_filter_count() > 0) {
+		filter = igt_device_filter_get(0);
 		igt_info("Looking for devices to open using filter: %s\n", filter);
 
 		if (igt_device_card_match(filter, card)) {
@@ -354,7 +354,7 @@ static bool __get_the_first_card(struct igt_device_card *card)
  */
 int __drm_open_driver(int chipset)
 {
-	if (igt_device_is_filter_set()) {
+	if (igt_device_filter_count() > 0) {
 		bool found;
 		struct igt_device_card card;
 
@@ -371,7 +371,7 @@ int __drm_open_driver(int chipset)
 
 int __drm_open_driver_render(int chipset)
 {
-	if (igt_device_is_filter_set()) {
+	if (igt_device_filter_count() > 0) {
 		bool found;
 		struct igt_device_card card;
 
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
  *
  *	&num; Device selection filter
- *	Device=pci:vendor=8086,card=0;vgem:
+ *	Device=pci:vendor=8086,card=0;sys:/sys/devices/platform/vgem
  *
  *	&num; The following section is used for configuring the Device Under Test.
  *	&num; 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();
diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
index 30a9704a..601d6fb0 100644
--- a/lib/igt_device_scan.c
+++ b/lib/igt_device_scan.c
@@ -1014,16 +1014,21 @@ void igt_device_print_filter_types(void)
 	}
 }
 
-static char *device_filter;
+struct device_filter {
+	char filter[NAME_MAX];
+	struct igt_list_head link;
+};
+
+static IGT_LIST_HEAD(device_filters);
 
 /**
- * igt_device_is_filter_set
+ * igt_device_filter_count
  *
- * Returns whether we have a filter set.
+ * Returns number of filters collected in the filter list.
  */
-bool igt_device_is_filter_set(void)
+int igt_device_filter_count(void)
 {
-	return device_filter != NULL;
+	return igt_list_length(&device_filters);
 }
 
 /* Check does filter is valid. It checks:
@@ -1054,43 +1059,79 @@ static bool is_filter_valid(const char *fstr)
 }
 
 /**
- * igt_device_filter_set
- * @filter: filter that should be set globally
+ * igt_device_filter_add
+ * @filters: filter(s) to be stored in filter array
+ *
+ * Function allows passing single or more filters within one string. This is
+ * for CI when it can extract filter from environment variable (and it must
+ * be single string). So if @filter contains semicolon ';' it treats
+ * each part as separate filter and adds to the filter array.
+ *
+ * Returns number of filters added to filter array. Can be greater than
+ * 1 if @filters contains more than one filter separated by semicolon.
  */
-void igt_device_filter_set(const char *filter)
+int igt_device_filter_add(const char *filters)
 {
-	if (!is_filter_valid(filter)) {
-		igt_warn("Invalid filter: %s\n", filter);
-		return;
+	char *dup, *dup_orig, *filter;
+	int count = 0;
+
+	dup = strdup(filters);
+	dup_orig = dup;
+
+	while ((filter = strsep(&dup, ";"))) {
+		bool is_valid = is_filter_valid(filter);
+		igt_warn_on(!is_valid);
+		if (is_valid) {
+			struct device_filter *df = malloc(sizeof(*df));
+			strncpy(df->filter, filter, sizeof(df->filter)-1);
+			igt_list_add_tail(&df->link, &device_filters);
+			count++;
+		}
 	}
 
-	if (device_filter != NULL)
-		free(device_filter);
+	free(dup_orig);
 
-	device_filter = strdup(filter);
+	return count;
 }
 
 /**
- * igt_device_filter_free
+ * igt_device_filter_free_all
  *
- * Free the filter that we store internally, effectively unsetting it.
+ * Free all filters within array.
  */
-void igt_device_filter_free(void)
+void igt_device_filter_free_all(void)
 {
-	if (device_filter != NULL)
-		free(device_filter);
+	struct device_filter *filter, *tmp;
 
-	device_filter = NULL;
+	igt_list_for_each_entry_safe(filter, tmp, &device_filters, link) {
+		igt_list_del(&filter->link);
+		free(filter);
+	}
 }
 
 /**
  * igt_device_filter_get
+ * @num: Number of filter from filter array
  *
- * Returns filter string or NULL if not set
+ * Returns filter string or NULL if @num is out of range of filter array.
  */
-const char *igt_device_filter_get(void)
+const char *igt_device_filter_get(int num)
 {
-	return device_filter;
+	struct device_filter *filter;
+	int i = 0;
+
+	if (num < 0)
+		return NULL;
+
+
+	igt_list_for_each_entry(filter, &device_filters, link) {
+		if (i == num)
+			return filter->filter;
+		i++;
+	}
+
+
+	return NULL;
 }
 
 static bool igt_device_filter_apply(const char *fstr)
diff --git a/lib/igt_device_scan.h b/lib/igt_device_scan.h
index 44c99dec..24eafe62 100644
--- a/lib/igt_device_scan.h
+++ b/lib/igt_device_scan.h
@@ -50,10 +50,10 @@ void igt_device_print_filter_types(void);
  * IGT can store/retrieve filters passed by user using '--device' args.
  */
 
-bool igt_device_is_filter_set(void);
-void igt_device_filter_set(const char *filter);
-void igt_device_filter_free(void);
-const char *igt_device_filter_get(void);
+int igt_device_filter_count(void);
+int igt_device_filter_add(const char *filter);
+void igt_device_filter_free_all(void);
+const char *igt_device_filter_get(int num);
 
 /* Use filter to match the device and fill card structure */
 bool igt_device_card_match(const char *filter, struct igt_device_card *card);
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index f9cfc8c3..ded53fd5 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -167,7 +167,8 @@ static void set_filter_from_device(int fd)
 	strncat(path, "/device", PATH_MAX - strlen(path));
 	igt_assert(realpath(path, dst));
 
-	igt_device_filter_set(filter);
+	igt_device_filter_free_all();
+	igt_device_filter_add(filter);
 }
 
 /* Subtests */
-- 
2.25.2

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

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

* [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another
  2020-05-04  7:37 [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters Arkadiusz Hiler
@ 2020-05-04  7:37 ` Arkadiusz Hiler
  2020-05-04  8:17   ` Petri Latvala
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 3/3] test/kms_prime: Use drm_open_driver_another Arkadiusz Hiler
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Arkadiusz Hiler @ 2020-05-04  7:37 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

__drm_open_driver_another(int idx, ...) is a counterpart to
__drm_open_driver(..) with the following changes:

If device filters are provided the idx-th filter is used and the first
matching device is selected.

Consecutive calls to it, with increasing idx (starting from zero) are
guaranteed to return fd of a different /dev/dri/ node than the previous
calls or -1.

Counterparts to other existing drm_open_*() should be introduced in
similar fashion as the need arises.

v2: (Petri)
   * try_modprobe if device is not found
   * split kms_prime changes into a separate commit

Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/drmtest.c | 168 +++++++++++++++++++++++++++++++++++++++++++-------
 lib/drmtest.h |   1 +
 2 files changed, 146 insertions(+), 23 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 7b2fd337..d6ee39e0 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -246,7 +246,51 @@ err:
 	return -1;
 }
 
-static int __search_and_open(const char *base, int offset, unsigned int chipset)
+static struct {
+	int fd;
+	struct stat stat;
+}_opened_fds[64];
+
+static int _opened_fds_count;
+
+static void _set_opened_fd(int idx, int fd)
+{
+	assert(idx < ARRAY_SIZE(_opened_fds));
+	assert(idx <= _opened_fds_count);
+
+	_opened_fds[idx].fd = fd;
+
+	assert(fstat(fd, &_opened_fds[idx].stat) == 0);
+
+	_opened_fds_count = idx+1;
+}
+
+static bool _is_already_opened(const char *path, int as_idx)
+{
+	struct stat new;
+
+	assert(as_idx < ARRAY_SIZE(_opened_fds));
+	assert(as_idx <= _opened_fds_count);
+
+	/*
+	 * we cannot even stat the device, so it's of no use - let's claim it's
+	 * already opened
+	 */
+	if (stat(path, &new) != 0)
+		return true;
+
+	for (int i = 0; i < as_idx; ++i) {
+		/* did we cross filesystem boundary? */
+		assert(_opened_fds[i].stat.st_dev == new.st_dev);
+
+		if (_opened_fds[i].stat.st_ino == new.st_ino)
+			return true;
+	}
+
+	return false;
+}
+
+static int __search_and_open(const char *base, int offset, unsigned int chipset, int as_idx)
 {
 	const char *forced;
 
@@ -259,6 +303,10 @@ static int __search_and_open(const char *base, int offset, unsigned int chipset)
 		int fd;
 
 		sprintf(name, "%s%u", base, i + offset);
+
+		if (_is_already_opened(name, as_idx))
+			continue;
+
 		fd = open_device(name, chipset);
 		if (fd != -1)
 			return fd;
@@ -283,17 +331,17 @@ static void __try_modprobe(unsigned int chipset)
 	pthread_mutex_unlock(&mutex);
 }
 
-static int __open_driver(const char *base, int offset, unsigned int chipset)
+static int __open_driver(const char *base, int offset, unsigned int chipset, int as_idx)
 {
 	int fd;
 
-	fd = __search_and_open(base, offset, chipset);
+	fd = __search_and_open(base, offset, chipset, as_idx);
 	if (fd != -1)
 		return fd;
 
 	__try_modprobe(chipset);
 
-	return __search_and_open(base, offset, chipset);
+	return __search_and_open(base, offset, chipset, as_idx);
 }
 
 static int __open_driver_exact(const char *name, unsigned int chipset)
@@ -320,13 +368,13 @@ static int __open_driver_exact(const char *name, unsigned int chipset)
  * True if card according to the added filter was found,
  * false othwerwise.
  */
-static bool __get_the_first_card(struct igt_device_card *card)
+static bool __get_card_for_nth_filter(int idx, struct igt_device_card *card)
 {
 	const char *filter;
 
-	if (igt_device_filter_count() > 0) {
-		filter = igt_device_filter_get(0);
-		igt_info("Looking for devices to open using filter: %s\n", filter);
+	if (igt_device_filter_count() > idx) {
+		filter = igt_device_filter_get(idx);
+		igt_info("Looking for devices to open using filter %d: %s\n", idx, filter);
 
 		if (igt_device_card_match(filter, card)) {
 			igt_info("Filter matched %s | %s\n", card->card, card->render);
@@ -339,6 +387,92 @@ static bool __get_the_first_card(struct igt_device_card *card)
 	return false;
 }
 
+/**
+ * __drm_open_driver_another:
+ * @idx: index of the device you are opening
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * This function is intended to be used instead of drm_open_driver() for tests
+ * that are opening multiple /dev/dri/card* nodes, usually for the purpose of
+ * multi-GPU testing.
+ *
+ * This function opens device in the following order:
+ *
+ * 1. when --device arguments are present:
+ *   * device scanning is executed,
+ *   * idx-th filter (starting with 0, filters are semicolon separated) is used
+ *   * if there is no idx-th filter, goto 2
+ *   * first device maching the filter is selected
+ *   * if it's already opened (for indexes = 0..idx-1) we fail with -1
+ *   * otherwise open the device and return the fd
+ *
+ * 2. compatibility mode - open the first DRM device we can find that is not
+ *    already opened for indexes 0..idx-1, searching up to 16 device nodes
+ *
+ * The test is reponsible to test the interaction between devices in both
+ * directions if applicable.
+ *
+ * Example:
+ *
+ * |[<!-- language="c" -->
+ * igt_subtest_with_dynamic("basic") {
+ * 	int first_fd = -1;
+ * 	int second_fd = -1;
+ *
+ * 	first_fd = __drm_open_driver_another(0, DRIVER_ANY);
+ * 	igt_require(first_fd >= 0);
+ *
+ * 	second_fd = __drm_open_driver_another(1, DRIVER_ANY);
+ * 	igt_require(second_fd >= 0);
+ *
+ * 	if (can_do_foo(first_fd, second_fd))
+ * 		igt_dynamic("first-to-second")
+ * 			test_basic_from_to(first_fd, second_fd);
+ *
+ * 	if (can_do_foo(second_fd, first_fd))
+ * 		igt_dynamic("second-to-first")
+ * 			test_basic_from_to(second_fd, first_fd);
+ *
+ * 	close(first_fd);
+ * 	close(second_fd);
+ * }
+ * ]|
+ *
+ * Returns:
+ * An open DRM fd or -1 on error
+ */
+int __drm_open_driver_another(int idx, int chipset)
+{
+	int fd = -1;
+	if (igt_device_filter_count() > idx) {
+		bool found;
+		struct igt_device_card card;
+
+		found = __get_card_for_nth_filter(idx, &card);
+
+		if (!found) {
+			__try_modprobe(chipset);
+			found = __get_card_for_nth_filter(idx, &card);
+		}
+
+		if (!found || !strlen(card.card))
+			igt_warn("No card matches the filter!\n");
+		else if (_is_already_opened(card.card, idx))
+			igt_warn("card maching filter %d is already opened\n", idx);
+		else
+			fd = __open_driver_exact(card.card, chipset);
+
+	} else {
+		/* no filter for device idx, let's open whatever is available */
+		fd = __open_driver("/dev/dri/card", 0, chipset, idx);
+	}
+
+	if (fd >= 0)
+		_set_opened_fd(idx, fd);
+
+	return fd;
+}
+
 /**
  * __drm_open_driver:
  * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
@@ -354,19 +488,7 @@ static bool __get_the_first_card(struct igt_device_card *card)
  */
 int __drm_open_driver(int chipset)
 {
-	if (igt_device_filter_count() > 0) {
-		bool found;
-		struct igt_device_card card;
-
-		found = __get_the_first_card(&card);
-
-		if (!found || !strlen(card.card))
-			return -1;
-
-		return __open_driver_exact(card.card, chipset);
-	}
-
-	return __open_driver("/dev/dri/card", 0, chipset);
+	return __drm_open_driver_another(0, chipset);
 }
 
 int __drm_open_driver_render(int chipset)
@@ -375,7 +497,7 @@ int __drm_open_driver_render(int chipset)
 		bool found;
 		struct igt_device_card card;
 
-		found = __get_the_first_card(&card);
+		found = __get_card_for_nth_filter(0, &card);
 
 		if (!found || !strlen(card.render))
 			return -1;
@@ -383,7 +505,7 @@ int __drm_open_driver_render(int chipset)
 		return __open_driver_exact(card.render, chipset);
 	}
 
-	return __open_driver("/dev/dri/renderD", 128, chipset);
+	return __open_driver("/dev/dri/renderD", 128, chipset, 0);
 }
 
 static int at_exit_drm_fd = -1;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 632c616b..d5f0fc25 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -90,6 +90,7 @@ void __set_forced_driver(const char *name);
 int drm_open_driver(int chipset);
 int drm_open_driver_master(int chipset);
 int drm_open_driver_render(int chipset);
+int __drm_open_driver_another(int idx, int chipset);
 int __drm_open_driver(int chipset);
 int __drm_open_driver_render(int chipset);
 
-- 
2.25.2

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

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

* [igt-dev] [PATCH i-g-t 3/3] test/kms_prime: Use drm_open_driver_another
  2020-05-04  7:37 [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters Arkadiusz Hiler
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another Arkadiusz Hiler
@ 2020-05-04  7:37 ` Arkadiusz Hiler
  2020-05-04  8:20   ` Petri Latvala
  2020-05-04  9:06 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib: Support multiple filters Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Arkadiusz Hiler @ 2020-05-04  7:37 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The test now uses dumb buffers explicitly instead of the vgem helpers.

By default the first two devices that are matching provided chipset requirements
are used (ANY + VGEM). This is sensitive to enumeration order, but as long as
there are only two devices it's fine - PRIME will get tested both directions.

IGT-Version: 1.25-g0b58fd8c (x86_64) (Linux: 5.7.0-rc2-CI-CI_DRM_8370+ x86_64)
Starting subtest: basic-crc
Starting dynamic subtest: first-to-second
Test requirement not met in function igt_require_pipe_crc, file ../lib/igt_debugfs.c:522:
Test requirement: fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0
CRCs not supported on this platform
Last errno: 2, No such file or directory
Dynamic subtest first-to-second: SKIP (0,000s)
Starting dynamic subtest: second-to-first
Dynamic subtest second-to-first: SUCCESS (1,779s)
Subtest basic-crc: SUCCESS (2,024s)

In case there are more than two devices you can specify which ones should be
used or force ordering, e.g.:

sys:/sys/devices/pci0000:00/0000:00:02.0
    subsystem       : pci
    drm card        : /dev/dri/card0
    drm render      : /dev/dri/renderD128
    vendor          : 8086
    device          : 9A49

sys:/sys/devices/platform/vgem
    subsystem       : platform
    drm card        : /dev/dri/card1
    drm render      : /dev/dri/renderD129

IGT-Version: 1.25-g0b58fd8c (x86_64) (Linux: 5.7.0-rc2-CI-CI_DRM_8370+ x86_64)
Starting subtest: basic-crc
Looking for devices to open using filter 0: sys:/sys/devices/platform/vgem
Filter matched /dev/dri/card1 | /dev/dri/renderD129
Looking for devices to open using filter 1: pci:vendor=Intel
Filter matched /dev/dri/card0 | /dev/dri/renderD128
Starting dynamic subtest: first-to-second
Dynamic subtest first-to-second: SUCCESS (1,978s)
Starting dynamic subtest: second-to-first
Test requirement not met in function igt_require_pipe_crc, file ../lib/igt_debugfs.c:522:
Test requirement: fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0
CRCs not supported on this platform
Last errno: 2, No such file or directory
Dynamic subtest second-to-first: SKIP (0,000s)
Subtest basic-crc: SUCCESS (2,944s)

Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 tests/kms_prime.c | 107 +++++++++++++++++++++++++++++-----------------
 1 file changed, 67 insertions(+), 40 deletions(-)

diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index 3241c514..8cb2ca2a 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -22,12 +22,19 @@
  */
 
 #include "igt.h"
-#include "igt_vgem.h"
+#include "igt_device.h"
 
 #include <sys/ioctl.h>
 #include <sys/poll.h>
 #include <time.h>
 
+struct dumb_bo {
+	uint32_t handle;
+	uint32_t width, height;
+	uint32_t bpp, pitch;
+	uint64_t size;
+};
+
 struct crc_info {
 	igt_crc_t crc;
 	char *str;
@@ -67,23 +74,24 @@ static bool has_prime_export(int fd)
 }
 
 static igt_output_t *setup_display(int importer_fd, igt_display_t *display,
-				   enum pipe pipe)
+				   enum pipe *pipe)
 {
 	igt_output_t *output;
+	bool found = false;
 
-	igt_display_require(display, importer_fd);
-	igt_skip_on(pipe >= display->n_pipes);
-	output = igt_get_single_output_for_pipe(display, pipe);
+	for_each_pipe_with_valid_output(display, *pipe, output) {
+		found = true;
+		break;
+	}
 
-	igt_require_f(output, "No connector found for pipe %s\n",
-		      kmstest_pipe_name(pipe));
+	igt_require_f(found, "No valid connector/pipe found\n");
 
 	igt_display_reset(display);
-	igt_output_set_pipe(output, pipe);
+	igt_output_set_pipe(output, *pipe);
 	return output;
 }
 
-static void prepare_scratch(int exporter_fd, struct vgem_bo *scratch,
+static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
 			    drmModeModeInfo *mode, uint32_t color)
 {
 	uint32_t *ptr;
@@ -91,16 +99,27 @@ static void prepare_scratch(int exporter_fd, struct vgem_bo *scratch,
 	scratch->width = mode->hdisplay;
 	scratch->height = mode->vdisplay;
 	scratch->bpp = 32;
-	vgem_create(exporter_fd, scratch);
 
-	ptr = vgem_mmap(exporter_fd, scratch, PROT_WRITE);
+	scratch->handle = kmstest_dumb_create(exporter_fd,
+			scratch->width,
+			scratch->height,
+			scratch->bpp,
+			&scratch->pitch,
+			&scratch->size);
+
+
+	ptr = kmstest_dumb_map_buffer(exporter_fd,
+				      scratch->handle,
+				      scratch->size,
+				      PROT_WRITE);
+
 	for (size_t idx = 0; idx < scratch->size / sizeof(*ptr); ++idx)
 		ptr[idx] = color;
 
 	munmap(ptr, scratch->size);
 }
 
-static void prepare_fb(int importer_fd, struct vgem_bo *scratch, struct igt_fb *fb)
+static void prepare_fb(int importer_fd, struct dumb_bo *scratch, struct igt_fb *fb)
 {
 	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
 	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
@@ -126,6 +145,7 @@ static void import_fb(int importer_fd, struct igt_fb *fb,
 			    DRM_FORMAT_XRGB8888,
 			    handles, pitches, offsets,
 			    &fb->fb_id, 0);
+
 	igt_assert(ret == 0);
 }
 
@@ -162,19 +182,19 @@ static void test_crc(int exporter_fd, int importer_fd)
 	igt_display_t display;
 	igt_output_t *output;
 	igt_pipe_crc_t *pipe_crc;
-	enum pipe pipe = PIPE_A;
+	enum pipe pipe;
 	struct igt_fb fb;
 	int dmabuf_fd;
-	struct vgem_bo scratch = {}; /* despite the name, it suits for any
-				      * gem-compatible device
-				      * TODO: rename
-				      */
+	struct dumb_bo scratch = {};
+	bool crc_equal;
 	int i, j;
 	drmModeModeInfo *mode;
 
-	bool crc_equal = false;
+	igt_device_set_master(importer_fd);
+	igt_require_pipe_crc(importer_fd);
+	igt_display_require(&display, importer_fd);
 
-	output = setup_display(importer_fd, &display, pipe);
+	output = setup_display(importer_fd, &display, &pipe);
 
 	mode = igt_output_get_mode(output);
 	pipe_crc = igt_pipe_crc_new(importer_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
@@ -188,6 +208,7 @@ static void test_crc(int exporter_fd, int importer_fd)
 		import_fb(importer_fd, &fb, dmabuf_fd, scratch.pitch);
 		close(dmabuf_fd);
 
+
 		colors[i].prime_crc.name = "prime";
 		collect_crc_for_fb(importer_fd, &fb, &display, output,
 				   pipe_crc, colors[i].color, &colors[i].prime_crc);
@@ -228,29 +249,35 @@ static void test_crc(int exporter_fd, int importer_fd)
 	igt_display_fini(&display);
 }
 
-static void run_test_crc(int export_chipset, int import_chipset)
-{
-	int importer_fd = -1;
-	int exporter_fd = -1;
-
-	exporter_fd = drm_open_driver(export_chipset);
-	importer_fd = drm_open_driver_master(import_chipset);
-
-	igt_require(has_prime_export(exporter_fd));
-	igt_require(has_prime_import(importer_fd));
-	igt_require_pipe_crc(importer_fd);
-
-	test_crc(exporter_fd, importer_fd);
-	close(importer_fd);
-	close(exporter_fd);
-}
-
 igt_main
 {
-	igt_fixture {
+	igt_fixture
 		kmstest_set_vt_graphics_mode();
+
+	igt_describe("Make a dumb color buffer, export to another device and"
+		     " compare the CRCs with a buffer native to that device");
+	igt_subtest_with_dynamic("basic-crc") {
+		int first_fd = -1;
+		int second_fd = -1;
+
+		/* ANY = anything that is not VGEM */
+		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
+		igt_require(first_fd >= 0);
+
+		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
+		igt_require(second_fd >= 0);
+
+		if (has_prime_export(first_fd) &&
+		    has_prime_import(second_fd))
+			igt_dynamic("first-to-second")
+				test_crc(first_fd, second_fd);
+
+		if (has_prime_import(first_fd) &&
+		    has_prime_export(second_fd))
+			igt_dynamic("second-to-first")
+				test_crc(second_fd, first_fd);
+
+		close(first_fd);
+		close(second_fd);
 	}
-	igt_describe("Make a dumb buffer inside vgem, fill it, export to another device and compare the CRC");
-	igt_subtest("basic-crc")
-		run_test_crc(DRIVER_VGEM, DRIVER_ANY);
 }
-- 
2.25.2

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

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

* Re: [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another Arkadiusz Hiler
@ 2020-05-04  8:17   ` Petri Latvala
  0 siblings, 0 replies; 11+ messages in thread
From: Petri Latvala @ 2020-05-04  8:17 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

On Mon, May 04, 2020 at 10:37:06AM +0300, Arkadiusz Hiler wrote:
> __drm_open_driver_another(int idx, ...) is a counterpart to
> __drm_open_driver(..) with the following changes:
> 
> If device filters are provided the idx-th filter is used and the first
> matching device is selected.
> 
> Consecutive calls to it, with increasing idx (starting from zero) are
> guaranteed to return fd of a different /dev/dri/ node than the previous
> calls or -1.
> 
> Counterparts to other existing drm_open_*() should be introduced in
> similar fashion as the need arises.
> 
> v2: (Petri)
>    * try_modprobe if device is not found
>    * split kms_prime changes into a separate commit
> 
> Cc: Petri Latvala <petri.latvala@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  lib/drmtest.c | 168 +++++++++++++++++++++++++++++++++++++++++++-------
>  lib/drmtest.h |   1 +
>  2 files changed, 146 insertions(+), 23 deletions(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 7b2fd337..d6ee39e0 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -246,7 +246,51 @@ err:
>  	return -1;
>  }
>  
> -static int __search_and_open(const char *base, int offset, unsigned int chipset)
> +static struct {
> +	int fd;
> +	struct stat stat;
> +}_opened_fds[64];
> +
> +static int _opened_fds_count;
> +
> +static void _set_opened_fd(int idx, int fd)
> +{
> +	assert(idx < ARRAY_SIZE(_opened_fds));
> +	assert(idx <= _opened_fds_count);
> +
> +	_opened_fds[idx].fd = fd;
> +
> +	assert(fstat(fd, &_opened_fds[idx].stat) == 0);
> +
> +	_opened_fds_count = idx+1;
> +}
> +
> +static bool _is_already_opened(const char *path, int as_idx)
> +{
> +	struct stat new;
> +
> +	assert(as_idx < ARRAY_SIZE(_opened_fds));
> +	assert(as_idx <= _opened_fds_count);
> +
> +	/*
> +	 * we cannot even stat the device, so it's of no use - let's claim it's
> +	 * already opened
> +	 */
> +	if (stat(path, &new) != 0)
> +		return true;
> +
> +	for (int i = 0; i < as_idx; ++i) {
> +		/* did we cross filesystem boundary? */
> +		assert(_opened_fds[i].stat.st_dev == new.st_dev);
> +
> +		if (_opened_fds[i].stat.st_ino == new.st_ino)
> +			return true;
> +	}
> +
> +	return false;
> +}
> +
> +static int __search_and_open(const char *base, int offset, unsigned int chipset, int as_idx)
>  {
>  	const char *forced;
>  
> @@ -259,6 +303,10 @@ static int __search_and_open(const char *base, int offset, unsigned int chipset)
>  		int fd;
>  
>  		sprintf(name, "%s%u", base, i + offset);
> +
> +		if (_is_already_opened(name, as_idx))
> +			continue;
> +
>  		fd = open_device(name, chipset);
>  		if (fd != -1)
>  			return fd;
> @@ -283,17 +331,17 @@ static void __try_modprobe(unsigned int chipset)
>  	pthread_mutex_unlock(&mutex);
>  }
>  
> -static int __open_driver(const char *base, int offset, unsigned int chipset)
> +static int __open_driver(const char *base, int offset, unsigned int chipset, int as_idx)
>  {
>  	int fd;
>  
> -	fd = __search_and_open(base, offset, chipset);
> +	fd = __search_and_open(base, offset, chipset, as_idx);
>  	if (fd != -1)
>  		return fd;
>  
>  	__try_modprobe(chipset);
>  
> -	return __search_and_open(base, offset, chipset);
> +	return __search_and_open(base, offset, chipset, as_idx);
>  }
>  
>  static int __open_driver_exact(const char *name, unsigned int chipset)
> @@ -320,13 +368,13 @@ static int __open_driver_exact(const char *name, unsigned int chipset)
>   * True if card according to the added filter was found,
>   * false othwerwise.
>   */
> -static bool __get_the_first_card(struct igt_device_card *card)
> +static bool __get_card_for_nth_filter(int idx, struct igt_device_card *card)
>  {
>  	const char *filter;
>  
> -	if (igt_device_filter_count() > 0) {
> -		filter = igt_device_filter_get(0);
> -		igt_info("Looking for devices to open using filter: %s\n", filter);
> +	if (igt_device_filter_count() > idx) {
> +		filter = igt_device_filter_get(idx);
> +		igt_info("Looking for devices to open using filter %d: %s\n", idx, filter);
>  
>  		if (igt_device_card_match(filter, card)) {
>  			igt_info("Filter matched %s | %s\n", card->card, card->render);
> @@ -339,6 +387,92 @@ static bool __get_the_first_card(struct igt_device_card *card)
>  	return false;
>  }
>  
> +/**
> + * __drm_open_driver_another:
> + * @idx: index of the device you are opening
> + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> + *
> + * This function is intended to be used instead of drm_open_driver() for tests
> + * that are opening multiple /dev/dri/card* nodes, usually for the purpose of
> + * multi-GPU testing.
> + *
> + * This function opens device in the following order:
> + *
> + * 1. when --device arguments are present:
> + *   * device scanning is executed,
> + *   * idx-th filter (starting with 0, filters are semicolon separated) is used
> + *   * if there is no idx-th filter, goto 2
> + *   * first device maching the filter is selected
> + *   * if it's already opened (for indexes = 0..idx-1) we fail with -1
> + *   * otherwise open the device and return the fd
> + *
> + * 2. compatibility mode - open the first DRM device we can find that is not
> + *    already opened for indexes 0..idx-1, searching up to 16 device nodes
> + *
> + * The test is reponsible to test the interaction between devices in both
> + * directions if applicable.
> + *
> + * Example:
> + *
> + * |[<!-- language="c" -->
> + * igt_subtest_with_dynamic("basic") {
> + * 	int first_fd = -1;
> + * 	int second_fd = -1;
> + *
> + * 	first_fd = __drm_open_driver_another(0, DRIVER_ANY);
> + * 	igt_require(first_fd >= 0);
> + *
> + * 	second_fd = __drm_open_driver_another(1, DRIVER_ANY);
> + * 	igt_require(second_fd >= 0);
> + *
> + * 	if (can_do_foo(first_fd, second_fd))
> + * 		igt_dynamic("first-to-second")
> + * 			test_basic_from_to(first_fd, second_fd);
> + *
> + * 	if (can_do_foo(second_fd, first_fd))
> + * 		igt_dynamic("second-to-first")
> + * 			test_basic_from_to(second_fd, first_fd);
> + *
> + * 	close(first_fd);
> + * 	close(second_fd);
> + * }
> + * ]|
> + *
> + * Returns:
> + * An open DRM fd or -1 on error
> + */
> +int __drm_open_driver_another(int idx, int chipset)
> +{
> +	int fd = -1;
> +	if (igt_device_filter_count() > idx) {
> +		bool found;
> +		struct igt_device_card card;
> +
> +		found = __get_card_for_nth_filter(idx, &card);
> +
> +		if (!found) {
> +			__try_modprobe(chipset);
> +			found = __get_card_for_nth_filter(idx, &card);
> +		}
> +
> +		if (!found || !strlen(card.card))
> +			igt_warn("No card matches the filter!\n");
> +		else if (_is_already_opened(card.card, idx))
> +			igt_warn("card maching filter %d is already opened\n", idx);
> +		else
> +			fd = __open_driver_exact(card.card, chipset);
> +
> +	} else {
> +		/* no filter for device idx, let's open whatever is available */
> +		fd = __open_driver("/dev/dri/card", 0, chipset, idx);
> +	}
> +
> +	if (fd >= 0)
> +		_set_opened_fd(idx, fd);
> +
> +	return fd;
> +}
> +
>  /**
>   * __drm_open_driver:
>   * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
> @@ -354,19 +488,7 @@ static bool __get_the_first_card(struct igt_device_card *card)
>   */
>  int __drm_open_driver(int chipset)
>  {
> -	if (igt_device_filter_count() > 0) {
> -		bool found;
> -		struct igt_device_card card;
> -
> -		found = __get_the_first_card(&card);
> -
> -		if (!found || !strlen(card.card))
> -			return -1;
> -
> -		return __open_driver_exact(card.card, chipset);
> -	}
> -
> -	return __open_driver("/dev/dri/card", 0, chipset);
> +	return __drm_open_driver_another(0, chipset);
>  }
>  
>  int __drm_open_driver_render(int chipset)
> @@ -375,7 +497,7 @@ int __drm_open_driver_render(int chipset)
>  		bool found;
>  		struct igt_device_card card;
>  
> -		found = __get_the_first_card(&card);
> +		found = __get_card_for_nth_filter(0, &card);
>  
>  		if (!found || !strlen(card.render))
>  			return -1;
> @@ -383,7 +505,7 @@ int __drm_open_driver_render(int chipset)
>  		return __open_driver_exact(card.render, chipset);
>  	}
>  
> -	return __open_driver("/dev/dri/renderD", 128, chipset);
> +	return __open_driver("/dev/dri/renderD", 128, chipset, 0);
>  }
>  
>  static int at_exit_drm_fd = -1;
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index 632c616b..d5f0fc25 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -90,6 +90,7 @@ void __set_forced_driver(const char *name);
>  int drm_open_driver(int chipset);
>  int drm_open_driver_master(int chipset);
>  int drm_open_driver_render(int chipset);
> +int __drm_open_driver_another(int idx, int chipset);
>  int __drm_open_driver(int chipset);
>  int __drm_open_driver_render(int chipset);
>  
> -- 
> 2.25.2
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 3/3] test/kms_prime: Use drm_open_driver_another
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 3/3] test/kms_prime: Use drm_open_driver_another Arkadiusz Hiler
@ 2020-05-04  8:20   ` Petri Latvala
  0 siblings, 0 replies; 11+ messages in thread
From: Petri Latvala @ 2020-05-04  8:20 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

On Mon, May 04, 2020 at 10:37:07AM +0300, Arkadiusz Hiler wrote:
> The test now uses dumb buffers explicitly instead of the vgem helpers.
> 
> By default the first two devices that are matching provided chipset requirements
> are used (ANY + VGEM). This is sensitive to enumeration order, but as long as
> there are only two devices it's fine - PRIME will get tested both directions.
> 
> IGT-Version: 1.25-g0b58fd8c (x86_64) (Linux: 5.7.0-rc2-CI-CI_DRM_8370+ x86_64)
> Starting subtest: basic-crc
> Starting dynamic subtest: first-to-second
> Test requirement not met in function igt_require_pipe_crc, file ../lib/igt_debugfs.c:522:
> Test requirement: fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0
> CRCs not supported on this platform
> Last errno: 2, No such file or directory
> Dynamic subtest first-to-second: SKIP (0,000s)
> Starting dynamic subtest: second-to-first
> Dynamic subtest second-to-first: SUCCESS (1,779s)
> Subtest basic-crc: SUCCESS (2,024s)
> 
> In case there are more than two devices you can specify which ones should be
> used or force ordering, e.g.:
> 
> sys:/sys/devices/pci0000:00/0000:00:02.0
>     subsystem       : pci
>     drm card        : /dev/dri/card0
>     drm render      : /dev/dri/renderD128
>     vendor          : 8086
>     device          : 9A49
> 
> sys:/sys/devices/platform/vgem
>     subsystem       : platform
>     drm card        : /dev/dri/card1
>     drm render      : /dev/dri/renderD129
> 
> IGT-Version: 1.25-g0b58fd8c (x86_64) (Linux: 5.7.0-rc2-CI-CI_DRM_8370+ x86_64)
> Starting subtest: basic-crc
> Looking for devices to open using filter 0: sys:/sys/devices/platform/vgem
> Filter matched /dev/dri/card1 | /dev/dri/renderD129
> Looking for devices to open using filter 1: pci:vendor=Intel
> Filter matched /dev/dri/card0 | /dev/dri/renderD128
> Starting dynamic subtest: first-to-second
> Dynamic subtest first-to-second: SUCCESS (1,978s)
> Starting dynamic subtest: second-to-first
> Test requirement not met in function igt_require_pipe_crc, file ../lib/igt_debugfs.c:522:
> Test requirement: fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0
> CRCs not supported on this platform
> Last errno: 2, No such file or directory
> Dynamic subtest second-to-first: SKIP (0,000s)
> Subtest basic-crc: SUCCESS (2,944s)
> 
> Cc: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>  tests/kms_prime.c | 107 +++++++++++++++++++++++++++++-----------------
>  1 file changed, 67 insertions(+), 40 deletions(-)
> 
> diff --git a/tests/kms_prime.c b/tests/kms_prime.c
> index 3241c514..8cb2ca2a 100644
> --- a/tests/kms_prime.c
> +++ b/tests/kms_prime.c
> @@ -22,12 +22,19 @@
>   */
>  
>  #include "igt.h"
> -#include "igt_vgem.h"
> +#include "igt_device.h"
>  
>  #include <sys/ioctl.h>
>  #include <sys/poll.h>
>  #include <time.h>
>  
> +struct dumb_bo {
> +	uint32_t handle;
> +	uint32_t width, height;
> +	uint32_t bpp, pitch;
> +	uint64_t size;
> +};
> +
>  struct crc_info {
>  	igt_crc_t crc;
>  	char *str;
> @@ -67,23 +74,24 @@ static bool has_prime_export(int fd)
>  }
>  
>  static igt_output_t *setup_display(int importer_fd, igt_display_t *display,
> -				   enum pipe pipe)
> +				   enum pipe *pipe)
>  {
>  	igt_output_t *output;
> +	bool found = false;
>  
> -	igt_display_require(display, importer_fd);
> -	igt_skip_on(pipe >= display->n_pipes);
> -	output = igt_get_single_output_for_pipe(display, pipe);
> +	for_each_pipe_with_valid_output(display, *pipe, output) {
> +		found = true;
> +		break;
> +	}
>  
> -	igt_require_f(output, "No connector found for pipe %s\n",
> -		      kmstest_pipe_name(pipe));
> +	igt_require_f(found, "No valid connector/pipe found\n");
>  
>  	igt_display_reset(display);
> -	igt_output_set_pipe(output, pipe);
> +	igt_output_set_pipe(output, *pipe);
>  	return output;
>  }
>  
> -static void prepare_scratch(int exporter_fd, struct vgem_bo *scratch,
> +static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
>  			    drmModeModeInfo *mode, uint32_t color)
>  {
>  	uint32_t *ptr;
> @@ -91,16 +99,27 @@ static void prepare_scratch(int exporter_fd, struct vgem_bo *scratch,
>  	scratch->width = mode->hdisplay;
>  	scratch->height = mode->vdisplay;
>  	scratch->bpp = 32;
> -	vgem_create(exporter_fd, scratch);
>  
> -	ptr = vgem_mmap(exporter_fd, scratch, PROT_WRITE);
> +	scratch->handle = kmstest_dumb_create(exporter_fd,
> +			scratch->width,
> +			scratch->height,
> +			scratch->bpp,
> +			&scratch->pitch,
> +			&scratch->size);
> +
> +
> +	ptr = kmstest_dumb_map_buffer(exporter_fd,
> +				      scratch->handle,
> +				      scratch->size,
> +				      PROT_WRITE);
> +
>  	for (size_t idx = 0; idx < scratch->size / sizeof(*ptr); ++idx)
>  		ptr[idx] = color;
>  
>  	munmap(ptr, scratch->size);
>  }
>  
> -static void prepare_fb(int importer_fd, struct vgem_bo *scratch, struct igt_fb *fb)
> +static void prepare_fb(int importer_fd, struct dumb_bo *scratch, struct igt_fb *fb)
>  {
>  	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
>  	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
> @@ -126,6 +145,7 @@ static void import_fb(int importer_fd, struct igt_fb *fb,
>  			    DRM_FORMAT_XRGB8888,
>  			    handles, pitches, offsets,
>  			    &fb->fb_id, 0);
> +
>  	igt_assert(ret == 0);
>  }
>  
> @@ -162,19 +182,19 @@ static void test_crc(int exporter_fd, int importer_fd)
>  	igt_display_t display;
>  	igt_output_t *output;
>  	igt_pipe_crc_t *pipe_crc;
> -	enum pipe pipe = PIPE_A;
> +	enum pipe pipe;
>  	struct igt_fb fb;
>  	int dmabuf_fd;
> -	struct vgem_bo scratch = {}; /* despite the name, it suits for any
> -				      * gem-compatible device
> -				      * TODO: rename
> -				      */
> +	struct dumb_bo scratch = {};
> +	bool crc_equal;
>  	int i, j;
>  	drmModeModeInfo *mode;
>  
> -	bool crc_equal = false;
> +	igt_device_set_master(importer_fd);
> +	igt_require_pipe_crc(importer_fd);
> +	igt_display_require(&display, importer_fd);
>  
> -	output = setup_display(importer_fd, &display, pipe);
> +	output = setup_display(importer_fd, &display, &pipe);
>  
>  	mode = igt_output_get_mode(output);
>  	pipe_crc = igt_pipe_crc_new(importer_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
> @@ -188,6 +208,7 @@ static void test_crc(int exporter_fd, int importer_fd)
>  		import_fb(importer_fd, &fb, dmabuf_fd, scratch.pitch);
>  		close(dmabuf_fd);
>  
> +
>  		colors[i].prime_crc.name = "prime";
>  		collect_crc_for_fb(importer_fd, &fb, &display, output,
>  				   pipe_crc, colors[i].color, &colors[i].prime_crc);

Spurious whitespace change above.



Reviewed-by: Petri Latvala <petri.latvala@intel.com>




> @@ -228,29 +249,35 @@ static void test_crc(int exporter_fd, int importer_fd)
>  	igt_display_fini(&display);
>  }
>  
> -static void run_test_crc(int export_chipset, int import_chipset)
> -{
> -	int importer_fd = -1;
> -	int exporter_fd = -1;
> -
> -	exporter_fd = drm_open_driver(export_chipset);
> -	importer_fd = drm_open_driver_master(import_chipset);
> -
> -	igt_require(has_prime_export(exporter_fd));
> -	igt_require(has_prime_import(importer_fd));
> -	igt_require_pipe_crc(importer_fd);
> -
> -	test_crc(exporter_fd, importer_fd);
> -	close(importer_fd);
> -	close(exporter_fd);
> -}
> -
>  igt_main
>  {
> -	igt_fixture {
> +	igt_fixture
>  		kmstest_set_vt_graphics_mode();
> +
> +	igt_describe("Make a dumb color buffer, export to another device and"
> +		     " compare the CRCs with a buffer native to that device");
> +	igt_subtest_with_dynamic("basic-crc") {
> +		int first_fd = -1;
> +		int second_fd = -1;
> +
> +		/* ANY = anything that is not VGEM */
> +		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
> +		igt_require(first_fd >= 0);
> +
> +		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
> +		igt_require(second_fd >= 0);
> +
> +		if (has_prime_export(first_fd) &&
> +		    has_prime_import(second_fd))
> +			igt_dynamic("first-to-second")
> +				test_crc(first_fd, second_fd);
> +
> +		if (has_prime_import(first_fd) &&
> +		    has_prime_export(second_fd))
> +			igt_dynamic("second-to-first")
> +				test_crc(second_fd, first_fd);
> +
> +		close(first_fd);
> +		close(second_fd);
>  	}
> -	igt_describe("Make a dumb buffer inside vgem, fill it, export to another device and compare the CRC");
> -	igt_subtest("basic-crc")
> -		run_test_crc(DRIVER_VGEM, DRIVER_ANY);
>  }
> -- 
> 2.25.2
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib: Support multiple filters
  2020-05-04  7:37 [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters Arkadiusz Hiler
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another Arkadiusz Hiler
  2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 3/3] test/kms_prime: Use drm_open_driver_another Arkadiusz Hiler
@ 2020-05-04  9:06 ` Patchwork
  2020-05-04 16:59 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2020-11-09 17:02 ` [igt-dev] [PATCH i-g-t 1/3] " Chris Wilson
  4 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2020-05-04  9:06 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/3] lib: Support multiple filters
URL   : https://patchwork.freedesktop.org/series/76890/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8416 -> IGTPW_4527
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/index.html


Changes
-------

  No changes found


Participating hosts (50 -> 44)
------------------------------

  Additional (1): fi-gdg-551 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5628 -> IGTPW_4527

  CI-20190529: 20190529
  CI_DRM_8416: 4aa25ab0331c40f5d475c651f5f4e3801b07f28d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4527: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/index.html
  IGT_5628: 652a3fd8966345fa5498904ce80a2027a6782783 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/3] lib: Support multiple filters
  2020-05-04  7:37 [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters Arkadiusz Hiler
                   ` (2 preceding siblings ...)
  2020-05-04  9:06 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib: Support multiple filters Patchwork
@ 2020-05-04 16:59 ` Patchwork
  2020-11-09 17:02 ` [igt-dev] [PATCH i-g-t 1/3] " Chris Wilson
  4 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2020-05-04 16:59 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/3] lib: Support multiple filters
URL   : https://patchwork.freedesktop.org/series/76890/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8416_full -> IGTPW_4527_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@kms_prime@basic-crc@first-to-second} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb2/igt@kms_prime@basic-crc@first-to-second.html
    - shard-tglb:         NOTRUN -> [SKIP][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-tglb3/igt@kms_prime@basic-crc@first-to-second.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8416_full and IGTPW_4527_full:

### New IGT tests (2) ###

  * igt@kms_prime@basic-crc@first-to-second:
    - Statuses : 7 skip(s)
    - Exec time: [0.0, 0.00] s

  * igt@kms_prime@basic-crc@second-to-first:
    - Statuses : 7 pass(s)
    - Exec time: [0.72, 1.37] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_params@invalid-bsd-ring:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#109276])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-iclb2/igt@gem_exec_params@invalid-bsd-ring.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb8/igt@gem_exec_params@invalid-bsd-ring.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-kbl:          [PASS][5] -> [DMESG-WARN][6] ([i915#1436] / [i915#716])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl4/igt@gen9_exec_parse@allowed-all.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl4/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][7] -> [FAIL][8] ([i915#454])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-iclb8/igt@i915_pm_dc@dc6-psr.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb4/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@system-suspend-modeset:
    - shard-kbl:          [PASS][9] -> [INCOMPLETE][10] ([i915#151] / [i915#155])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl4/igt@i915_pm_rpm@system-suspend-modeset.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl6/igt@i915_pm_rpm@system-suspend-modeset.html

  * igt@i915_suspend@sysfs-reader:
    - shard-apl:          [PASS][11] -> [DMESG-WARN][12] ([i915#180]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl6/igt@i915_suspend@sysfs-reader.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl4/igt@i915_suspend@sysfs-reader.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x21-random:
    - shard-kbl:          [PASS][13] -> [FAIL][14] ([i915#54] / [i915#93] / [i915#95])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl1/igt@kms_cursor_crc@pipe-a-cursor-64x21-random.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-64x21-random.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [PASS][15] -> [DMESG-WARN][16] ([i915#180]) +5 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-apl:          [PASS][17] -> [FAIL][18] ([i915#54])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl2/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
    - shard-glk:          [PASS][19] -> [FAIL][20] ([i915#54])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-glk1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-glk9/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_draw_crc@draw-method-rgb565-blt-ytiled:
    - shard-glk:          [PASS][21] -> [FAIL][22] ([i915#52] / [i915#54]) +3 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-blt-ytiled.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-glk1/igt@kms_draw_crc@draw-method-rgb565-blt-ytiled.html

  * igt@kms_flip_tiling@flip-changes-tiling-y:
    - shard-apl:          [PASS][23] -> [FAIL][24] ([i915#95])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl1/igt@kms_flip_tiling@flip-changes-tiling-y.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl2/igt@kms_flip_tiling@flip-changes-tiling-y.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - shard-kbl:          [PASS][25] -> [FAIL][26] ([i915#53] / [i915#93] / [i915#95])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl1/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl2/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-glk:          [PASS][27] -> [FAIL][28] ([i915#899])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-glk7/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-glk5/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr@psr2_primary_mmap_gtt:
    - shard-iclb:         [PASS][29] -> [SKIP][30] ([fdo#109441]) +1 similar issue
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-iclb2/igt@kms_psr@psr2_primary_mmap_gtt.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb7/igt@kms_psr@psr2_primary_mmap_gtt.html

  
#### Possible fixes ####

  * {igt@gem_ctx_isolation@preservation-s3@vcs0}:
    - shard-kbl:          [DMESG-WARN][31] ([i915#180]) -> [PASS][32] +1 similar issue
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl4/igt@gem_ctx_isolation@preservation-s3@vcs0.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl1/igt@gem_ctx_isolation@preservation-s3@vcs0.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-apl:          [DMESG-WARN][33] ([i915#716]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl8/igt@gen9_exec_parse@allowed-all.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl6/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][35] ([i915#1515]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-iclb4/igt@i915_pm_rc6_residency@rc6-idle.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb5/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x42-random:
    - shard-kbl:          [FAIL][37] ([i915#54] / [i915#93] / [i915#95]) -> [PASS][38] +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-128x42-random.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-128x42-random.html

  * igt@kms_draw_crc@draw-method-rgb565-render-ytiled:
    - shard-glk:          [FAIL][39] ([i915#52] / [i915#54]) -> [PASS][40] +3 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-glk4/igt@kms_draw_crc@draw-method-rgb565-render-ytiled.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-glk4/igt@kms_draw_crc@draw-method-rgb565-render-ytiled.html

  * {igt@kms_flip@flip-vs-suspend@c-dp1}:
    - shard-apl:          [DMESG-WARN][41] ([i915#180]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl8/igt@kms_flip@flip-vs-suspend@c-dp1.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl1/igt@kms_flip@flip-vs-suspend@c-dp1.html

  * igt@kms_flip_tiling@flip-changes-tiling-yf:
    - shard-kbl:          [FAIL][43] ([i915#699] / [i915#93] / [i915#95]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl6/igt@kms_flip_tiling@flip-changes-tiling-yf.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl1/igt@kms_flip_tiling@flip-changes-tiling-yf.html
    - shard-apl:          [FAIL][45] ([i915#95]) -> [PASS][46] +1 similar issue
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl2/igt@kms_flip_tiling@flip-changes-tiling-yf.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl4/igt@kms_flip_tiling@flip-changes-tiling-yf.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
    - shard-kbl:          [FAIL][47] ([fdo#108145] / [i915#265] / [i915#93] / [i915#95]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl1/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl1/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-apl:          [FAIL][49] ([fdo#108145] / [i915#265] / [i915#95]) -> [PASS][50] +1 similar issue
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl7/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl4/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][51] ([fdo#109441]) -> [PASS][52] +1 similar issue
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-iclb7/igt@kms_psr@psr2_primary_mmap_cpu.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * {igt@perf@blocking-parameterized}:
    - shard-kbl:          [FAIL][53] ([i915#1542]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl1/igt@perf@blocking-parameterized.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl3/igt@perf@blocking-parameterized.html
    - shard-iclb:         [FAIL][55] ([i915#1542]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-iclb7/igt@perf@blocking-parameterized.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-iclb4/igt@perf@blocking-parameterized.html

  * {igt@perf@polling-parameterized}:
    - shard-hsw:          [FAIL][57] ([i915#1542]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-hsw6/igt@perf@polling-parameterized.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-hsw1/igt@perf@polling-parameterized.html

  
#### Warnings ####

  * igt@i915_pm_dc@dc6-dpms:
    - shard-tglb:         [FAIL][59] ([i915#454]) -> [SKIP][60] ([i915#468])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-tglb7/igt@i915_pm_dc@dc6-dpms.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-tglb2/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_rpm@pc8-residency:
    - shard-snb:          [SKIP][61] ([fdo#109271]) -> [INCOMPLETE][62] ([i915#82])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-snb1/igt@i915_pm_rpm@pc8-residency.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-snb4/igt@i915_pm_rpm@pc8-residency.html

  * igt@kms_content_protection@uevent:
    - shard-kbl:          [FAIL][63] ([i915#357] / [i915#93] / [i915#95]) -> [FAIL][64] ([i915#357])
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl4/igt@kms_content_protection@uevent.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl2/igt@kms_content_protection@uevent.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][65] ([i915#180]) -> [FAIL][66] ([i915#54])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-kbl:          [DMESG-FAIL][67] ([i915#180] / [i915#95]) -> [FAIL][68] ([i915#93] / [i915#95])
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-kbl4/igt@kms_fbcon_fbt@fbc-suspend.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-kbl2/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
    - shard-apl:          [FAIL][69] ([fdo#108145] / [i915#265]) -> [FAIL][70] ([fdo#108145] / [i915#265] / [i915#95])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8416/shard-apl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max.html

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

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#151]: https://gitlab.freedesktop.org/drm/intel/issues/151
  [i915#1515]: https://gitlab.freedesktop.org/drm/intel/issues/1515
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#357]: https://gitlab.freedesktop.org/drm/intel/issues/357
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#468]: https://gitlab.freedesktop.org/drm/intel/issues/468
  [i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
  [i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
  [i915#699]: https://gitlab.freedesktop.org/drm/intel/issues/699
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#899]: https://gitlab.freedesktop.org/drm/intel/issues/899
  [i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5628 -> IGTPW_4527
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_8416: 4aa25ab0331c40f5d475c651f5f4e3801b07f28d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4527: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4527/index.html
  IGT_5628: 652a3fd8966345fa5498904ce80a2027a6782783 @ 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_4527/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters
  2020-05-04  7:37 [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters Arkadiusz Hiler
                   ` (3 preceding siblings ...)
  2020-05-04 16:59 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2020-11-09 17:02 ` Chris Wilson
  2020-11-10  8:35   ` Petri Latvala
  4 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2020-11-09 17:02 UTC (permalink / raw)
  To: Arkadiusz Hiler, igt-dev; +Cc: Petri Latvala

Quoting Arkadiusz Hiler (2020-05-04 08:37:05)
> This patch brings back support for multiple filters that was in the
> original series by Zbyszek.

How is this filtering meant to work for tests that try to open two
different devices? Shouldn't the igt_device_filter_count() take into
account whether the filter even matches the desired device?
Should all of the filters include all possible devices?
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters
  2020-11-09 17:02 ` [igt-dev] [PATCH i-g-t 1/3] " Chris Wilson
@ 2020-11-10  8:35   ` Petri Latvala
  2020-11-11 12:03     ` Chris Wilson
  0 siblings, 1 reply; 11+ messages in thread
From: Petri Latvala @ 2020-11-10  8:35 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Mon, Nov 09, 2020 at 05:02:48PM +0000, Chris Wilson wrote:
> Quoting Arkadiusz Hiler (2020-05-04 08:37:05)
> > This patch brings back support for multiple filters that was in the
> > original series by Zbyszek.
> 
> How is this filtering meant to work for tests that try to open two
> different devices? Shouldn't the igt_device_filter_count() take into
> account whether the filter even matches the desired device?
> Should all of the filters include all possible devices?


If you use filters, and you have two different devices you want to
use, the test should use drm_open_driver_another() and have filters
for two devices, semicolon-separated. See kms_prime for a good example
of the usage.


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

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

* Re: [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters
  2020-11-10  8:35   ` Petri Latvala
@ 2020-11-11 12:03     ` Chris Wilson
  2020-11-11 12:55       ` Petri Latvala
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2020-11-11 12:03 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

Quoting Petri Latvala (2020-11-10 08:35:06)
> On Mon, Nov 09, 2020 at 05:02:48PM +0000, Chris Wilson wrote:
> > Quoting Arkadiusz Hiler (2020-05-04 08:37:05)
> > > This patch brings back support for multiple filters that was in the
> > > original series by Zbyszek.
> > 
> > How is this filtering meant to work for tests that try to open two
> > different devices? Shouldn't the igt_device_filter_count() take into
> > account whether the filter even matches the desired device?
> > Should all of the filters include all possible devices?
> 
> 
> If you use filters, and you have two different devices you want to
> use, the test should use drm_open_driver_another() and have filters
> for two devices, semicolon-separated. See kms_prime for a good example
> of the usage.

Why does the test know about filters?

	drm_open_driver(DRIVER_INTEL);
	drm_open_driver(DRIVER_VGEM);

fails to find vgem because some filter is restricting the available set
to intel. And _another still does not overcome an imposed restriction.

I would not call kms_prime a good example. :|
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters
  2020-11-11 12:03     ` Chris Wilson
@ 2020-11-11 12:55       ` Petri Latvala
  0 siblings, 0 replies; 11+ messages in thread
From: Petri Latvala @ 2020-11-11 12:55 UTC (permalink / raw)
  To: Chris Wilson, Arkadiusz Hiler; +Cc: igt-dev

On Wed, Nov 11, 2020 at 12:03:52PM +0000, Chris Wilson wrote:
> Quoting Petri Latvala (2020-11-10 08:35:06)
> > On Mon, Nov 09, 2020 at 05:02:48PM +0000, Chris Wilson wrote:
> > > Quoting Arkadiusz Hiler (2020-05-04 08:37:05)
> > > > This patch brings back support for multiple filters that was in the
> > > > original series by Zbyszek.
> > > 
> > > How is this filtering meant to work for tests that try to open two
> > > different devices? Shouldn't the igt_device_filter_count() take into
> > > account whether the filter even matches the desired device?
> > > Should all of the filters include all possible devices?
> > 
> > 
> > If you use filters, and you have two different devices you want to
> > use, the test should use drm_open_driver_another() and have filters
> > for two devices, semicolon-separated. See kms_prime for a good example
> > of the usage.
> 
> Why does the test know about filters?
> 
> 	drm_open_driver(DRIVER_INTEL);
> 	drm_open_driver(DRIVER_VGEM);
> 
> fails to find vgem because some filter is restricting the available set
> to intel. And _another still does not overcome an imposed restriction.

Tradeoffs on top of tradeoffs.

If you have two intel devices and you want to kms_prime between them,
you need to be able to say "this DRIVER_INTEL goes here, this other
DRIVER_INTEL goes here."

If you have an intel and a non-intel device, you need to be able to
say "run tests on this device, don't even touch that other device, I
don't care about it for this run."

Now, having said that, vgem is kinda special and it might be worth to
keep special-casing its usage (it being already not part of DRIVER_ANY
and all that), by way of ignoring all filters when chipset ==
DRIVER_VGEM.

Arek, opinions on that?


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

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

end of thread, other threads:[~2020-11-11 12:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04  7:37 [igt-dev] [PATCH i-g-t 1/3] lib: Support multiple filters Arkadiusz Hiler
2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 2/3] lib/drmtest: Introduce __drm_open_driver_another Arkadiusz Hiler
2020-05-04  8:17   ` Petri Latvala
2020-05-04  7:37 ` [igt-dev] [PATCH i-g-t 3/3] test/kms_prime: Use drm_open_driver_another Arkadiusz Hiler
2020-05-04  8:20   ` Petri Latvala
2020-05-04  9:06 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib: Support multiple filters Patchwork
2020-05-04 16:59 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-11-09 17:02 ` [igt-dev] [PATCH i-g-t 1/3] " Chris Wilson
2020-11-10  8:35   ` Petri Latvala
2020-11-11 12:03     ` Chris Wilson
2020-11-11 12:55       ` Petri Latvala

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.