Lines Matching refs:sync
101 static int check_syncmap_free(struct i915_syncmap **sync) in check_syncmap_free() argument
103 i915_syncmap_free(sync); in check_syncmap_free()
104 if (*sync) { in check_syncmap_free()
112 static int dump_syncmap(struct i915_syncmap *sync, int err) in dump_syncmap() argument
117 return check_syncmap_free(&sync); in dump_syncmap()
123 if (i915_syncmap_print_to_buf(sync, buf, PAGE_SIZE)) in dump_syncmap()
129 i915_syncmap_free(&sync); in dump_syncmap()
135 struct i915_syncmap *sync = (void *)~0ul; in igt_syncmap_init() local
142 i915_syncmap_init(&sync); in igt_syncmap_init()
143 return check_syncmap_free(&sync); in igt_syncmap_init()
163 static int check_one(struct i915_syncmap **sync, u64 context, u32 seqno) in check_one() argument
167 err = i915_syncmap_set(sync, context, seqno); in check_one()
171 if ((*sync)->height) { in check_one()
173 context, (*sync)->height, (*sync)->prefix); in check_one()
177 if ((*sync)->parent) { in check_one()
183 if (hweight32((*sync)->bitmap) != 1) { in check_one()
185 (*sync)->bitmap, hweight32((*sync)->bitmap)); in check_one()
189 err = check_seqno((*sync), ilog2((*sync)->bitmap), seqno); in check_one()
193 if (!i915_syncmap_is_later(sync, context, seqno)) { in check_one()
206 struct i915_syncmap *sync; in igt_syncmap_one() local
214 i915_syncmap_init(&sync); in igt_syncmap_one()
220 err = check_syncmap_free(&sync); in igt_syncmap_one()
225 err = check_one(&sync, context, in igt_syncmap_one()
235 return dump_syncmap(sync, err); in igt_syncmap_one()
238 static int check_leaf(struct i915_syncmap **sync, u64 context, u32 seqno) in check_leaf() argument
242 err = i915_syncmap_set(sync, context, seqno); in check_leaf()
246 if ((*sync)->height) { in check_leaf()
248 context, (*sync)->height, (*sync)->prefix); in check_leaf()
252 if (hweight32((*sync)->bitmap) != 1) { in check_leaf()
254 context, (*sync)->bitmap, hweight32((*sync)->bitmap)); in check_leaf()
258 err = check_seqno((*sync), ilog2((*sync)->bitmap), seqno); in check_leaf()
262 if (!i915_syncmap_is_later(sync, context, seqno)) { in check_leaf()
273 struct i915_syncmap *sync; in igt_syncmap_join_above() local
277 i915_syncmap_init(&sync); in igt_syncmap_join_above()
300 err = check_leaf(&sync, context, 0); in igt_syncmap_join_above()
304 join = sync->parent; in igt_syncmap_join_above()
321 if (__sync_child(join)[__sync_branch_idx(join, context)] != sync) { in igt_syncmap_join_above()
329 return dump_syncmap(sync, err); in igt_syncmap_join_above()
334 struct i915_syncmap *sync; in igt_syncmap_join_below() local
338 i915_syncmap_init(&sync); in igt_syncmap_join_below()
348 err = i915_syncmap_set(&sync, context, 0); in igt_syncmap_join_below()
352 if (sync->height) { in igt_syncmap_join_below()
354 context, order, step, sync->height, sync->prefix); in igt_syncmap_join_below()
365 if (!i915_syncmap_is_later(&sync, context, 0)) { in igt_syncmap_join_below()
373 if (i915_syncmap_is_later(&sync, context + idx, 0)) { in igt_syncmap_join_below()
387 if (!i915_syncmap_is_later(&sync, context, 0)) { in igt_syncmap_join_below()
397 return dump_syncmap(sync, err); in igt_syncmap_join_below()
404 struct i915_syncmap *sync; in igt_syncmap_neighbours() local
412 i915_syncmap_init(&sync); in igt_syncmap_neighbours()
417 if (i915_syncmap_is_later(&sync, context, 0)) /* Skip repeats */ in igt_syncmap_neighbours()
421 err = i915_syncmap_set(&sync, context + idx, 0); in igt_syncmap_neighbours()
425 if (sync->height) { in igt_syncmap_neighbours()
427 context, sync->height, sync->prefix); in igt_syncmap_neighbours()
432 if (sync->bitmap != BIT(idx + 1) - 1) { in igt_syncmap_neighbours()
435 sync->bitmap, hweight32(sync->bitmap), in igt_syncmap_neighbours()
443 return dump_syncmap(sync, err); in igt_syncmap_neighbours()
448 struct i915_syncmap *sync; in igt_syncmap_compact() local
452 i915_syncmap_init(&sync); in igt_syncmap_compact()
463 err = check_syncmap_free(&sync); in igt_syncmap_compact()
471 err = i915_syncmap_set(&sync, context, 0); in igt_syncmap_compact()
475 if (sync->height) { in igt_syncmap_compact()
478 sync->height, sync->prefix); in igt_syncmap_compact()
484 sync = sync->parent; in igt_syncmap_compact()
485 if (sync->parent) { in igt_syncmap_compact()
491 if (sync->height != order) { in igt_syncmap_compact()
493 sync->height, order); in igt_syncmap_compact()
498 if (sync->bitmap != BIT(KSYNCMAP) - 1) { in igt_syncmap_compact()
500 sync->bitmap, hweight32(sync->bitmap), in igt_syncmap_compact()
508 struct i915_syncmap *leaf = __sync_child(sync)[idx]; in igt_syncmap_compact()
516 if (leaf->parent != sync) { in igt_syncmap_compact()
539 return dump_syncmap(sync, err); in igt_syncmap_compact()
546 struct i915_syncmap *sync; in igt_syncmap_random() local
551 i915_syncmap_init(&sync); in igt_syncmap_random()
564 err = i915_syncmap_set(&sync, context, 0); in igt_syncmap_random()
584 if (i915_syncmap_is_later(&sync, context, seqno) != expect) { in igt_syncmap_random()
591 err = i915_syncmap_set(&sync, context, seqno); in igt_syncmap_random()
600 return dump_syncmap(sync, err); in igt_syncmap_random()