#include <kunit/test.h>
#include <linux/prime_numbers.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/vmalloc.h>
#include <linux/ktime.h>
#include <drm/drm_mm.h>
#include "../lib/drm_random.h"
enum { … };
static const struct insert_mode { … } insert_modes[] = …;
static bool assert_no_holes(struct kunit *test, const struct drm_mm *mm)
{ … }
static bool assert_one_hole(struct kunit *test, const struct drm_mm *mm, u64 start, u64 end)
{ … }
static u64 misalignment(struct drm_mm_node *node, u64 alignment)
{ … }
static bool assert_node(struct kunit *test, struct drm_mm_node *node, struct drm_mm *mm,
u64 size, u64 alignment, unsigned long color)
{ … }
static void drm_test_mm_init(struct kunit *test)
{ … }
static void drm_test_mm_debug(struct kunit *test)
{ … }
static bool expect_insert(struct kunit *test, struct drm_mm *mm,
struct drm_mm_node *node, u64 size, u64 alignment, unsigned long color,
const struct insert_mode *mode)
{ … }
static void drm_test_mm_align_pot(struct kunit *test, int max)
{ … }
static void drm_test_mm_align32(struct kunit *test)
{ … }
static void drm_test_mm_align64(struct kunit *test)
{ … }
static void drm_test_mm_once(struct kunit *test, unsigned int mode)
{ … }
static void drm_test_mm_lowest(struct kunit *test)
{ … }
static void drm_test_mm_highest(struct kunit *test)
{ … }
static struct kunit_case drm_mm_tests[] = …;
static struct kunit_suite drm_mm_test_suite = …;
kunit_test_suite(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;