summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2017-08-28 14:10:15 -0700
committerDave Airlie <airlied@redhat.com>2017-10-10 14:11:57 +1000
commitd7c88290ab6a8393dc341b30c7fb5e27d2952901 (patch)
tree4285dfe024035ca438081a8af129d1ff90508704 /tests
parent55e09d07e85b6ac51d0cb2fefebb1eda6d4c12db (diff)
syncobj: Add a test for SYNCOBJ_CREATE_SIGNALED
Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/syncobj_basic.c13
-rw-r--r--tests/syncobj_wait.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/syncobj_basic.c b/tests/syncobj_basic.c
index 0a304f1f..acc4a641 100644
--- a/tests/syncobj_basic.c
+++ b/tests/syncobj_basic.c
@@ -146,6 +146,16 @@ test_bad_create_flags(int fd)
igt_assert(ret == -1 && errno == EINVAL);
}
+static void
+test_create_signaled(int fd)
+{
+ uint32_t syncobj = syncobj_create(fd, LOCAL_SYNCOBJ_CREATE_SIGNALED);
+
+ igt_assert_eq(syncobj_wait_err(fd, &syncobj, 1, 0, 0), 0);
+
+ syncobj_destroy(fd, syncobj);
+}
+
/*
* currently don't do handle deduplication
* test we get a different handle back.
@@ -215,6 +225,9 @@ igt_main
igt_subtest("bad-destroy-pad")
test_bad_destroy_pad(fd);
+ igt_subtest("create-signaled")
+ test_create_signaled(fd);
+
igt_subtest("test-valid-cycle")
test_valid_cycle(fd);
diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c
index 02699afa..385d8cd8 100644
--- a/tests/syncobj_wait.c
+++ b/tests/syncobj_wait.c
@@ -27,6 +27,8 @@
#include <unistd.h>
#include <time.h>
#include <sys/ioctl.h>
+#include <pthread.h>
+#include <signal.h>
#include "drm.h"
IGT_TEST_DESCRIPTION("Tests for the drm sync object wait API");