linux/drivers/gpu/drm/i915/gt/selftest_hangcheck.c

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

#include <linux/kthread.h>

#include "gem/i915_gem_context.h"
#include "gem/i915_gem_internal.h"

#include "i915_gem_evict.h"
#include "intel_gt.h"
#include "intel_engine_heartbeat.h"
#include "intel_engine_pm.h"
#include "selftest_engine_heartbeat.h"

#include "i915_selftest.h"
#include "selftests/i915_random.h"
#include "selftests/igt_flush_test.h"
#include "selftests/igt_reset.h"
#include "selftests/igt_atomic.h"
#include "selftests/igt_spinner.h"
#include "selftests/intel_scheduler_helpers.h"

#include "selftests/mock_drm.h"

#include "gem/selftests/mock_context.h"
#include "gem/selftests/igt_gem_utils.h"

#define IGT_IDLE_TIMEOUT

struct hang {};

static int hang_init(struct hang *h, struct intel_gt *gt)
{}

static u64 hws_address(const struct i915_vma *hws,
		       const struct i915_request *rq)
{}

static struct i915_request *
hang_create_request(struct hang *h, struct intel_engine_cs *engine)
{}

static u32 hws_seqno(const struct hang *h, const struct i915_request *rq)
{}

static void hang_fini(struct hang *h)
{}

static bool wait_until_running(struct hang *h, struct i915_request *rq)
{}

static int igt_hang_sanitycheck(void *arg)
{}

static bool wait_for_idle(struct intel_engine_cs *engine)
{}

static int igt_reset_nop(void *arg)
{}

static int igt_reset_nop_engine(void *arg)
{}

static void force_reset_timeout(struct intel_engine_cs *engine)
{}

static void cancel_reset_timeout(struct intel_engine_cs *engine)
{}

static int igt_reset_fail_engine(void *arg)
{}

static int __igt_reset_engine(struct intel_gt *gt, bool active)
{}

static int igt_reset_idle_engine(void *arg)
{}

static int igt_reset_active_engine(void *arg)
{}

struct active_engine {};

#define TEST_ACTIVE
#define TEST_OTHERS
#define TEST_SELF
#define TEST_PRIORITY

static int active_request_put(struct i915_request *rq)
{}

static void active_engine(struct kthread_work *work)
{}

static int __igt_reset_engines(struct intel_gt *gt,
			       const char *test_name,
			       unsigned int flags)
{}

static int igt_reset_engines(void *arg)
{}

static u32 fake_hangcheck(struct intel_gt *gt, intel_engine_mask_t mask)
{}

static int igt_reset_wait(void *arg)
{}

struct evict_vma {};

static int evict_vma(void *data)
{}

static int evict_fence(void *data)
{}

static int __igt_reset_evict_vma(struct intel_gt *gt,
				 struct i915_address_space *vm,
				 int (*fn)(void *),
				 unsigned int flags)
{}

static int igt_reset_evict_ggtt(void *arg)
{}

static int igt_reset_evict_ppgtt(void *arg)
{}

static int igt_reset_evict_fence(void *arg)
{}

static int wait_for_others(struct intel_gt *gt,
			   struct intel_engine_cs *exclude)
{}

static int igt_reset_queue(void *arg)
{}

static int igt_handle_error(void *arg)
{}

static int __igt_atomic_reset_engine(struct intel_engine_cs *engine,
				     const struct igt_atomic_section *p,
				     const char *mode)
{}

static int igt_atomic_reset_engine(struct intel_engine_cs *engine,
				   const struct igt_atomic_section *p)
{}

static int igt_reset_engines_atomic(void *arg)
{}

int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
{}