linux/drivers/gpu/drm/i915/selftests/scatterlist.c

/*
 * Copyright © 2016 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#include <linux/prime_numbers.h>
#include <linux/random.h>

#include "i915_selftest.h"
#include "i915_utils.h"

#define PFN_BIAS

struct pfn_table {};

npages_fn_t;

static noinline int expect_pfn_sg(struct pfn_table *pt,
				  npages_fn_t npages_fn,
				  struct rnd_state *rnd,
				  const char *who,
				  unsigned long timeout)
{}

static noinline int expect_pfn_sg_page_iter(struct pfn_table *pt,
					    const char *who,
					    unsigned long timeout)
{}

static noinline int expect_pfn_sgtiter(struct pfn_table *pt,
				       const char *who,
				       unsigned long timeout)
{}

static int expect_pfn_sgtable(struct pfn_table *pt,
			      npages_fn_t npages_fn,
			      struct rnd_state *rnd,
			      const char *who,
			      unsigned long timeout)
{}

static unsigned int one(unsigned long n,
			unsigned long count,
			struct rnd_state *rnd)
{}

static unsigned int grow(unsigned long n,
			 unsigned long count,
			 struct rnd_state *rnd)
{}

static unsigned int shrink(unsigned long n,
			   unsigned long count,
			   struct rnd_state *rnd)
{}

static unsigned int random(unsigned long n,
			   unsigned long count,
			   struct rnd_state *rnd)
{}

static unsigned int random_page_size_pages(unsigned long n,
					   unsigned long count,
					   struct rnd_state *rnd)
{}

static inline bool page_contiguous(struct page *first,
				   struct page *last,
				   unsigned long npages)
{}

static int alloc_table(struct pfn_table *pt,
		       unsigned long count, unsigned long max,
		       npages_fn_t npages_fn,
		       struct rnd_state *rnd,
		       int alloc_error)
{}

static const npages_fn_t npages_funcs[] =;

static int igt_sg_alloc(void *ignored)
{}

static int igt_sg_trim(void *ignored)
{}

int scatterlist_mock_selftests(void)
{}