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

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2019 Intel Corporation
 */

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

#include <drm/drm_buddy.h>

#include "../i915_selftest.h"

#include "mock_drm.h"
#include "mock_gem_device.h"
#include "mock_region.h"

#include "gem/i915_gem_context.h"
#include "gem/i915_gem_lmem.h"
#include "gem/i915_gem_region.h"
#include "gem/i915_gem_ttm.h"
#include "gem/selftests/igt_gem_utils.h"
#include "gem/selftests/mock_context.h"
#include "gt/intel_engine_pm.h"
#include "gt/intel_engine_user.h"
#include "gt/intel_gt.h"
#include "gt/intel_migrate.h"
#include "i915_memcpy.h"
#include "i915_ttm_buddy_manager.h"
#include "selftests/igt_flush_test.h"
#include "selftests/i915_random.h"

static void close_objects(struct intel_memory_region *mem,
			  struct list_head *objects)
{}

static int igt_mock_fill(void *arg)
{}

static struct drm_i915_gem_object *
igt_object_create(struct intel_memory_region *mem,
		  struct list_head *objects,
		  u64 size,
		  unsigned int flags)
{}

static void igt_object_release(struct drm_i915_gem_object *obj)
{}

static bool is_contiguous(struct drm_i915_gem_object *obj)
{}

static int igt_mock_reserve(void *arg)
{}

static int igt_mock_contiguous(void *arg)
{}

static int igt_mock_splintered_region(void *arg)
{}

#ifndef SZ_8G
#define SZ_8G
#endif

static int igt_mock_max_segment(void *arg)
{}

static u64 igt_object_mappable_total(struct drm_i915_gem_object *obj)
{}

static int igt_mock_io_size(void *arg)
{}

static int igt_gpu_write_dw(struct intel_context *ce,
			    struct i915_vma *vma,
			    u32 dword,
			    u32 value)
{}

static int igt_cpu_check(struct drm_i915_gem_object *obj, u32 dword, u32 val)
{}

static int igt_gpu_write(struct i915_gem_context *ctx,
			 struct drm_i915_gem_object *obj)
{}

static int igt_lmem_create(void *arg)
{}

static int igt_lmem_create_with_ps(void *arg)
{}

static int igt_lmem_create_cleared_cpu(void *arg)
{}

static int igt_lmem_write_gpu(void *arg)
{}

static struct intel_engine_cs *
random_engine_class(struct drm_i915_private *i915,
		    unsigned int class,
		    struct rnd_state *prng)
{}

static int igt_lmem_write_cpu(void *arg)
{}

static const char *repr_type(u32 type)
{}

static struct drm_i915_gem_object *
create_region_for_mapping(struct intel_memory_region *mr, u64 size, u32 type,
			  void **out_addr)
{}

static int wrap_ktime_compare(const void *A, const void *B)
{}

static void igt_memcpy_long(void *dst, const void *src, size_t size)
{}

static inline void igt_memcpy(void *dst, const void *src, size_t size)
{}

static inline void igt_memcpy_from_wc(void *dst, const void *src, size_t size)
{}

static int _perf_memcpy(struct intel_memory_region *src_mr,
			struct intel_memory_region *dst_mr,
			u64 size, u32 src_type, u32 dst_type)
{}

static int perf_memcpy(void *arg)
{}

int intel_memory_region_mock_selftests(void)
{}

int intel_memory_region_live_selftests(struct drm_i915_private *i915)
{}

int intel_memory_region_perf_selftests(struct drm_i915_private *i915)
{}