All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/kms_prime: Filter out devices that can't import buffers.
@ 2021-06-14 16:41 Mark Yacoub
  2021-06-14 18:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Mark Yacoub @ 2021-06-14 16:41 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala, Anson.Jacob, seanpaul, markyacoub

Some devices such as amdgpu do not support imported buffers.
Filter out those devices.
Tested on Zork with chromeos-kernel-5_4.

Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
---
 tests/kms_prime.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index 8cb2ca2a..480c7eb4 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -249,6 +249,16 @@ static void test_crc(int exporter_fd, int importer_fd)
 	igt_display_fini(&display);
 }
 
+/* The test attempts to import the buffer object from one device to another.
+ * Filter out devices that aren't capable of doing this.
+ */
+bool does_device_support_dmabuf_import(int fd) {
+	/* AMDGPU uses VRAM. Any use of the fb will migrate it to VRAM, which is not sensible for
+	 * an imported dma-buf.
+	 */
+	return !is_amdgpu_device(fd);
+}
+
 igt_main
 {
 	igt_fixture
@@ -262,10 +272,10 @@ igt_main
 
 		/* ANY = anything that is not VGEM */
 		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
-		igt_require(first_fd >= 0);
+		igt_require(first_fd >= 0 && does_device_support_dmabuf_import(first_fd));
 
 		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
-		igt_require(second_fd >= 0);
+		igt_require(second_fd >= 0 && does_device_support_dmabuf_import(second_fd));
 
 		if (has_prime_export(first_fd) &&
 		    has_prime_import(second_fd))
-- 
2.32.0.272.g935e593368-goog

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

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

end of thread, other threads:[~2021-07-02 19:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14 16:41 [igt-dev] [PATCH] tests/kms_prime: Filter out devices that can't import buffers Mark Yacoub
2021-06-14 18:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-06-15  0:25 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-06-15  9:05 ` [igt-dev] [PATCH] " Petri Latvala
2021-06-15 14:46   ` Mark Yacoub
2021-06-15 14:51     ` Christian König
2021-06-15 13:12 ` Rodrigo Siqueira
2021-06-15 13:43   ` Christian König
2021-06-15 14:49     ` Mark Yacoub
2021-06-15 14:55       ` Christian König
2021-06-15 15:46         ` Mark Yacoub
2021-06-15 16:20           ` Christian König
2021-06-16  7:34             ` Petri Latvala
2021-06-16  8:07               ` Christian König
2021-06-16  8:46                 ` Petri Latvala
2021-06-16  9:07                   ` Christian König
2021-07-02 19:45                     ` Daniel Vetter

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.