All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/gem_exec_fence: Check sync_file->status after the fence is signaled
@ 2017-01-03 14:59 Chris Wilson
  0 siblings, 0 replies; only message in thread
From: Chris Wilson @ 2017-01-03 14:59 UTC (permalink / raw)
  To: intel-gfx

After the fence is signaled, the status feed reports whether or not the
request completed successfully. We set this to -EIO if a hang was
detected.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_exec_fence.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/gem_exec_fence.c b/tests/gem_exec_fence.c
index ea007468..4fe1bcee 100644
--- a/tests/gem_exec_fence.c
+++ b/tests/gem_exec_fence.c
@@ -91,6 +91,46 @@ static void store(int fd, unsigned ring, int fence, uint32_t target, unsigned of
 	gem_close(fd, obj[BATCH].handle);
 }
 
+struct local_sync_fence_info {
+	char obj_name[32];
+	char driver_name[32];
+
+	__s32 status;
+	__u32 flags;
+
+	__u64 timestamp_ns;
+};
+
+struct local_sync_file_info {
+	char  name[32];
+
+	__s32 status;
+	__u32 flags;
+	__u32 num_fences;
+	__u32 pad;
+
+	__u64 sync_fence_info;
+};
+
+#define UABI_SYNC_IOC_MAGIC '>'
+#define LOCAL_SYNC_IOC_FILE_INFO        _IOWR(UABI_SYNC_IOC_MAGIC, 4, struct local_sync_file_info)
+
+#define FENCE_OK 1
+
+static int fence_status(int fence)
+{
+	struct local_sync_fence_info fence_info;
+	struct local_sync_file_info info = {
+		.num_fences = 1,
+		.sync_fence_info = to_user_pointer(&fence_info),
+	};
+
+	(void)ioctl(fence, LOCAL_SYNC_IOC_FILE_INFO, &info);
+	igt_assert(info.num_fences == 1);
+
+	return fence_info.status;
+}
+
 static int __gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 {
 	int err = 0;
@@ -194,6 +234,7 @@ static void test_fence_busy(int fd, unsigned ring, unsigned flags)
 	}
 
 	igt_assert(!gem_bo_busy(fd, obj.handle));
+	igt_assert_eq(fence_status(fence), flags & HANG ? -EIO : FENCE_OK);
 
 	close(fence);
 	gem_close(fd, obj.handle);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-03 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 14:59 [PATCH igt] igt/gem_exec_fence: Check sync_file->status after the fence is signaled Chris Wilson

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.