#include <linux/prime_numbers.h>
#include <linux/string_helpers.h>
#include "gem/i915_gem_internal.h"
#include "gem/i915_gem_pm.h"
#include "gt/intel_engine_pm.h"
#include "gt/intel_engine_regs.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_requests.h"
#include "gt/intel_reset.h"
#include "i915_selftest.h"
#include "gem/selftests/igt_gem_utils.h"
#include "selftests/i915_random.h"
#include "selftests/igt_flush_test.h"
#include "selftests/igt_live_test.h"
#include "selftests/igt_reset.h"
#include "selftests/igt_spinner.h"
#include "selftests/mock_drm.h"
#include "selftests/mock_gem_device.h"
#include "huge_gem_object.h"
#include "igt_gem_utils.h"
#define DW_PER_PAGE …
static int live_nop_switch(void *arg)
{ … }
struct parallel_switch { … };
static void __live_parallel_switch1(struct kthread_work *work)
{ … }
static void __live_parallel_switchN(struct kthread_work *work)
{ … }
static int live_parallel_switch(void *arg)
{ … }
static unsigned long real_page_count(struct drm_i915_gem_object *obj)
{ … }
static unsigned long fake_page_count(struct drm_i915_gem_object *obj)
{ … }
static int gpu_fill(struct intel_context *ce,
struct drm_i915_gem_object *obj,
unsigned int dw)
{ … }
static int cpu_fill(struct drm_i915_gem_object *obj, u32 value)
{ … }
static noinline int cpu_check(struct drm_i915_gem_object *obj,
unsigned int idx, unsigned int max)
{ … }
static int file_add_object(struct file *file, struct drm_i915_gem_object *obj)
{ … }
static struct drm_i915_gem_object *
create_test_object(struct i915_address_space *vm,
struct file *file,
struct list_head *objects)
{ … }
static unsigned long max_dwords(struct drm_i915_gem_object *obj)
{ … }
static void throttle_release(struct i915_request **q, int count)
{ … }
static int throttle(struct intel_context *ce,
struct i915_request **q, int count)
{ … }
static int igt_ctx_exec(void *arg)
{ … }
static int igt_shared_ctx_exec(void *arg)
{ … }
static int rpcs_query_batch(struct drm_i915_gem_object *rpcs,
struct i915_vma *vma,
struct intel_engine_cs *engine)
{ … }
static int
emit_rpcs_query(struct drm_i915_gem_object *obj,
struct intel_context *ce,
struct i915_request **rq_out)
{ … }
#define TEST_IDLE …
#define TEST_BUSY …
#define TEST_RESET …
static int
__sseu_prepare(const char *name,
unsigned int flags,
struct intel_context *ce,
struct igt_spinner **spin)
{ … }
static int
__read_slice_count(struct intel_context *ce,
struct drm_i915_gem_object *obj,
struct igt_spinner *spin,
u32 *rpcs)
{ … }
static int
__check_rpcs(const char *name, u32 rpcs, int slices, unsigned int expected,
const char *prefix, const char *suffix)
{ … }
static int
__sseu_finish(const char *name,
unsigned int flags,
struct intel_context *ce,
struct drm_i915_gem_object *obj,
unsigned int expected,
struct igt_spinner *spin)
{ … }
static int
__sseu_test(const char *name,
unsigned int flags,
struct intel_context *ce,
struct drm_i915_gem_object *obj,
struct intel_sseu sseu)
{ … }
static int
__igt_ctx_sseu(struct drm_i915_private *i915,
const char *name,
unsigned int flags)
{ … }
static int igt_ctx_sseu(void *arg)
{ … }
static int igt_ctx_readonly(void *arg)
{ … }
static int check_scratch(struct i915_address_space *vm, u64 offset)
{ … }
static int write_to_scratch(struct i915_gem_context *ctx,
struct intel_engine_cs *engine,
struct drm_i915_gem_object *obj,
u64 offset, u32 value)
{ … }
static int read_from_scratch(struct i915_gem_context *ctx,
struct intel_engine_cs *engine,
struct drm_i915_gem_object *obj,
u64 offset, u32 *value)
{ … }
static int check_scratch_page(struct i915_gem_context *ctx, u32 *out)
{ … }
static int igt_vm_isolation(void *arg)
{ … }
int i915_gem_context_live_selftests(struct drm_i915_private *i915)
{ … }