#include <linux/prime_numbers.h>
#include <linux/string_helpers.h>
#include "intel_context.h"
#include "intel_engine_heartbeat.h"
#include "intel_engine_pm.h"
#include "intel_engine_regs.h"
#include "intel_gpu_commands.h"
#include "intel_gt.h"
#include "intel_gt_requests.h"
#include "intel_ring.h"
#include "selftest_engine_heartbeat.h"
#include "../selftests/i915_random.h"
#include "../i915_selftest.h"
#include "selftests/igt_flush_test.h"
#include "selftests/lib_sw_fence.h"
#include "selftests/mock_gem_device.h"
#include "selftests/mock_timeline.h"
static struct page *hwsp_page(struct intel_timeline *tl)
{ … }
static unsigned long hwsp_cacheline(struct intel_timeline *tl)
{ … }
static int selftest_tl_pin(struct intel_timeline *tl)
{ … }
#define CACHELINES_PER_PAGE …
struct mock_hwsp_freelist { … };
enum { … };
static void __mock_hwsp_record(struct mock_hwsp_freelist *state,
unsigned int idx,
struct intel_timeline *tl)
{ … }
static int __mock_hwsp_timeline(struct mock_hwsp_freelist *state,
unsigned int count,
unsigned int flags)
{ … }
static int mock_hwsp_freelist(void *arg)
{ … }
struct __igt_sync { … };
static int __igt_sync(struct intel_timeline *tl,
u64 ctx,
const struct __igt_sync *p,
const char *name)
{ … }
static int igt_sync(void *arg)
{ … }
static unsigned int random_engine(struct rnd_state *rnd)
{ … }
static int bench_sync(void *arg)
{ … }
int intel_timeline_mock_selftests(void)
{ … }
static int emit_ggtt_store_dw(struct i915_request *rq, u32 addr, u32 value)
{ … }
static struct i915_request *
checked_tl_write(struct intel_timeline *tl, struct intel_engine_cs *engine, u32 value)
{ … }
static int live_hwsp_engine(void *arg)
{ … }
static int live_hwsp_alternate(void *arg)
{ … }
static int live_hwsp_wrap(void *arg)
{ … }
static int emit_read_hwsp(struct i915_request *rq,
u32 seqno, u32 hwsp,
u32 *addr)
{ … }
struct hwsp_watcher { … };
static bool cmp_lt(u32 a, u32 b)
{ … }
static bool cmp_gte(u32 a, u32 b)
{ … }
static int setup_watcher(struct hwsp_watcher *w, struct intel_gt *gt,
struct intel_timeline *tl)
{ … }
static void switch_tl_lock(struct i915_request *from, struct i915_request *to)
{ … }
static int create_watcher(struct hwsp_watcher *w,
struct intel_engine_cs *engine,
int ringsz)
{ … }
static int check_watcher(struct hwsp_watcher *w, const char *name,
bool (*op)(u32 hwsp, u32 seqno))
{ … }
static void cleanup_watcher(struct hwsp_watcher *w)
{ … }
static bool retire_requests(struct intel_timeline *tl)
{ … }
static struct i915_request *wrap_timeline(struct i915_request *rq)
{ … }
static int live_hwsp_read(void *arg)
{ … }
static int live_hwsp_rollover_kernel(void *arg)
{ … }
static int live_hwsp_rollover_user(void *arg)
{ … }
static int live_hwsp_recycle(void *arg)
{ … }
int intel_timeline_live_selftests(struct drm_i915_private *i915)
{ … }