Lines Matching full:fd
31 static int __gem_wait(int fd, struct drm_i915_gem_wait *w) in __gem_wait() argument
36 if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_WAIT, w)) in __gem_wait()
42 static void invalid_flags(int fd) in invalid_flags() argument
47 wait.bo_handle = gem_create(fd, 4096); in invalid_flags()
54 igt_assert_eq(__gem_wait(fd, &wait), -EINVAL); in invalid_flags()
56 gem_close(fd, wait.bo_handle); in invalid_flags()
59 static void invalid_buf(int fd) in invalid_buf() argument
64 igt_assert_eq(__gem_wait(fd, &wait), -ENOENT); in invalid_buf()
72 static void basic(int fd, unsigned engine, unsigned flags) in basic() argument
76 flags & (WRITE | AWAIT) ? igt_cork_plug(&cork, fd) : 0; in basic()
77 igt_spin_t *spin = igt_spin_new(fd, in basic()
84 igt_assert_eq(__gem_wait(fd, &wait), -ETIME); in basic()
99 igt_assert_eq(__gem_wait(fd, &wait), -ETIME); in basic()
101 while (__gem_wait(fd, &wait) == -ETIME) in basic()
105 igt_assert_eq(__gem_wait(fd, &wait), -ETIME); in basic()
112 igt_assert_eq(__gem_wait(fd, &wait), -ETIME); in basic()
117 igt_assert_eq(__gem_wait(fd, &wait), 0); in basic()
121 igt_assert_eq(__gem_wait(fd, &wait), 0); in basic()
126 igt_assert_eq(__gem_wait(fd, &wait), 0); in basic()
131 gem_close(fd, plug); in basic()
132 igt_spin_free(fd, spin); in basic()
138 int fd = -1; variable
143 fd = drm_open_driver_master(DRIVER_INTEL);
144 igt_require_gem(fd);
148 invalid_flags(fd);
151 invalid_buf(fd);
155 igt_fork_hang_detector(fd);
160 gem_quiescent_gpu(fd);
161 basic(fd, ALL_ENGINES, BUSY);
164 gem_quiescent_gpu(fd);
165 basic(fd, ALL_ENGINES, 0);
168 gem_quiescent_gpu(fd);
169 basic(fd, ALL_ENGINES, AWAIT);
172 gem_quiescent_gpu(fd);
173 basic(fd, ALL_ENGINES, BUSY | WRITE);
176 gem_quiescent_gpu(fd);
177 basic(fd, ALL_ENGINES, WRITE);
180 __for_each_physical_engine(fd, e) { in __for_each_physical_engine() argument
183 gem_quiescent_gpu(fd); in __for_each_physical_engine()
184 basic(fd, e->flags, BUSY); in __for_each_physical_engine()
187 gem_quiescent_gpu(fd); in __for_each_physical_engine()
188 basic(fd, e->flags, 0); in __for_each_physical_engine()
191 gem_quiescent_gpu(fd); in __for_each_physical_engine()
192 basic(fd, e->flags, AWAIT); in __for_each_physical_engine()
195 gem_quiescent_gpu(fd); in __for_each_physical_engine()
196 basic(fd, e->flags, BUSY | WRITE); in __for_each_physical_engine()
199 gem_quiescent_gpu(fd); in __for_each_physical_engine()
200 basic(fd, e->flags, WRITE); in __for_each_physical_engine()
215 hang = igt_allow_hang(fd, 0, 0);
220 gem_quiescent_gpu(fd);
221 basic(fd, ALL_ENGINES, BUSY | HANG);
224 gem_quiescent_gpu(fd);
225 basic(fd, ALL_ENGINES, HANG);
229 gem_quiescent_gpu(fd);
230 basic(fd, ALL_ENGINES, BUSY | WRITE | HANG);
233 gem_quiescent_gpu(fd);
234 basic(fd, ALL_ENGINES, WRITE | HANG);
237 __for_each_physical_engine(fd, e) { in __for_each_physical_engine() argument
239 gem_quiescent_gpu(fd); in __for_each_physical_engine()
240 basic(fd, e->flags, HANG | BUSY); in __for_each_physical_engine()
243 gem_quiescent_gpu(fd); in __for_each_physical_engine()
244 basic(fd, e->flags, HANG); in __for_each_physical_engine()
247 gem_quiescent_gpu(fd); in __for_each_physical_engine()
248 basic(fd, e->flags, HANG | WRITE | BUSY); in __for_each_physical_engine()
251 gem_quiescent_gpu(fd); in __for_each_physical_engine()
252 basic(fd, e->flags, HANG | WRITE); in __for_each_physical_engine()
258 igt_disallow_hang(fd, hang);
263 close(fd);