#include <linux/prime_numbers.h>
#include "gem/i915_gem_internal.h"
#include "gem/i915_gem_pm.h"
#include "gt/intel_engine_heartbeat.h"
#include "gt/intel_reset.h"
#include "gt/selftest_engine_heartbeat.h"
#include "i915_selftest.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 "gem/selftests/igt_gem_utils.h"
#include "gem/selftests/mock_context.h"
#define CS_GPR(engine, n) …
#define NUM_GPR …
#define NUM_GPR_DW …
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 wait_for_reset(struct intel_engine_cs *engine,
struct i915_request *rq,
unsigned long timeout)
{ … }
static int live_sanitycheck(void *arg)
{ … }
static int live_unlite_restore(struct intel_gt *gt, int prio)
{ … }
static int live_unlite_switch(void *arg)
{ … }
static int live_unlite_preempt(void *arg)
{ … }
static int live_unlite_ring(void *arg)
{ … }
static int live_pin_rewind(void *arg)
{ … }
static int engine_lock_reset_tasklet(struct intel_engine_cs *engine)
{ … }
static void engine_unlock_reset_tasklet(struct intel_engine_cs *engine)
{ … }
static int live_hold_reset(void *arg)
{ … }
static const char *error_repr(int err)
{ … }
static int live_error_interrupt(void *arg)
{ … }
static int
emit_semaphore_chain(struct i915_request *rq, struct i915_vma *vma, int idx)
{ … }
static struct i915_request *
semaphore_queue(struct intel_engine_cs *engine, struct i915_vma *vma, int idx)
{ … }
static int
release_queue(struct intel_engine_cs *engine,
struct i915_vma *vma,
int idx, int prio)
{ … }
static int
slice_semaphore_queue(struct intel_engine_cs *outer,
struct i915_vma *vma,
int count)
{ … }
static int live_timeslice_preempt(void *arg)
{ … }
static struct i915_request *
create_rewinder(struct intel_context *ce,
struct i915_request *wait,
void *slot, int idx)
{ … }
static int live_timeslice_rewind(void *arg)
{ … }
static struct i915_request *nop_request(struct intel_engine_cs *engine)
{ … }
static long slice_timeout(struct intel_engine_cs *engine)
{ … }
static int live_timeslice_queue(void *arg)
{ … }
static int live_timeslice_nopreempt(void *arg)
{ … }
static int live_busywait_preempt(void *arg)
{ … }
static struct i915_request *
spinner_create_request(struct igt_spinner *spin,
struct i915_gem_context *ctx,
struct intel_engine_cs *engine,
u32 arb)
{ … }
static int live_preempt(void *arg)
{ … }
static int live_late_preempt(void *arg)
{ … }
struct preempt_client { … };
static int preempt_client_init(struct intel_gt *gt, struct preempt_client *c)
{ … }
static void preempt_client_fini(struct preempt_client *c)
{ … }
static int live_nopreempt(void *arg)
{ … }
struct live_preempt_cancel { … };
static int __cancel_active0(struct live_preempt_cancel *arg)
{ … }
static int __cancel_active1(struct live_preempt_cancel *arg)
{ … }
static int __cancel_queued(struct live_preempt_cancel *arg)
{ … }
static int __cancel_hostile(struct live_preempt_cancel *arg)
{ … }
static void force_reset_timeout(struct intel_engine_cs *engine)
{ … }
static void cancel_reset_timeout(struct intel_engine_cs *engine)
{ … }
static int __cancel_fail(struct live_preempt_cancel *arg)
{ … }
static int live_preempt_cancel(void *arg)
{ … }
static int live_suppress_self_preempt(void *arg)
{ … }
static int live_chain_preempt(void *arg)
{ … }
static int create_gang(struct intel_engine_cs *engine,
struct i915_request **prev)
{ … }
static int __live_preempt_ring(struct intel_engine_cs *engine,
struct igt_spinner *spin,
int queue_sz, int ring_sz)
{ … }
static int live_preempt_ring(void *arg)
{ … }
static int live_preempt_gang(void *arg)
{ … }
static struct i915_vma *
create_gpr_user(struct intel_engine_cs *engine,
struct i915_vma *result,
unsigned int offset)
{ … }
static struct i915_vma *create_global(struct intel_gt *gt, size_t sz)
{ … }
static struct i915_request *
create_gpr_client(struct intel_engine_cs *engine,
struct i915_vma *global,
unsigned int offset)
{ … }
static int preempt_user(struct intel_engine_cs *engine,
struct i915_vma *global,
int id)
{ … }
static int live_preempt_user(void *arg)
{ … }
static int live_preempt_timeout(void *arg)
{ … }
static int random_range(struct rnd_state *rnd, int min, int max)
{ … }
static int random_priority(struct rnd_state *rnd)
{ … }
struct preempt_smoke { … };
static struct i915_gem_context *smoke_context(struct preempt_smoke *smoke)
{ … }
static int smoke_submit(struct preempt_smoke *smoke,
struct i915_gem_context *ctx, int prio,
struct drm_i915_gem_object *batch)
{ … }
static void smoke_crescendo_work(struct kthread_work *work)
{ … }
static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags)
#define BATCH BIT(0)
{ … }
static int smoke_random(struct preempt_smoke *smoke, unsigned int flags)
{ … }
static int live_preempt_smoke(void *arg)
{ … }
static int nop_virtual_engine(struct intel_gt *gt,
struct intel_engine_cs **siblings,
unsigned int nsibling,
unsigned int nctx,
unsigned int flags)
#define CHAIN BIT(0)
{ … }
static unsigned int
__select_siblings(struct intel_gt *gt,
unsigned int class,
struct intel_engine_cs **siblings,
bool (*filter)(const struct intel_engine_cs *))
{ … }
static unsigned int
select_siblings(struct intel_gt *gt,
unsigned int class,
struct intel_engine_cs **siblings)
{ … }
static int live_virtual_engine(void *arg)
{ … }
static int mask_virtual_engine(struct intel_gt *gt,
struct intel_engine_cs **siblings,
unsigned int nsibling)
{ … }
static int live_virtual_mask(void *arg)
{ … }
static int slicein_virtual_engine(struct intel_gt *gt,
struct intel_engine_cs **siblings,
unsigned int nsibling)
{ … }
static int sliceout_virtual_engine(struct intel_gt *gt,
struct intel_engine_cs **siblings,
unsigned int nsibling)
{ … }
static int live_virtual_slice(void *arg)
{ … }
static int preserved_virtual_engine(struct intel_gt *gt,
struct intel_engine_cs **siblings,
unsigned int nsibling)
{ … }
static int live_virtual_preserved(void *arg)
{ … }
static int reset_virtual_engine(struct intel_gt *gt,
struct intel_engine_cs **siblings,
unsigned int nsibling)
{ … }
static int live_virtual_reset(void *arg)
{ … }
int intel_execlists_live_selftests(struct drm_i915_private *i915)
{ … }