Lines Matching refs:spin
182 static unsigned long __spin_wait(int fd, igt_spin_t *spin) in __spin_wait() argument
188 if (igt_spin_has_poll(spin)) { in __spin_wait()
191 while (!igt_spin_has_started(spin)) { in __spin_wait()
211 igt_spin_t *spin = __spin_poll(fd, ctx, e); in __spin_sync() local
213 __spin_wait(fd, spin); in __spin_sync()
215 return spin; in __spin_sync()
238 static void end_spin(int fd, igt_spin_t *spin, unsigned int flags) in end_spin() argument
240 if (!spin) in end_spin()
243 igt_spin_end(spin); in end_spin()
246 gem_sync(fd, spin->handle); in end_spin()
257 if (gem_bo_busy(fd, spin->handle) && in end_spin()
273 igt_spin_t *spin; in single() local
280 spin = spin_sync(gem_fd, 0, e); in single()
282 spin = NULL; in single()
287 end_spin(gem_fd, spin, flags); in single()
293 end_spin(gem_fd, spin, FLAG_SYNC); in single()
300 igt_assert(!gem_bo_busy(gem_fd, spin->handle)); in single()
309 igt_spin_free(gem_fd, spin); in single()
320 igt_spin_t *spin; in busy_start() local
329 spin = __spin_sync(gem_fd, 0, e); in busy_start()
338 igt_spin_free(gem_fd, spin); in busy_start()
355 igt_spin_t *spin[2]; in busy_double_start() local
373 spin[0] = __spin_sync(gem_fd, 0, e); in busy_double_start()
375 spin[1] = __igt_spin_new(gem_fd, in busy_double_start()
390 igt_spin_end(spin[0]); in busy_double_start()
391 igt_spin_end(spin[1]); in busy_double_start()
402 igt_spin_free(gem_fd, spin[0]); in busy_double_start()
403 igt_spin_free(gem_fd, spin[1]); in busy_double_start()
444 igt_spin_t *spin; in busy_check_all() local
459 spin = spin_sync(gem_fd, 0, e); in busy_check_all()
463 end_spin(gem_fd, spin, flags); in busy_check_all()
466 end_spin(gem_fd, spin, FLAG_SYNC); in busy_check_all()
467 igt_spin_free(gem_fd, spin); in busy_check_all()
485 __submit_spin(int gem_fd, igt_spin_t *spin, in __submit_spin() argument
489 struct drm_i915_gem_execbuffer2 eb = spin->execbuf; in __submit_spin()
507 igt_spin_t *spin = NULL; in most_busy_check_all() local
514 else if (spin) in most_busy_check_all()
515 __submit_spin(gem_fd, spin, e_, 64); in most_busy_check_all()
517 spin = __spin_poll(gem_fd, 0, e_); in most_busy_check_all()
522 igt_require(spin); /* at least one busy engine */ in most_busy_check_all()
529 usleep(__spin_wait(gem_fd, spin) * num_engines / 1e3); in most_busy_check_all()
534 end_spin(gem_fd, spin, flags); in most_busy_check_all()
537 end_spin(gem_fd, spin, FLAG_SYNC); in most_busy_check_all()
538 igt_spin_free(gem_fd, spin); in most_busy_check_all()
564 igt_spin_t *spin = NULL; in all_busy_check_all() local
569 if (spin) in all_busy_check_all()
570 __submit_spin(gem_fd, spin, e, 64); in all_busy_check_all()
572 spin = __spin_poll(gem_fd, 0, e); in all_busy_check_all()
583 usleep(__spin_wait(gem_fd, spin) * num_engines / 1e3); in all_busy_check_all()
588 end_spin(gem_fd, spin, flags); in all_busy_check_all()
591 end_spin(gem_fd, spin, FLAG_SYNC); in all_busy_check_all()
592 igt_spin_free(gem_fd, spin); in all_busy_check_all()
608 igt_spin_t *spin; in no_sema() local
616 spin = spin_sync(gem_fd, 0, e); in no_sema()
618 spin = NULL; in no_sema()
623 end_spin(gem_fd, spin, flags); in no_sema()
629 if (spin) { in no_sema()
630 end_spin(gem_fd, spin, FLAG_SYNC); in no_sema()
631 igt_spin_free(gem_fd, spin); in no_sema()
936 igt_spin_t *spin; in multi_client() local
950 spin = spin_sync(gem_fd, 0, e); in multi_client()
964 igt_spin_end(spin); in multi_client()
965 gem_sync(gem_fd, spin->handle); in multi_client()
966 igt_spin_free(gem_fd, spin); in multi_client()
1050 igt_spin_t *spin[2]; in cpu_hotplug() local
1066 spin[0] = igt_spin_new(gem_fd, .engine = I915_EXEC_DEFAULT); in cpu_hotplug()
1067 spin[1] = __igt_spin_new(gem_fd, .engine = I915_EXEC_DEFAULT); in cpu_hotplug()
1142 end_spin(gem_fd, spin[cur], 0); in cpu_hotplug()
1149 igt_spin_free(gem_fd, spin[cur]); in cpu_hotplug()
1150 spin[cur] = __igt_spin_new(gem_fd, in cpu_hotplug()
1157 end_spin(gem_fd, spin[0], FLAG_SYNC); in cpu_hotplug()
1158 end_spin(gem_fd, spin[1], FLAG_SYNC); in cpu_hotplug()
1159 igt_spin_free(gem_fd, spin[0]); in cpu_hotplug()
1160 igt_spin_free(gem_fd, spin[1]); in cpu_hotplug()
1176 igt_spin_t *spin[target]; in test_interrupts() local
1188 spin[i] = __igt_spin_new(gem_fd, in test_interrupts()
1192 fence_fd = spin[i]->out_fence; in test_interrupts()
1197 spin[i]->out_fence); in test_interrupts()
1214 igt_spin_set_timeout(spin[i], in test_interrupts()
1226 igt_spin_free(gem_fd, spin[i]); in test_interrupts()
1240 igt_spin_t *spin[target]; in test_interrupts_sync() local
1251 spin[i] = __igt_spin_new(gem_fd, in test_interrupts_sync()
1267 pfd.fd = spin[i]->out_fence; in test_interrupts_sync()
1268 igt_spin_set_timeout(spin[i], timeout_ms * 1e6); in test_interrupts_sync()
1270 igt_spin_free(gem_fd, spin[i]); in test_interrupts_sync()
1286 igt_spin_t *spin; in test_frequency() local
1315 spin = spin_sync_flags(gem_fd, 0, I915_EXEC_DEFAULT); in test_frequency()
1324 igt_spin_free(gem_fd, spin); in test_frequency()
1341 spin = spin_sync_flags(gem_fd, 0, I915_EXEC_DEFAULT); in test_frequency()
1350 igt_spin_free(gem_fd, spin); in test_frequency()
1573 igt_spin_t *spin; in accuracy() local
1576 spin = igt_spin_new(gem_fd, .engine = e->flags); in accuracy()
1577 igt_spin_end(spin); in accuracy()
1578 gem_sync(gem_fd, spin->handle); in accuracy()
1602 igt_spin_reset(spin); in accuracy()
1603 __submit_spin(gem_fd, spin, e, 0); in accuracy()
1609 igt_spin_end(spin); in accuracy()
1646 igt_spin_free(gem_fd, spin); in accuracy()