Lines Matching full:fd
34 test_bad_destroy(int fd) in test_bad_destroy() argument
42 ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, &destroy); in test_bad_destroy()
47 /* handle to fd a bad handle */
49 test_bad_handle_to_fd(int fd) in test_bad_handle_to_fd() argument
56 igt_assert_eq(__syncobj_handle_to_fd(fd, &handle), -EINVAL); in test_bad_handle_to_fd()
59 /* fd to handle a bad fd */
61 test_bad_fd_to_handle(int fd) in test_bad_fd_to_handle() argument
65 handle.fd = -1; in test_bad_fd_to_handle()
68 igt_assert_eq(__syncobj_fd_to_handle(fd, &handle), -EINVAL); in test_bad_fd_to_handle()
71 /* fd to handle an fd but not a sync file one */
73 test_illegal_fd_to_handle(int fd) in test_illegal_fd_to_handle() argument
77 handle.fd = fd; in test_illegal_fd_to_handle()
80 igt_assert_eq(__syncobj_fd_to_handle(fd, &handle), -EINVAL); in test_illegal_fd_to_handle()
84 test_bad_flags_fd_to_handle(int fd) in test_bad_flags_fd_to_handle() argument
89 igt_assert_eq(__syncobj_fd_to_handle(fd, &handle), -EINVAL); in test_bad_flags_fd_to_handle()
93 test_bad_flags_handle_to_fd(int fd) in test_bad_flags_handle_to_fd() argument
98 igt_assert_eq(__syncobj_handle_to_fd(fd, &handle), -EINVAL); in test_bad_flags_handle_to_fd()
102 test_bad_pad_handle_to_fd(int fd) in test_bad_pad_handle_to_fd() argument
107 igt_assert_eq(__syncobj_handle_to_fd(fd, &handle), -EINVAL); in test_bad_pad_handle_to_fd()
111 test_bad_pad_fd_to_handle(int fd) in test_bad_pad_fd_to_handle() argument
116 igt_assert_eq(__syncobj_fd_to_handle(fd, &handle), -EINVAL); in test_bad_pad_fd_to_handle()
123 test_bad_destroy_pad(int fd) in test_bad_destroy_pad() argument
128 destroy.handle = syncobj_create(fd, 0); in test_bad_destroy_pad()
131 ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, &destroy); in test_bad_destroy_pad()
135 syncobj_destroy(fd, destroy.handle); in test_bad_destroy_pad()
139 test_bad_create_flags(int fd) in test_bad_create_flags() argument
145 ret = ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, &create); in test_bad_create_flags()
150 test_create_signaled(int fd) in test_create_signaled() argument
152 uint32_t syncobj = syncobj_create(fd, LOCAL_SYNCOBJ_CREATE_SIGNALED); in test_create_signaled()
154 igt_assert_eq(syncobj_wait_err(fd, &syncobj, 1, 0, 0), 0); in test_create_signaled()
156 syncobj_destroy(fd, syncobj); in test_create_signaled()
164 test_valid_cycle(int fd) in test_valid_cycle() argument
169 first_handle = syncobj_create(fd, 0); in test_valid_cycle()
170 syncobj_fd = syncobj_handle_to_fd(fd, first_handle, 0); in test_valid_cycle()
171 second_handle = syncobj_fd_to_handle(fd, syncobj_fd, 0); in test_valid_cycle()
176 syncobj_destroy(fd, first_handle); in test_valid_cycle()
177 syncobj_destroy(fd, second_handle); in test_valid_cycle()
180 static bool has_syncobj(int fd) in has_syncobj() argument
183 if (drmGetCap(fd, DRM_CAP_SYNCOBJ, &value)) in has_syncobj()
190 int fd = -1; variable
193 fd = drm_open_driver(DRIVER_ANY);
194 igt_require(has_syncobj(fd));
199 test_bad_destroy(fd);
202 test_bad_create_flags(fd);
204 igt_subtest("bad-handle-to-fd")
205 test_bad_handle_to_fd(fd);
207 igt_subtest("bad-fd-to-handle")
208 test_bad_fd_to_handle(fd);
210 igt_subtest("bad-flags-handle-to-fd")
211 test_bad_flags_handle_to_fd(fd);
213 igt_subtest("bad-flags-fd-to-handle")
214 test_bad_flags_fd_to_handle(fd);
216 igt_subtest("bad-pad-handle-to-fd")
217 test_bad_pad_handle_to_fd(fd);
219 igt_subtest("bad-pad-fd-to-handle")
220 test_bad_pad_fd_to_handle(fd);
222 igt_subtest("illegal-fd-to-handle")
223 test_illegal_fd_to_handle(fd);
226 test_bad_destroy_pad(fd);
229 test_create_signaled(fd);
232 test_valid_cycle(fd);