Lines Matching refs:block
47 struct drm_buddy_block *block, bool buddy) in __dump_block() argument
50 block->header, drm_buddy_block_state(block), in __dump_block()
51 drm_buddy_block_order(block), drm_buddy_block_offset(block), in __dump_block()
52 drm_buddy_block_size(mm, block), !block->parent, buddy); in __dump_block()
56 struct drm_buddy_block *block) in dump_block() argument
60 __dump_block(test, mm, block, false); in dump_block()
62 buddy = drm_get_buddy(block); in dump_block()
68 struct drm_buddy_block *block) in check_block() argument
76 block_state = drm_buddy_block_state(block); in check_block()
84 block_size = drm_buddy_block_size(mm, block); in check_block()
85 offset = drm_buddy_block_offset(block); in check_block()
112 buddy = drm_get_buddy(block); in check_block()
114 if (!buddy && block->parent) { in check_block()
143 struct drm_buddy_block *block; in check_blocks() local
148 block = NULL; in check_blocks()
152 list_for_each_entry(block, blocks, link) { in check_blocks()
153 err = check_block(test, mm, block); in check_blocks()
155 if (!drm_buddy_block_is_allocated(block)) { in check_blocks()
167 offset = drm_buddy_block_offset(block); in check_blocks()
178 total += drm_buddy_block_size(mm, block); in check_blocks()
179 prev = block; in check_blocks()
197 dump_block(test, mm, block); in check_blocks()
226 struct drm_buddy_block *block; in check_mm() local
267 block = list_first_entry_or_null(&mm->free_list[order], in check_mm()
269 if (block != root) { in check_mm()
327 struct drm_buddy_block *block; in drm_test_buddy_alloc_pathological() local
351 block = list_first_entry_or_null(&blocks, typeof(*block), link); in drm_test_buddy_alloc_pathological()
352 if (block) { in drm_test_buddy_alloc_pathological()
353 list_del(&block->link); in drm_test_buddy_alloc_pathological()
354 drm_buddy_free_block(&mm, block); in drm_test_buddy_alloc_pathological()
365 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_pathological()
366 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_pathological()
368 list_move_tail(&block->link, &blocks); in drm_test_buddy_alloc_pathological()
377 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_pathological()
378 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_pathological()
380 list_move_tail(&block->link, &holes); in drm_test_buddy_alloc_pathological()
425 struct drm_buddy_block *block; in drm_test_buddy_alloc_smoke() local
460 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_smoke()
461 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_smoke()
463 list_move_tail(&block->link, &blocks); in drm_test_buddy_alloc_smoke()
464 KUNIT_EXPECT_EQ_MSG(test, drm_buddy_block_order(block), order, in drm_test_buddy_alloc_smoke()
467 total += drm_buddy_block_size(&mm, block); in drm_test_buddy_alloc_smoke()
498 struct drm_buddy_block *block, *bn; in drm_test_buddy_alloc_pessimistic() local
525 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_pessimistic()
526 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_pessimistic()
528 list_move_tail(&block->link, &blocks); in drm_test_buddy_alloc_pessimistic()
537 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_pessimistic()
538 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_pessimistic()
540 list_move_tail(&block->link, &blocks); in drm_test_buddy_alloc_pessimistic()
550 block = list_last_entry(&blocks, typeof(*block), link); in drm_test_buddy_alloc_pessimistic()
551 list_del(&block->link); in drm_test_buddy_alloc_pessimistic()
552 drm_buddy_free_block(&mm, block); in drm_test_buddy_alloc_pessimistic()
556 list_for_each_entry_safe(block, bn, &blocks, link) { in drm_test_buddy_alloc_pessimistic()
557 list_del(&block->link); in drm_test_buddy_alloc_pessimistic()
558 drm_buddy_free_block(&mm, block); in drm_test_buddy_alloc_pessimistic()
566 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_pessimistic()
567 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_pessimistic()
569 list_del(&block->link); in drm_test_buddy_alloc_pessimistic()
570 drm_buddy_free_block(&mm, block); in drm_test_buddy_alloc_pessimistic()
581 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_pessimistic()
582 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_pessimistic()
584 list_del(&block->link); in drm_test_buddy_alloc_pessimistic()
585 drm_buddy_free_block(&mm, block); in drm_test_buddy_alloc_pessimistic()
593 struct drm_buddy_block *block; in drm_test_buddy_alloc_optimistic() local
620 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_optimistic()
621 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_blocks has no blocks\n"); in drm_test_buddy_alloc_optimistic()
623 list_move_tail(&block->link, &blocks); in drm_test_buddy_alloc_optimistic()
656 struct drm_buddy_block *block; in drm_test_buddy_alloc_range() local
667 block = list_first_entry_or_null(&tmp, struct drm_buddy_block, link); in drm_test_buddy_alloc_range()
668 KUNIT_ASSERT_TRUE_MSG(test, block, "alloc_range has no blocks\n"); in drm_test_buddy_alloc_range()
670 KUNIT_ASSERT_EQ_MSG(test, drm_buddy_block_offset(block), offset, in drm_test_buddy_alloc_range()
672 drm_buddy_block_offset(block), offset); in drm_test_buddy_alloc_range()
697 struct drm_buddy_block *block; in drm_test_buddy_alloc_limit() local
712 block = list_first_entry_or_null(&allocated, struct drm_buddy_block, link); in drm_test_buddy_alloc_limit()
713 KUNIT_EXPECT_TRUE(test, block); in drm_test_buddy_alloc_limit()
715 KUNIT_EXPECT_EQ_MSG(test, drm_buddy_block_order(block), mm.max_order, in drm_test_buddy_alloc_limit()
717 drm_buddy_block_order(block), mm.max_order); in drm_test_buddy_alloc_limit()
719 KUNIT_EXPECT_EQ_MSG(test, drm_buddy_block_size(&mm, block), in drm_test_buddy_alloc_limit()
722 drm_buddy_block_size(&mm, block), in drm_test_buddy_alloc_limit()