#include <linux/prime_numbers.h>
#include "gem/i915_gem_internal.h"
#include "i915_selftest.h"
#include "intel_engine_heartbeat.h"
#include "intel_engine_pm.h"
#include "intel_reset.h"
#include "intel_ring.h"
#include "selftest_engine_heartbeat.h"
#include "selftests/i915_random.h"
#include "selftests/igt_flush_test.h"
#include "selftests/igt_live_test.h"
#include "selftests/igt_spinner.h"
#include "selftests/lib_sw_fence.h"
#include "shmem_utils.h"
#include "gem/selftests/igt_gem_utils.h"
#include "gem/selftests/mock_context.h"
#define CS_GPR(engine, n) …
#define NUM_GPR …
#define NUM_GPR_DW …
#define LRI_HEADER …
#define LRI_LENGTH_MASK …
static struct i915_vma *create_scratch(struct intel_gt *gt)
{ … }
static bool is_active(struct i915_request *rq)
{ … }
static int wait_for_submit(struct intel_engine_cs *engine,
struct i915_request *rq,
unsigned long timeout)
{ … }
static int emit_semaphore_signal(struct intel_context *ce, void *slot)
{ … }
static int context_flush(struct intel_context *ce, long timeout)
{ … }
static int get_lri_mask(struct intel_engine_cs *engine, u32 lri)
{ … }
static int live_lrc_layout(void *arg)
{ … }
static int find_offset(const u32 *lri, u32 offset)
{ … }
static int live_lrc_fixed(void *arg)
{ … }
static int __live_lrc_state(struct intel_engine_cs *engine,
struct i915_vma *scratch)
{ … }
static int live_lrc_state(void *arg)
{ … }
static int gpr_make_dirty(struct intel_context *ce)
{ … }
static struct i915_request *
__gpr_read(struct intel_context *ce, struct i915_vma *scratch, u32 *slot)
{ … }
static int __live_lrc_gpr(struct intel_engine_cs *engine,
struct i915_vma *scratch,
bool preempt)
{ … }
static int live_lrc_gpr(void *arg)
{ … }
static struct i915_request *
create_timestamp(struct intel_context *ce, void *slot, int idx)
{ … }
struct lrc_timestamp { … };
static bool timestamp_advanced(u32 start, u32 end)
{ … }
static int __lrc_timestamp(const struct lrc_timestamp *arg, bool preempt)
{ … }
static int live_lrc_timestamp(void *arg)
{ … }
static struct i915_vma *
create_user_vma(struct i915_address_space *vm, unsigned long size)
{ … }
static u32 safe_poison(u32 offset, u32 poison)
{ … }
static struct i915_vma *
store_context(struct intel_context *ce, struct i915_vma *scratch)
{ … }
static struct i915_request *
record_registers(struct intel_context *ce,
struct i915_vma *before,
struct i915_vma *after,
u32 *sema)
{ … }
static struct i915_vma *load_context(struct intel_context *ce, u32 poison)
{ … }
static int poison_registers(struct intel_context *ce, u32 poison, u32 *sema)
{ … }
static bool is_moving(u32 a, u32 b)
{ … }
static int compare_isolation(struct intel_engine_cs *engine,
struct i915_vma *ref[2],
struct i915_vma *result[2],
struct intel_context *ce,
u32 poison)
{ … }
static struct i915_vma *
create_result_vma(struct i915_address_space *vm, unsigned long sz)
{ … }
static int __lrc_isolation(struct intel_engine_cs *engine, u32 poison)
{ … }
static bool skip_isolation(const struct intel_engine_cs *engine)
{ … }
static int live_lrc_isolation(void *arg)
{ … }
static int wabb_ctx_submit_req(struct intel_context *ce)
{ … }
#define CTX_BB_CANARY_OFFSET …
#define CTX_BB_CANARY_INDEX …
static u32 *
emit_wabb_ctx_canary(const struct intel_context *ce,
u32 *cs, bool per_ctx)
{ … }
static u32 *
emit_indirect_ctx_bb_canary(const struct intel_context *ce, u32 *cs)
{ … }
static u32 *
emit_per_ctx_bb_canary(const struct intel_context *ce, u32 *cs)
{ … }
static void
wabb_ctx_setup(struct intel_context *ce, bool per_ctx)
{ … }
static bool check_ring_start(struct intel_context *ce, bool per_ctx)
{ … }
static int wabb_ctx_check(struct intel_context *ce, bool per_ctx)
{ … }
static int __lrc_wabb_ctx(struct intel_engine_cs *engine, bool per_ctx)
{ … }
static int lrc_wabb_ctx(void *arg, bool per_ctx)
{ … }
static int live_lrc_indirect_ctx_bb(void *arg)
{ … }
static int live_lrc_per_ctx_bb(void *arg)
{ … }
static void garbage_reset(struct intel_engine_cs *engine,
struct i915_request *rq)
{ … }
static struct i915_request *garbage(struct intel_context *ce,
struct rnd_state *prng)
{ … }
static int __lrc_garbage(struct intel_engine_cs *engine, struct rnd_state *prng)
{ … }
static int live_lrc_garbage(void *arg)
{ … }
static int __live_pphwsp_runtime(struct intel_engine_cs *engine)
{ … }
static int live_pphwsp_runtime(void *arg)
{ … }
int intel_lrc_live_selftests(struct drm_i915_private *i915)
{ … }