Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test
@ 2023-07-14 13:44 Simon Ser
  2023-07-14 14:39 ` [igt-dev] ○ CI.xeBAT: info for tests/syncobj_eventfd: new test (rev4) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Simon Ser @ 2023-07-14 13:44 UTC (permalink / raw)
  To: igt-dev
  Cc: James Jones, Austin Shafer, Bas Nieuwenhuizen,
	Christian König, Faith Ekstrand

This series implements a new test suite for the DRM_IOCTL_SYNCOBJ_EVENTFD
IOCTL introduced in [1].

v2:
- Check for DRM_CAP_SYNCOBJ_TIMELINE instead of DRM_CAP_SYNCOBJ
- Fix syncobj_eventfd availability check: ENOENT is returned when an
  IOCTL doesn't exist, so use an error path which returns a different
  errno

v3: fix IOCTL number conflict with GETFB2 (Vitaly Prosyak)

v4: revert the fix for syncobj_eventfd availability check done in v2,
this was a red herring due to the IOCTL number conflict, and drm_ioctl()
will return EINVAL for unknown IOCTL numbers

[1]: https://lore.kernel.org/dri-devel/20230714111257.11940-1-contact@emersion.fr/

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Cc: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: James Jones <jajones@nvidia.com>
Cc: Austin Shafer <ashafer@nvidia.com>
Cc: Vitaly Prosyak <Vitaly.Prosyak@amd.com>
---
 include/drm-uapi/drm.h  |  23 +++
 lib/igt_syncobj.c       |  40 +++++
 lib/igt_syncobj.h       |   4 +
 tests/meson.build       |   1 +
 tests/syncobj_eventfd.c | 344 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 412 insertions(+)
 create mode 100644 tests/syncobj_eventfd.c

diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index 5e54c3aa4c3a..506cf6e2790f 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -903,6 +903,27 @@ struct drm_syncobj_timeline_wait {
 	__u32 pad;
 };
 
+/**
+ * struct drm_syncobj_eventfd
+ * @handle: syncobj handle.
+ * @flags: Zero to wait for the point to be signalled, or
+ *         &DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE to wait for a fence to be
+ *         available for the point.
+ * @point: syncobj timeline point (set to zero for binary syncobjs).
+ * @fd: Existing eventfd to sent events to.
+ * @pad: Must be zero.
+ *
+ * Register an eventfd to be signalled by a syncobj. The eventfd counter will
+ * be incremented by one.
+ */
+struct drm_syncobj_eventfd {
+	__u32 handle;
+	__u32 flags;
+	__u64 point;
+	__s32 fd;
+	__u32 pad;
+};
+
 
 struct drm_syncobj_array {
 	__u64 handles;
@@ -1092,6 +1113,8 @@ extern "C" {
 
 #define DRM_IOCTL_MODE_GETFB2		DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
 
+#define DRM_IOCTL_SYNCOBJ_EVENTFD	DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
+
 /*
  * Device specific ioctls should only be in their respective headers
  * The device specific ioctl range is from 0x40 to 0x9f.
diff --git a/lib/igt_syncobj.c b/lib/igt_syncobj.c
index a24ed10b7a0e..a53393bd7245 100644
--- a/lib/igt_syncobj.c
+++ b/lib/igt_syncobj.c
@@ -543,3 +543,43 @@ syncobj_timeline_to_timeline(int fd,
 					 timeline_dst, point_dst,
 					 timeline_src, point_src, 0), 0);
 }
+
+int
+__syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
+		  int ev_fd)
+{
+	struct drm_syncobj_eventfd args;
+	int ret;
+
+	args.handle = handle;
+	args.flags = flags;
+	args.point = point;
+	args.fd = ev_fd;
+	args.pad = 0;
+
+	ret = igt_ioctl(fd, DRM_IOCTL_SYNCOBJ_EVENTFD, &args);
+	if (ret) {
+		ret = -errno;
+		igt_assume(ret);
+		errno = 0;
+	}
+
+	return ret;
+}
+
+/**
+ * syncobj_eventfd:
+ * @fd: The DRM file descriptor.
+ * @handle: A syncobj handle.
+ * @point: A point on the timeline syncobj, or 0 for binary syncobjs.
+ * @flags: Flags.
+ * @ev_fd: An eventfd.
+ *
+ * Wait for a syncobj with an eventfd.
+ */
+void
+syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
+		int ev_fd)
+{
+	igt_assert_eq(__syncobj_eventfd(fd, handle, point, flags, ev_fd), 0);
+}
diff --git a/lib/igt_syncobj.h b/lib/igt_syncobj.h
index e6725671d900..3911696d52f0 100644
--- a/lib/igt_syncobj.h
+++ b/lib/igt_syncobj.h
@@ -65,5 +65,9 @@ void syncobj_timeline_to_timeline(int fd,
 				  uint64_t timeline_src, uint32_t point_src);
 void syncobj_timeline_signal(int fd, uint32_t *handles, uint64_t *points,
 			     uint32_t count);
+int __syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
+		      int ev_fd);
+void syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
+		     int ev_fd);
 
 #endif /* IGT_SYNCOBJ_H */
diff --git a/tests/meson.build b/tests/meson.build
index 3eddb2fb4e22..3184f5c4edd2 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -78,6 +78,7 @@ test_progs = [
 	'prime_udl',
 	'prime_vgem',
 	'syncobj_basic',
+	'syncobj_eventfd',
 	'syncobj_wait',
 	'syncobj_timeline',
 	'sw_sync',
diff --git a/tests/syncobj_eventfd.c b/tests/syncobj_eventfd.c
new file mode 100644
index 000000000000..a58f4b2eb0fc
--- /dev/null
+++ b/tests/syncobj_eventfd.c
@@ -0,0 +1,344 @@
+/*
+ * Copyright © 2023 Simon Ser
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "igt.h"
+#include "sw_sync.h"
+#include "igt_syncobj.h"
+#include <fcntl.h>
+#include <poll.h>
+#include <sys/eventfd.h>
+#include <stdint.h>
+#include "drm.h"
+/**
+ * TEST: syncobj eventfd
+ * Category: Infrastructure
+ * Description: Tests for the drm sync object eventfd API
+ * Feature: synchronization
+ * Functionality: semaphore
+ * Run type: FULL
+ * Sub-category: DRM
+ * Test category: GEM_Legacy
+ */
+
+IGT_TEST_DESCRIPTION("Tests for the drm sync object eventfd API");
+
+static bool
+has_syncobj_eventfd(int fd)
+{
+	uint64_t value;
+	int ret;
+
+	if (drmGetCap(fd, DRM_CAP_SYNCOBJ_TIMELINE, &value))
+		return false;
+	if (!value)
+		return false;
+
+	/* Try waiting with invalid syncobj should fail with ENOENT */
+	ret = __syncobj_eventfd(fd, 0, 0, 0, -1);
+	return ret == -ENOENT;
+}
+
+static int
+syncobj_attach_sw_sync(int fd, uint32_t handle, uint64_t point)
+{
+	int timeline, fence;
+	uint32_t syncobj;
+
+	timeline = sw_sync_timeline_create();
+	fence = sw_sync_timeline_create_fence(timeline, 1);
+
+	if (point == 0) {
+		syncobj_import_sync_file(fd, handle, fence);
+	} else {
+		syncobj = syncobj_create(fd, 0);
+
+		syncobj_import_sync_file(fd, syncobj, fence);
+		syncobj_binary_to_timeline(fd, handle, point, syncobj);
+		syncobj_destroy(fd, syncobj);
+	}
+
+	close(fence);
+
+	return timeline;
+}
+
+static int
+ev_fd_read(int ev_fd)
+{
+	uint64_t ev_fd_value;
+	int ret;
+
+	ret = read(ev_fd, &ev_fd_value, sizeof(ev_fd_value));
+	if (ret == -1)
+		return -errno;
+	igt_assert_eq(ret, sizeof(ev_fd_value));
+	return 0;
+}
+
+static void
+ev_fd_poll_in(int ev_fd, bool avail)
+{
+	struct pollfd pollfd;
+	int ret;
+	int timeout_ms;
+
+	/* Wait 5s if we're expecting data, 10ms otherwise */
+	timeout_ms = avail ? 5000 : 10;
+	pollfd.fd = ev_fd;
+	pollfd.events = POLLIN;
+	pollfd.revents = 0;
+	ret = poll(&pollfd, 1, timeout_ms);
+	if (avail) {
+		igt_assert(ret >= 0);
+		igt_assert(pollfd.revents & POLLIN);
+	} else {
+		igt_assert_eq(ret, 0);
+	}
+}
+
+static void
+ev_fd_assert_unsignaled(int ev_fd)
+{
+	/* Poll the eventfd to give the kernel time to signal it, error out if
+	 * that happens */
+	ev_fd_poll_in(ev_fd, false);
+	igt_assert_eq(ev_fd_read(ev_fd), -EAGAIN);
+}
+
+static void
+ev_fd_assert_signaled(int ev_fd)
+{
+	ev_fd_poll_in(ev_fd, true);
+	igt_assert_eq(ev_fd_read(ev_fd), 0);
+}
+
+static const char test_bad_flags_desc[] =
+	"Verifies that passing bad flags is rejected";
+static void
+test_bad_flags(int fd)
+{
+	uint32_t flags;
+	uint32_t syncobj;
+	int ev_fd;
+
+	syncobj = syncobj_create(fd, DRM_SYNCOBJ_CREATE_SIGNALED);
+	flags = 0xdeadbeef;
+	ev_fd = eventfd(0, EFD_NONBLOCK);
+	igt_assert_eq(__syncobj_eventfd(fd, syncobj, 0, flags, ev_fd), -EINVAL);
+
+	close(ev_fd);
+	syncobj_destroy(fd, syncobj);
+}
+
+static const char test_illegal_handle_desc[] =
+	"Verifies that passing an invalid syncobj handle is rejected";
+static void
+test_illegal_handle(int fd)
+{
+	int ev_fd;
+
+	ev_fd = eventfd(0, EFD_NONBLOCK);
+	igt_assert_eq(__syncobj_eventfd(fd, 0, 0, 0, ev_fd), -ENOENT);
+
+	close(ev_fd);
+}
+
+static const char test_illegal_eventfd_desc[] =
+	"Verifies that passing an invalid eventfd is rejected";
+static void
+test_illegal_eventfd(int fd)
+{
+	int dev_null;
+	uint32_t syncobj;
+
+	syncobj = syncobj_create(fd, DRM_SYNCOBJ_CREATE_SIGNALED);
+
+	dev_null = open("/dev/null", O_RDWR);
+	igt_assert(dev_null >= 0);
+
+	igt_assert_eq(__syncobj_eventfd(fd, syncobj, 0, 0, dev_null), -EINVAL);
+
+	close(dev_null);
+	syncobj_destroy(fd, syncobj);
+}
+
+static const char test_bad_pad_desc[] =
+	"Verifies that passing a non-zero padding is rejected";
+static void
+test_bad_pad(int fd)
+{
+	struct drm_syncobj_eventfd args;
+	int ret;
+
+	args.handle = syncobj_create(fd, DRM_SYNCOBJ_CREATE_SIGNALED);
+	args.flags = 0;
+	args.point = 0;
+	args.fd = eventfd(0, EFD_NONBLOCK);
+	args.pad = 0xdeadbeef;
+
+	ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_EVENTFD, &args);
+	igt_assert(ret == -1 && errno == EINVAL);
+}
+
+static const char test_wait_desc[] =
+	"Verifies waiting an already-materialized fence";
+static void
+test_wait(int fd, bool use_timeline)
+{
+	uint32_t syncobj;
+	int timeline, ev_fd_wait, ev_fd_avail;
+	uint64_t point = use_timeline ? 1 : 0;
+
+	syncobj = syncobj_create(fd, 0);
+	timeline = syncobj_attach_sw_sync(fd, syncobj, point);
+	ev_fd_wait = eventfd(0, EFD_NONBLOCK);
+	ev_fd_avail = eventfd(0, EFD_NONBLOCK);
+
+	syncobj_eventfd(fd, syncobj, point, 0, ev_fd_wait);
+	syncobj_eventfd(fd, syncobj, point, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE,
+			ev_fd_avail);
+
+	ev_fd_assert_unsignaled(ev_fd_wait);
+	ev_fd_assert_signaled(ev_fd_avail);
+
+	sw_sync_timeline_inc(timeline, 1);
+
+	ev_fd_assert_signaled(ev_fd_wait);
+
+	close(ev_fd_wait);
+	close(ev_fd_avail);
+	close(timeline);
+	syncobj_destroy(fd, syncobj);
+}
+
+static const char test_wait_before_signal_desc[] =
+	"Verifies waiting a fence not yet materialized";
+static void
+test_wait_before_signal(int fd, bool use_timeline)
+{
+	uint32_t syncobj;
+	int timeline, ev_fd_wait, ev_fd_avail;
+	uint64_t point = use_timeline ? 1 : 0;
+
+	syncobj = syncobj_create(fd, 0);
+	ev_fd_wait = eventfd(0, EFD_NONBLOCK);
+	ev_fd_avail = eventfd(0, EFD_NONBLOCK);
+
+	syncobj_eventfd(fd, syncobj, point, 0, ev_fd_wait);
+	syncobj_eventfd(fd, syncobj, point, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE,
+			ev_fd_avail);
+
+	ev_fd_assert_unsignaled(ev_fd_wait);
+	ev_fd_assert_unsignaled(ev_fd_avail);
+
+	timeline = syncobj_attach_sw_sync(fd, syncobj, point);
+
+	ev_fd_assert_unsignaled(ev_fd_wait);
+	ev_fd_assert_signaled(ev_fd_avail);
+
+	sw_sync_timeline_inc(timeline, 1);
+
+	ev_fd_assert_signaled(ev_fd_wait);
+
+	close(ev_fd_wait);
+	close(ev_fd_avail);
+	close(timeline);
+	syncobj_destroy(fd, syncobj);
+}
+
+static const char test_wait_signaled_desc[] =
+	"Verifies waiting an already-signaled fence";
+static void
+test_wait_signaled(int fd, bool use_timeline)
+{
+	uint32_t syncobj;
+	int timeline, ev_fd_wait, ev_fd_avail;
+	uint64_t point = use_timeline ? 1 : 0;
+
+	syncobj = syncobj_create(fd, 0);
+	ev_fd_wait = eventfd(0, EFD_NONBLOCK);
+	ev_fd_avail = eventfd(0, EFD_NONBLOCK);
+
+	timeline = syncobj_attach_sw_sync(fd, syncobj, point);
+	sw_sync_timeline_inc(timeline, 1);
+
+	syncobj_eventfd(fd, syncobj, point, 0, ev_fd_wait);
+	syncobj_eventfd(fd, syncobj, point, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE,
+			ev_fd_avail);
+
+	ev_fd_assert_signaled(ev_fd_wait);
+	ev_fd_assert_signaled(ev_fd_avail);
+
+	close(ev_fd_wait);
+	close(ev_fd_avail);
+	close(timeline);
+	syncobj_destroy(fd, syncobj);
+}
+
+igt_main
+{
+	int fd = -1, i;
+
+	igt_fixture {
+		fd = drm_open_driver(DRIVER_ANY);
+		igt_require(has_syncobj_eventfd(fd));
+		igt_require_sw_sync();
+	}
+
+	igt_describe(test_bad_flags_desc);
+	igt_subtest("invalid-bad-flags")
+		test_bad_flags(fd);
+
+	igt_describe(test_illegal_handle_desc);
+	igt_subtest("invalid-illegal-handle")
+		test_illegal_handle(fd);
+
+	igt_describe(test_illegal_eventfd_desc);
+	igt_subtest("invalid-illegal-eventfd")
+		test_illegal_eventfd(fd);
+
+	igt_describe(test_bad_pad_desc);
+	igt_subtest("invalid-bad-pad")
+		test_bad_pad(fd);
+
+	for (i = 0; i < 2; i++) {
+		bool use_timeline = i == 1;
+		const char *kind = use_timeline ? "timeline" : "binary";
+
+		igt_describe(test_wait_desc);
+		igt_subtest_f("%s-wait", kind)
+			test_wait(fd, use_timeline);
+
+		igt_describe(test_wait_before_signal_desc);
+		igt_subtest_f("%s-wait-before-signal", kind)
+			test_wait_before_signal(fd, use_timeline);
+
+		igt_describe(test_wait_signaled_desc);
+		igt_subtest_f("%s-wait-signaled", kind)
+			test_wait_signaled(fd, use_timeline);
+	}
+
+	igt_fixture {
+		drm_close_driver(fd);
+	}
+}
-- 
2.41.0


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

* [igt-dev] ○ CI.xeBAT: info for tests/syncobj_eventfd: new test (rev4)
  2023-07-14 13:44 [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Simon Ser
@ 2023-07-14 14:39 ` Patchwork
  2023-07-14 14:51 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
  2023-08-07 15:09 ` [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Kamil Konieczny
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2023-07-14 14:39 UTC (permalink / raw)
  To: Simon Ser; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

== Series Details ==

Series: tests/syncobj_eventfd: new test (rev4)
URL   : https://patchwork.freedesktop.org/series/120551/
State : info

== Summary ==

Participating hosts:
bat-pvc-2
bat-atsm-2
bat-dg2-oem2
bat-adlp-7
Missing hosts results[0]:
Results: [IGTPW_9410](https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9410/index.html)



[-- Attachment #2: Type: text/html, Size: 852 bytes --]

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/syncobj_eventfd: new test (rev4)
  2023-07-14 13:44 [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Simon Ser
  2023-07-14 14:39 ` [igt-dev] ○ CI.xeBAT: info for tests/syncobj_eventfd: new test (rev4) Patchwork
@ 2023-07-14 14:51 ` Patchwork
  2023-08-07 15:09 ` [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Kamil Konieczny
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2023-07-14 14:51 UTC (permalink / raw)
  To: Simon Ser; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 5964 bytes --]

== Series Details ==

Series: tests/syncobj_eventfd: new test (rev4)
URL   : https://patchwork.freedesktop.org/series/120551/
State : failure

== Summary ==

CI Bug Log - changes from IGT_7388 -> IGTPW_9410
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_9410 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_9410, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

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

Participating hosts (44 -> 43)
------------------------------

  Missing    (1): fi-snb-2520m 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_exec_suspend@basic-s0@smem:
    - fi-kbl-7567u:       [PASS][1] -> [ABORT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/fi-kbl-7567u/igt@gem_exec_suspend@basic-s0@smem.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/fi-kbl-7567u/igt@gem_exec_suspend@basic-s0@smem.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@module-reload:
    - fi-skl-guc:         [PASS][3] -> [FAIL][4] ([i915#7940])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/fi-skl-guc/igt@i915_pm_rpm@module-reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/fi-skl-guc/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live@migrate:
    - bat-dg2-11:         [PASS][5] -> [DMESG-WARN][6] ([i915#7699])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/bat-dg2-11/igt@i915_selftest@live@migrate.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-dg2-11/igt@i915_selftest@live@migrate.html

  * igt@i915_selftest@live@requests:
    - bat-mtlp-6:         [PASS][7] -> [ABORT][8] ([i915#7982])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/bat-mtlp-6/igt@i915_selftest@live@requests.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-mtlp-6/igt@i915_selftest@live@requests.html

  * igt@kms_psr@primary_mmap_gtt:
    - bat-rplp-1:         NOTRUN -> [SKIP][9] ([i915#1072])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-rplp-1/igt@kms_psr@primary_mmap_gtt.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - bat-rplp-1:         NOTRUN -> [ABORT][10] ([i915#8260] / [i915#8668])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-rplp-1/igt@kms_setmode@basic-clone-single-crtc.html

  
#### Possible fixes ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-cfl-8109u:       [FAIL][11] ([i915#7940]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/fi-cfl-8109u/igt@i915_pm_rpm@basic-pci-d3-state.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/fi-cfl-8109u/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_pm_rpm@basic-rte:
    - fi-skl-guc:         [FAIL][13] ([i915#7940]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/fi-skl-guc/igt@i915_pm_rpm@basic-rte.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/fi-skl-guc/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_selftest@live@gt_mocs:
    - bat-mtlp-8:         [DMESG-FAIL][15] ([i915#7059]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@migrate:
    - bat-mtlp-8:         [DMESG-FAIL][17] ([i915#7699]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/bat-mtlp-8/igt@i915_selftest@live@migrate.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-mtlp-8/igt@i915_selftest@live@migrate.html

  
#### Warnings ####

  * igt@kms_psr@sprite_plane_onoff:
    - bat-rplp-1:         [ABORT][19] ([i915#8442] / [i915#8668] / [i915#8712]) -> [SKIP][20] ([i915#1072])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7388/bat-rplp-1/igt@kms_psr@sprite_plane_onoff.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/bat-rplp-1/igt@kms_psr@sprite_plane_onoff.html

  
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
  [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
  [i915#7940]: https://gitlab.freedesktop.org/drm/intel/issues/7940
  [i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982
  [i915#8260]: https://gitlab.freedesktop.org/drm/intel/issues/8260
  [i915#8442]: https://gitlab.freedesktop.org/drm/intel/issues/8442
  [i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
  [i915#8712]: https://gitlab.freedesktop.org/drm/intel/issues/8712


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

  * CI: CI-20190529 -> None
  * IGT: IGT_7388 -> IGTPW_9410

  CI-20190529: 20190529
  CI_DRM_13385: f8be3c363790b79801f7be6bd40062219e3789bc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_9410: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/index.html
  IGT_7388: 7388


Testlist changes
----------------

+igt@syncobj_eventfd@binary-wait
+igt@syncobj_eventfd@binary-wait-before-signal
+igt@syncobj_eventfd@binary-wait-signaled
+igt@syncobj_eventfd@invalid-bad-flags
+igt@syncobj_eventfd@invalid-bad-pad
+igt@syncobj_eventfd@invalid-illegal-eventfd
+igt@syncobj_eventfd@invalid-illegal-handle
+igt@syncobj_eventfd@timeline-wait
+igt@syncobj_eventfd@timeline-wait-before-signal
+igt@syncobj_eventfd@timeline-wait-signaled

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9410/index.html

[-- Attachment #2: Type: text/html, Size: 7218 bytes --]

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

* Re: [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test
  2023-07-14 13:44 [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Simon Ser
  2023-07-14 14:39 ` [igt-dev] ○ CI.xeBAT: info for tests/syncobj_eventfd: new test (rev4) Patchwork
  2023-07-14 14:51 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
@ 2023-08-07 15:09 ` Kamil Konieczny
  2023-08-17  7:36   ` Simon Ser
  2 siblings, 1 reply; 5+ messages in thread
From: Kamil Konieczny @ 2023-08-07 15:09 UTC (permalink / raw)
  To: igt-dev
  Cc: Simon Ser, James Jones, Austin Shafer, Bas Nieuwenhuizen,
	Christian König, Faith Ekstrand

Hi Simon,

On 2023-07-14 at 13:44:38 +0000, Simon Ser wrote:
> This series implements a new test suite for the DRM_IOCTL_SYNCOBJ_EVENTFD
> IOCTL introduced in [1].
> 
> v2:
> - Check for DRM_CAP_SYNCOBJ_TIMELINE instead of DRM_CAP_SYNCOBJ
> - Fix syncobj_eventfd availability check: ENOENT is returned when an
>   IOCTL doesn't exist, so use an error path which returns a different
>   errno
> 
> v3: fix IOCTL number conflict with GETFB2 (Vitaly Prosyak)
> 
> v4: revert the fix for syncobj_eventfd availability check done in v2,
> this was a red herring due to the IOCTL number conflict, and drm_ioctl()
> will return EINVAL for unknown IOCTL numbers
> 
> [1]: https://lore.kernel.org/dri-devel/20230714111257.11940-1-contact@emersion.fr/
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Acked-by: Christian König <christian.koenig@amd.com>
> Cc: Faith Ekstrand <faith.ekstrand@collabora.com>
> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> Cc: Daniel Stone <daniel@fooishbar.org>
> Cc: James Jones <jajones@nvidia.com>
> Cc: Austin Shafer <ashafer@nvidia.com>
> Cc: Vitaly Prosyak <Vitaly.Prosyak@amd.com>
> ---
>  include/drm-uapi/drm.h  |  23 +++

Could you split drm-uapi into separate patch? You already
have other patch with drm-uapi sync.

>  lib/igt_syncobj.c       |  40 +++++
>  lib/igt_syncobj.h       |   4 +
>  tests/meson.build       |   1 +
>  tests/syncobj_eventfd.c | 344 ++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 412 insertions(+)
>  create mode 100644 tests/syncobj_eventfd.c
> 
> diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
> index 5e54c3aa4c3a..506cf6e2790f 100644
> --- a/include/drm-uapi/drm.h
> +++ b/include/drm-uapi/drm.h
> @@ -903,6 +903,27 @@ struct drm_syncobj_timeline_wait {
>  	__u32 pad;
>  };
>  
> +/**
> + * struct drm_syncobj_eventfd
> + * @handle: syncobj handle.
> + * @flags: Zero to wait for the point to be signalled, or
> + *         &DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE to wait for a fence to be
> + *         available for the point.
> + * @point: syncobj timeline point (set to zero for binary syncobjs).
> + * @fd: Existing eventfd to sent events to.
> + * @pad: Must be zero.
> + *
> + * Register an eventfd to be signalled by a syncobj. The eventfd counter will
> + * be incremented by one.
> + */
> +struct drm_syncobj_eventfd {
> +	__u32 handle;
> +	__u32 flags;
> +	__u64 point;
> +	__s32 fd;
> +	__u32 pad;
> +};
> +
>  
>  struct drm_syncobj_array {
>  	__u64 handles;
> @@ -1092,6 +1113,8 @@ extern "C" {
>  
>  #define DRM_IOCTL_MODE_GETFB2		DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
>  
> +#define DRM_IOCTL_SYNCOBJ_EVENTFD	DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
> +
>  /*
>   * Device specific ioctls should only be in their respective headers
>   * The device specific ioctl range is from 0x40 to 0x9f.
> diff --git a/lib/igt_syncobj.c b/lib/igt_syncobj.c
> index a24ed10b7a0e..a53393bd7245 100644
> --- a/lib/igt_syncobj.c
> +++ b/lib/igt_syncobj.c
> @@ -543,3 +543,43 @@ syncobj_timeline_to_timeline(int fd,
>  					 timeline_dst, point_dst,
>  					 timeline_src, point_src, 0), 0);
>  }
> +
> +int
> +__syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
> +		  int ev_fd)
> +{
> +	struct drm_syncobj_eventfd args;
> +	int ret;
> +
> +	args.handle = handle;
> +	args.flags = flags;
> +	args.point = point;
> +	args.fd = ev_fd;
> +	args.pad = 0;
> +
> +	ret = igt_ioctl(fd, DRM_IOCTL_SYNCOBJ_EVENTFD, &args);
> +	if (ret) {
> +		ret = -errno;
> +		igt_assume(ret);
> +		errno = 0;
> +	}
> +
> +	return ret;
> +}
> +
> +/**
> + * syncobj_eventfd:
> + * @fd: The DRM file descriptor.
> + * @handle: A syncobj handle.
> + * @point: A point on the timeline syncobj, or 0 for binary syncobjs.
> + * @flags: Flags.
> + * @ev_fd: An eventfd.
> + *
> + * Wait for a syncobj with an eventfd.
> + */
> +void
> +syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
> +		int ev_fd)
> +{
> +	igt_assert_eq(__syncobj_eventfd(fd, handle, point, flags, ev_fd), 0);
> +}
> diff --git a/lib/igt_syncobj.h b/lib/igt_syncobj.h
> index e6725671d900..3911696d52f0 100644
> --- a/lib/igt_syncobj.h
> +++ b/lib/igt_syncobj.h
> @@ -65,5 +65,9 @@ void syncobj_timeline_to_timeline(int fd,
>  				  uint64_t timeline_src, uint32_t point_src);
>  void syncobj_timeline_signal(int fd, uint32_t *handles, uint64_t *points,
>  			     uint32_t count);
> +int __syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
> +		      int ev_fd);
> +void syncobj_eventfd(int fd, uint32_t handle, uint64_t point, uint32_t flags,
> +		     int ev_fd);
>  
>  #endif /* IGT_SYNCOBJ_H */
> diff --git a/tests/meson.build b/tests/meson.build
> index 3eddb2fb4e22..3184f5c4edd2 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -78,6 +78,7 @@ test_progs = [
>  	'prime_udl',
>  	'prime_vgem',
>  	'syncobj_basic',
> +	'syncobj_eventfd',
>  	'syncobj_wait',
>  	'syncobj_timeline',
>  	'sw_sync',
> diff --git a/tests/syncobj_eventfd.c b/tests/syncobj_eventfd.c
> new file mode 100644
> index 000000000000..a58f4b2eb0fc
> --- /dev/null
> +++ b/tests/syncobj_eventfd.c
> @@ -0,0 +1,344 @@
> +/*
> + * Copyright © 2023 Simon Ser
> + *

Please use SPDX licence instead, also use perl script checkpatch.pl
from Linux kernel for checks of correct SPDX use.

> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +#include "igt.h"
> +#include "sw_sync.h"
> +#include "igt_syncobj.h"
> +#include <fcntl.h>
> +#include <poll.h>
> +#include <sys/eventfd.h>
> +#include <stdint.h>
> +#include "drm.h"

Sort headers alphabetically, system one first,
then after newline igt ones.

Regards,
Kamil

> +/**
> + * TEST: syncobj eventfd
> + * Category: Infrastructure
> + * Description: Tests for the drm sync object eventfd API
> + * Feature: synchronization
> + * Functionality: semaphore
> + * Run type: FULL
> + * Sub-category: DRM
> + * Test category: GEM_Legacy
> + */
> +
> +IGT_TEST_DESCRIPTION("Tests for the drm sync object eventfd API");
> +
> +static bool
> +has_syncobj_eventfd(int fd)
> +{
> +	uint64_t value;
> +	int ret;
> +
> +	if (drmGetCap(fd, DRM_CAP_SYNCOBJ_TIMELINE, &value))
> +		return false;
> +	if (!value)
> +		return false;
> +
> +	/* Try waiting with invalid syncobj should fail with ENOENT */
> +	ret = __syncobj_eventfd(fd, 0, 0, 0, -1);
> +	return ret == -ENOENT;
> +}
> +
> +static int
> +syncobj_attach_sw_sync(int fd, uint32_t handle, uint64_t point)
> +{
> +	int timeline, fence;
> +	uint32_t syncobj;
> +
> +	timeline = sw_sync_timeline_create();
> +	fence = sw_sync_timeline_create_fence(timeline, 1);
> +
> +	if (point == 0) {
> +		syncobj_import_sync_file(fd, handle, fence);
> +	} else {
> +		syncobj = syncobj_create(fd, 0);
> +
> +		syncobj_import_sync_file(fd, syncobj, fence);
> +		syncobj_binary_to_timeline(fd, handle, point, syncobj);
> +		syncobj_destroy(fd, syncobj);
> +	}
> +
> +	close(fence);
> +
> +	return timeline;
> +}
> +
> +static int
> +ev_fd_read(int ev_fd)
> +{
> +	uint64_t ev_fd_value;
> +	int ret;
> +
> +	ret = read(ev_fd, &ev_fd_value, sizeof(ev_fd_value));
> +	if (ret == -1)
> +		return -errno;
> +	igt_assert_eq(ret, sizeof(ev_fd_value));
> +	return 0;
> +}
> +
> +static void
> +ev_fd_poll_in(int ev_fd, bool avail)
> +{
> +	struct pollfd pollfd;
> +	int ret;
> +	int timeout_ms;
> +
> +	/* Wait 5s if we're expecting data, 10ms otherwise */
> +	timeout_ms = avail ? 5000 : 10;
> +	pollfd.fd = ev_fd;
> +	pollfd.events = POLLIN;
> +	pollfd.revents = 0;
> +	ret = poll(&pollfd, 1, timeout_ms);
> +	if (avail) {
> +		igt_assert(ret >= 0);
> +		igt_assert(pollfd.revents & POLLIN);
> +	} else {
> +		igt_assert_eq(ret, 0);
> +	}
> +}
> +
> +static void
> +ev_fd_assert_unsignaled(int ev_fd)
> +{
> +	/* Poll the eventfd to give the kernel time to signal it, error out if
> +	 * that happens */
> +	ev_fd_poll_in(ev_fd, false);
> +	igt_assert_eq(ev_fd_read(ev_fd), -EAGAIN);
> +}
> +
> +static void
> +ev_fd_assert_signaled(int ev_fd)
> +{
> +	ev_fd_poll_in(ev_fd, true);
> +	igt_assert_eq(ev_fd_read(ev_fd), 0);
> +}
> +
> +static const char test_bad_flags_desc[] =
> +	"Verifies that passing bad flags is rejected";
> +static void
> +test_bad_flags(int fd)
> +{
> +	uint32_t flags;
> +	uint32_t syncobj;
> +	int ev_fd;
> +
> +	syncobj = syncobj_create(fd, DRM_SYNCOBJ_CREATE_SIGNALED);
> +	flags = 0xdeadbeef;
> +	ev_fd = eventfd(0, EFD_NONBLOCK);
> +	igt_assert_eq(__syncobj_eventfd(fd, syncobj, 0, flags, ev_fd), -EINVAL);
> +
> +	close(ev_fd);
> +	syncobj_destroy(fd, syncobj);
> +}
> +
> +static const char test_illegal_handle_desc[] =
> +	"Verifies that passing an invalid syncobj handle is rejected";
> +static void
> +test_illegal_handle(int fd)
> +{
> +	int ev_fd;
> +
> +	ev_fd = eventfd(0, EFD_NONBLOCK);
> +	igt_assert_eq(__syncobj_eventfd(fd, 0, 0, 0, ev_fd), -ENOENT);
> +
> +	close(ev_fd);
> +}
> +
> +static const char test_illegal_eventfd_desc[] =
> +	"Verifies that passing an invalid eventfd is rejected";
> +static void
> +test_illegal_eventfd(int fd)
> +{
> +	int dev_null;
> +	uint32_t syncobj;
> +
> +	syncobj = syncobj_create(fd, DRM_SYNCOBJ_CREATE_SIGNALED);
> +
> +	dev_null = open("/dev/null", O_RDWR);
> +	igt_assert(dev_null >= 0);
> +
> +	igt_assert_eq(__syncobj_eventfd(fd, syncobj, 0, 0, dev_null), -EINVAL);
> +
> +	close(dev_null);
> +	syncobj_destroy(fd, syncobj);
> +}
> +
> +static const char test_bad_pad_desc[] =
> +	"Verifies that passing a non-zero padding is rejected";
> +static void
> +test_bad_pad(int fd)
> +{
> +	struct drm_syncobj_eventfd args;
> +	int ret;
> +
> +	args.handle = syncobj_create(fd, DRM_SYNCOBJ_CREATE_SIGNALED);
> +	args.flags = 0;
> +	args.point = 0;
> +	args.fd = eventfd(0, EFD_NONBLOCK);
> +	args.pad = 0xdeadbeef;
> +
> +	ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_EVENTFD, &args);
> +	igt_assert(ret == -1 && errno == EINVAL);
> +}
> +
> +static const char test_wait_desc[] =
> +	"Verifies waiting an already-materialized fence";
> +static void
> +test_wait(int fd, bool use_timeline)
> +{
> +	uint32_t syncobj;
> +	int timeline, ev_fd_wait, ev_fd_avail;
> +	uint64_t point = use_timeline ? 1 : 0;
> +
> +	syncobj = syncobj_create(fd, 0);
> +	timeline = syncobj_attach_sw_sync(fd, syncobj, point);
> +	ev_fd_wait = eventfd(0, EFD_NONBLOCK);
> +	ev_fd_avail = eventfd(0, EFD_NONBLOCK);
> +
> +	syncobj_eventfd(fd, syncobj, point, 0, ev_fd_wait);
> +	syncobj_eventfd(fd, syncobj, point, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE,
> +			ev_fd_avail);
> +
> +	ev_fd_assert_unsignaled(ev_fd_wait);
> +	ev_fd_assert_signaled(ev_fd_avail);
> +
> +	sw_sync_timeline_inc(timeline, 1);
> +
> +	ev_fd_assert_signaled(ev_fd_wait);
> +
> +	close(ev_fd_wait);
> +	close(ev_fd_avail);
> +	close(timeline);
> +	syncobj_destroy(fd, syncobj);
> +}
> +
> +static const char test_wait_before_signal_desc[] =
> +	"Verifies waiting a fence not yet materialized";
> +static void
> +test_wait_before_signal(int fd, bool use_timeline)
> +{
> +	uint32_t syncobj;
> +	int timeline, ev_fd_wait, ev_fd_avail;
> +	uint64_t point = use_timeline ? 1 : 0;
> +
> +	syncobj = syncobj_create(fd, 0);
> +	ev_fd_wait = eventfd(0, EFD_NONBLOCK);
> +	ev_fd_avail = eventfd(0, EFD_NONBLOCK);
> +
> +	syncobj_eventfd(fd, syncobj, point, 0, ev_fd_wait);
> +	syncobj_eventfd(fd, syncobj, point, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE,
> +			ev_fd_avail);
> +
> +	ev_fd_assert_unsignaled(ev_fd_wait);
> +	ev_fd_assert_unsignaled(ev_fd_avail);
> +
> +	timeline = syncobj_attach_sw_sync(fd, syncobj, point);
> +
> +	ev_fd_assert_unsignaled(ev_fd_wait);
> +	ev_fd_assert_signaled(ev_fd_avail);
> +
> +	sw_sync_timeline_inc(timeline, 1);
> +
> +	ev_fd_assert_signaled(ev_fd_wait);
> +
> +	close(ev_fd_wait);
> +	close(ev_fd_avail);
> +	close(timeline);
> +	syncobj_destroy(fd, syncobj);
> +}
> +
> +static const char test_wait_signaled_desc[] =
> +	"Verifies waiting an already-signaled fence";
> +static void
> +test_wait_signaled(int fd, bool use_timeline)
> +{
> +	uint32_t syncobj;
> +	int timeline, ev_fd_wait, ev_fd_avail;
> +	uint64_t point = use_timeline ? 1 : 0;
> +
> +	syncobj = syncobj_create(fd, 0);
> +	ev_fd_wait = eventfd(0, EFD_NONBLOCK);
> +	ev_fd_avail = eventfd(0, EFD_NONBLOCK);
> +
> +	timeline = syncobj_attach_sw_sync(fd, syncobj, point);
> +	sw_sync_timeline_inc(timeline, 1);
> +
> +	syncobj_eventfd(fd, syncobj, point, 0, ev_fd_wait);
> +	syncobj_eventfd(fd, syncobj, point, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE,
> +			ev_fd_avail);
> +
> +	ev_fd_assert_signaled(ev_fd_wait);
> +	ev_fd_assert_signaled(ev_fd_avail);
> +
> +	close(ev_fd_wait);
> +	close(ev_fd_avail);
> +	close(timeline);
> +	syncobj_destroy(fd, syncobj);
> +}
> +
> +igt_main
> +{
> +	int fd = -1, i;
> +
> +	igt_fixture {
> +		fd = drm_open_driver(DRIVER_ANY);
> +		igt_require(has_syncobj_eventfd(fd));
> +		igt_require_sw_sync();
> +	}
> +
> +	igt_describe(test_bad_flags_desc);
> +	igt_subtest("invalid-bad-flags")
> +		test_bad_flags(fd);
> +
> +	igt_describe(test_illegal_handle_desc);
> +	igt_subtest("invalid-illegal-handle")
> +		test_illegal_handle(fd);
> +
> +	igt_describe(test_illegal_eventfd_desc);
> +	igt_subtest("invalid-illegal-eventfd")
> +		test_illegal_eventfd(fd);
> +
> +	igt_describe(test_bad_pad_desc);
> +	igt_subtest("invalid-bad-pad")
> +		test_bad_pad(fd);
> +
> +	for (i = 0; i < 2; i++) {
> +		bool use_timeline = i == 1;
> +		const char *kind = use_timeline ? "timeline" : "binary";
> +
> +		igt_describe(test_wait_desc);
> +		igt_subtest_f("%s-wait", kind)
> +			test_wait(fd, use_timeline);
> +
> +		igt_describe(test_wait_before_signal_desc);
> +		igt_subtest_f("%s-wait-before-signal", kind)
> +			test_wait_before_signal(fd, use_timeline);
> +
> +		igt_describe(test_wait_signaled_desc);
> +		igt_subtest_f("%s-wait-signaled", kind)
> +			test_wait_signaled(fd, use_timeline);
> +	}
> +
> +	igt_fixture {
> +		drm_close_driver(fd);
> +	}
> +}
> -- 
> 2.41.0
> 
> 

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

* Re: [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test
  2023-08-07 15:09 ` [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Kamil Konieczny
@ 2023-08-17  7:36   ` Simon Ser
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Ser @ 2023-08-17  7:36 UTC (permalink / raw)
  To: Kamil Konieczny
  Cc: James Jones, igt-dev, Austin Shafer, Bas Nieuwenhuizen,
	Christian König, Faith Ekstrand

On Monday, August 7th, 2023 at 17:09, Kamil Konieczny <kamil.konieczny@linux.intel.com> wrote:

> Could you split drm-uapi into separate patch? You already
> have other patch with drm-uapi sync.

I'll wait for the uapi sync patch to be merged before updating this one.

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

end of thread, other threads:[~2023-08-17  7:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 13:44 [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Simon Ser
2023-07-14 14:39 ` [igt-dev] ○ CI.xeBAT: info for tests/syncobj_eventfd: new test (rev4) Patchwork
2023-07-14 14:51 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-08-07 15:09 ` [igt-dev] [PATCH v4] tests/syncobj_eventfd: new test Kamil Konieczny
2023-08-17  7:36   ` Simon Ser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox