linux/drivers/gpu/drm/i915/selftests/i915_gem_gtt.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/list_sort.h>
#include <linux/prime_numbers.h>

#include "gem/i915_gem_context.h"
#include "gem/i915_gem_internal.h"
#include "gem/i915_gem_lmem.h"
#include "gem/i915_gem_region.h"
#include "gem/selftests/mock_context.h"
#include "gt/intel_context.h"
#include "gt/intel_gpu_commands.h"
#include "gt/intel_gtt.h"

#include "i915_random.h"
#include "i915_selftest.h"
#include "i915_vma_resource.h"

#include "mock_drm.h"
#include "mock_gem_device.h"
#include "mock_gtt.h"
#include "igt_flush_test.h"

static void cleanup_freed_objects(struct drm_i915_private *i915)
{}

static void fake_free_pages(struct drm_i915_gem_object *obj,
			    struct sg_table *pages)
{}

static int fake_get_pages(struct drm_i915_gem_object *obj)
{}

static void fake_put_pages(struct drm_i915_gem_object *obj,
			   struct sg_table *pages)
{}

static const struct drm_i915_gem_object_ops fake_ops =;

static struct drm_i915_gem_object *
fake_dma_object(struct drm_i915_private *i915, u64 size)
{}

static int igt_ppgtt_alloc(void *arg)
{}

static int lowlevel_hole(struct i915_address_space *vm,
			 u64 hole_start, u64 hole_end,
			 unsigned long end_time)
{}

static void close_object_list(struct list_head *objects,
			      struct i915_address_space *vm)
{}

static int fill_hole(struct i915_address_space *vm,
		     u64 hole_start, u64 hole_end,
		     unsigned long end_time)
{}

static int walk_hole(struct i915_address_space *vm,
		     u64 hole_start, u64 hole_end,
		     unsigned long end_time)
{}

static int pot_hole(struct i915_address_space *vm,
		    u64 hole_start, u64 hole_end,
		    unsigned long end_time)
{}

static int drunk_hole(struct i915_address_space *vm,
		      u64 hole_start, u64 hole_end,
		      unsigned long end_time)
{}

static int __shrink_hole(struct i915_address_space *vm,
			 u64 hole_start, u64 hole_end,
			 unsigned long end_time)
{}

static int shrink_hole(struct i915_address_space *vm,
		       u64 hole_start, u64 hole_end,
		       unsigned long end_time)
{}

static int shrink_boom(struct i915_address_space *vm,
		       u64 hole_start, u64 hole_end,
		       unsigned long end_time)
{}

static int misaligned_case(struct i915_address_space *vm, struct intel_memory_region *mr,
			   u64 addr, u64 size, unsigned long flags)
{}

static int misaligned_pin(struct i915_address_space *vm,
			  u64 hole_start, u64 hole_end,
			  unsigned long end_time)
{}

static int exercise_ppgtt(struct drm_i915_private *dev_priv,
			  int (*func)(struct i915_address_space *vm,
				      u64 hole_start, u64 hole_end,
				      unsigned long end_time))
{}

static int igt_ppgtt_fill(void *arg)
{}

static int igt_ppgtt_walk(void *arg)
{}

static int igt_ppgtt_pot(void *arg)
{}

static int igt_ppgtt_drunk(void *arg)
{}

static int igt_ppgtt_lowlevel(void *arg)
{}

static int igt_ppgtt_shrink(void *arg)
{}

static int igt_ppgtt_shrink_boom(void *arg)
{}

static int igt_ppgtt_misaligned_pin(void *arg)
{}

static int sort_holes(void *priv, const struct list_head *A,
		      const struct list_head *B)
{}

static int exercise_ggtt(struct drm_i915_private *i915,
			 int (*func)(struct i915_address_space *vm,
				     u64 hole_start, u64 hole_end,
				     unsigned long end_time))
{}

static int igt_ggtt_fill(void *arg)
{}

static int igt_ggtt_walk(void *arg)
{}

static int igt_ggtt_pot(void *arg)
{}

static int igt_ggtt_drunk(void *arg)
{}

static int igt_ggtt_lowlevel(void *arg)
{}

static int igt_ggtt_misaligned_pin(void *arg)
{}

static int igt_ggtt_page(void *arg)
{}

static void track_vma_bind(struct i915_vma *vma)
{}

static int exercise_mock(struct drm_i915_private *i915,
			 int (*func)(struct i915_address_space *vm,
				     u64 hole_start, u64 hole_end,
				     unsigned long end_time))
{}

static int igt_mock_fill(void *arg)
{}

static int igt_mock_walk(void *arg)
{}

static int igt_mock_pot(void *arg)
{}

static int igt_mock_drunk(void *arg)
{}

static int reserve_gtt_with_resource(struct i915_vma *vma, u64 offset)
{}

static int igt_gtt_reserve(void *arg)
{}

static int insert_gtt_with_resource(struct i915_vma *vma)
{}

static int igt_gtt_insert(void *arg)
{}

int i915_gem_gtt_mock_selftests(void)
{}

int i915_gem_gtt_live_selftests(struct drm_i915_private *i915)
{}