Lines Matching refs:spin
166 igt_spin_t *spin[MAX_ELSP_QLEN]; in unplug_show_queue() local
178 spin[n] = __igt_spin_factory(fd, &opts); in unplug_show_queue()
186 igt_spin_free(fd, spin[n]); in unplug_show_queue()
217 igt_spin_t *spin = NULL; in independent() local
237 if (spin == NULL) { in independent()
238 spin = __igt_spin_new(fd, .engine = other); in independent()
242 .buffers_ptr = to_user_pointer(&spin->obj[IGT_SPIN_BATCH]), in independent()
250 igt_require(spin); in independent()
260 igt_assert(gem_bo_busy(fd, spin->handle)); in independent()
267 igt_spin_free(fd, spin); in independent()
361 igt_spin_t *spin = NULL; in semaphore_userlock() local
376 if (!spin) { in semaphore_userlock()
377 spin = igt_spin_new(i915, in semaphore_userlock()
381 uint64_t saved = spin->execbuf.flags; in semaphore_userlock()
383 spin->execbuf.flags &= ~ENGINE_MASK; in semaphore_userlock()
384 spin->execbuf.flags |= engine; in semaphore_userlock()
386 gem_execbuf(i915, &spin->execbuf); in semaphore_userlock()
388 spin->execbuf.flags = saved; in semaphore_userlock()
391 igt_require(spin); in semaphore_userlock()
408 if (engine == (spin->execbuf.flags & ENGINE_MASK)) in semaphore_userlock()
417 igt_spin_free(i915, spin); in semaphore_userlock()
516 igt_spin_t *spin; in semaphore_resolve() local
522 spin = __igt_spin_new(i915, .engine = engine); in semaphore_resolve()
523 igt_spin_end(spin); /* we just want its address for later */ in semaphore_resolve()
524 gem_sync(i915, spin->handle); in semaphore_resolve()
525 igt_spin_reset(spin); in semaphore_resolve()
547 *cs++ = spin->obj[IGT_SPIN_BATCH].offset + in semaphore_resolve()
548 offset_in_page(spin->condition); in semaphore_resolve()
559 obj[0] = spin->obj[IGT_SPIN_BATCH]; in semaphore_resolve()
573 obj[1] = spin->obj[IGT_SPIN_BATCH]; in semaphore_resolve()
604 igt_spin_free(i915, spin); in semaphore_resolve()
631 igt_spin_t *chain, *spin; in semaphore_noskip() local
638 spin = __igt_spin_new(i915, .engine = other); in semaphore_noskip()
639 igt_spin_end(spin); /* we just want its address for later */ in semaphore_noskip()
640 gem_sync(i915, spin->handle); in semaphore_noskip()
641 igt_spin_reset(spin); in semaphore_noskip()
649 *cs++ = spin->obj[IGT_SPIN_BATCH].offset + in semaphore_noskip()
650 offset_in_page(spin->condition); in semaphore_noskip()
654 *cs++ = spin->obj[IGT_SPIN_BATCH].offset + in semaphore_noskip()
655 offset_in_page(spin->condition); in semaphore_noskip()
666 obj[1] = spin->obj[IGT_SPIN_BATCH]; in semaphore_noskip()
679 obj[1] = spin->obj[IGT_SPIN_BATCH]; in semaphore_noskip()
687 gem_sync(i915, spin->handle); /* To hang unless cancel runs! */ in semaphore_noskip()
690 igt_spin_free(i915, spin); in semaphore_noskip()
795 igt_spin_t *spin[MAX_ELSP_QLEN]; in preempt() local
808 for (int n = 0; n < ARRAY_SIZE(spin); n++) { in preempt()
814 spin[n] = __igt_spin_new(fd, in preempt()
817 igt_debug("spin[%d].handle=%d\n", n, spin[n]->handle); in preempt()
823 igt_assert(gem_bo_busy(fd, spin[0]->handle)); in preempt()
826 for (int n = 0; n < ARRAY_SIZE(spin); n++) in preempt()
827 igt_spin_free(fd, spin[n]); in preempt()
841 static igt_spin_t *__noise(int fd, uint32_t ctx, int prio, igt_spin_t *spin) in __noise() argument
848 if (spin == NULL) { in __noise()
849 spin = __igt_spin_new(fd, in __noise()
855 .buffers_ptr = to_user_pointer(&spin->obj[IGT_SPIN_BATCH]), in __noise()
863 return spin; in __noise()
909 igt_spin_t *spin = NULL; in preempt_other() local
926 spin = __noise(fd, ctx[NOISE], 0, NULL); in preempt_other()
937 igt_assert(gem_bo_busy(fd, spin->handle)); in preempt_other()
938 igt_spin_free(fd, spin); in preempt_other()
1040 igt_spin_t *spin[MAX_ELSP_QLEN]; in preempt_self() local
1060 spin[n] = __igt_spin_new(fd, in preempt_self()
1076 igt_assert(gem_bo_busy(fd, spin[i]->handle)); in preempt_self()
1077 igt_spin_free(fd, spin[i]); in preempt_self()
1094 igt_spin_t *spin[MAX_ELSP_QLEN]; in preemptive_hang() local
1101 for (int n = 0; n < ARRAY_SIZE(spin); n++) { in preemptive_hang()
1105 spin[n] = __igt_spin_new(fd, in preemptive_hang()
1115 for (int n = 0; n < ARRAY_SIZE(spin); n++) { in preemptive_hang()
1120 igt_assert(gem_bo_busy(fd, spin[n]->handle)); in preemptive_hang()
1121 igt_spin_free(fd, spin[n]); in preemptive_hang()
1590 igt_spin_t *spin; in measure_semaphore_power() local
1592 spin = __igt_spin_new(i915, in measure_semaphore_power()
1595 gem_wait(i915, spin->handle, &jiffie); /* waitboost */ in measure_semaphore_power()
1596 igt_spin_busywait_until_started(spin); in measure_semaphore_power()
1611 .dependency = spin->handle); in measure_semaphore_power()
1621 igt_spin_free(i915, spin); in measure_semaphore_power()