linux/drivers/gpu/drm/i915/selftests/i915_request.c

/*
 * Copyright © 2016 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 *
 */

#include <linux/prime_numbers.h>
#include <linux/pm_qos.h>
#include <linux/sort.h>

#include "gem/i915_gem_internal.h"
#include "gem/i915_gem_pm.h"
#include "gem/selftests/mock_context.h"

#include "gt/intel_engine_heartbeat.h"
#include "gt/intel_engine_pm.h"
#include "gt/intel_engine_user.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_clock_utils.h"
#include "gt/intel_gt_requests.h"
#include "gt/selftest_engine_heartbeat.h"

#include "i915_random.h"
#include "i915_selftest.h"
#include "igt_flush_test.h"
#include "igt_live_test.h"
#include "igt_spinner.h"
#include "lib_sw_fence.h"

#include "mock_drm.h"
#include "mock_gem_device.h"

static unsigned int num_uabi_engines(struct drm_i915_private *i915)
{}

static struct intel_engine_cs *rcs0(struct drm_i915_private *i915)
{}

static int igt_add_request(void *arg)
{}

static int igt_wait_request(void *arg)
{}

static int igt_fence_wait(void *arg)
{}

static int igt_request_rewind(void *arg)
{}

struct smoketest {};

static struct i915_request *
__mock_request_alloc(struct intel_context *ce)
{}

static struct i915_request *
__live_request_alloc(struct intel_context *ce)
{}

struct smoke_thread {};

static void __igt_breadcrumbs_smoketest(struct kthread_work *work)
{}

static int mock_breadcrumbs_smoketest(void *arg)
{}

int i915_request_mock_selftests(void)
{}

static int live_nop_request(void *arg)
{}

static int __cancel_inactive(struct intel_engine_cs *engine)
{}

static int __cancel_active(struct intel_engine_cs *engine)
{}

static int __cancel_completed(struct intel_engine_cs *engine)
{}

/*
 * Test to prove a non-preemptable request can be cancelled and a subsequent
 * request on the same context can successfully complete after cancellation.
 *
 * Testing methodology is to create a non-preemptible request and submit it,
 * wait for spinner to start, create a NOP request and submit it, cancel the
 * spinner, wait for spinner to complete and verify it failed with an error,
 * finally wait for NOP request to complete verify it succeeded without an
 * error. Preemption timeout also reduced / restored so test runs in a timely
 * maner.
 */
static int __cancel_reset(struct drm_i915_private *i915,
			  struct intel_engine_cs *engine)
{}

static int live_cancel_request(void *arg)
{}

static struct i915_vma *empty_batch(struct intel_gt *gt)
{}

static int emit_bb_start(struct i915_request *rq, struct i915_vma *batch)
{}

static struct i915_request *
empty_request(struct intel_engine_cs *engine,
	      struct i915_vma *batch)
{}

static int live_empty_request(void *arg)
{}

static struct i915_vma *recursive_batch(struct intel_gt *gt)
{}

static int recursive_batch_resolve(struct i915_vma *batch)
{}

static int live_all_engines(void *arg)
{}

static int live_sequential_engines(void *arg)
{}

struct parallel_thread {};

static void __live_parallel_engine1(struct kthread_work *work)
{}

static void __live_parallel_engineN(struct kthread_work *work)
{}

static bool wake_all(struct drm_i915_private *i915)
{}

static int wait_for_all(struct drm_i915_private *i915)
{}

static void __live_parallel_spin(struct kthread_work *work)
{}

static int live_parallel_engines(void *arg)
{}

static int
max_batches(struct i915_gem_context *ctx, struct intel_engine_cs *engine)
{}

static int live_breadcrumbs_smoketest(void *arg)
{}

int i915_request_live_selftests(struct drm_i915_private *i915)
{}

static int switch_to_kernel_sync(struct intel_context *ce, int err)
{}

struct perf_stats {};

struct perf_series {};

static int cmp_u32(const void *A, const void *B)
{}

static u32 trifilter(u32 *a)
{}

static u64 cycles_to_ns(struct intel_engine_cs *engine, u32 cycles)
{}

static u32 *emit_timestamp_store(u32 *cs, struct intel_context *ce, u32 offset)
{}

static u32 *emit_store_dw(u32 *cs, u32 offset, u32 value)
{}

static u32 *emit_semaphore_poll(u32 *cs, u32 mode, u32 value, u32 offset)
{}

static u32 *emit_semaphore_poll_until(u32 *cs, u32 offset, u32 value)
{}

static void semaphore_set(u32 *sema, u32 value)
{}

static u32 *hwsp_scratch(const struct intel_context *ce)
{}

static u32 hwsp_offset(const struct intel_context *ce, u32 *dw)
{}

static int measure_semaphore_response(struct intel_context *ce)
{}

static int measure_idle_dispatch(struct intel_context *ce)
{}

static int measure_busy_dispatch(struct intel_context *ce)
{}

static int plug(struct intel_engine_cs *engine, u32 *sema, u32 mode, int value)
{}

static int measure_inter_request(struct intel_context *ce)
{}

static int measure_context_switch(struct intel_context *ce)
{}

static int measure_preemption(struct intel_context *ce)
{}

struct signal_cb {};

static void signal_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
{}

static int measure_completion(struct intel_context *ce)
{}

static void rps_pin(struct intel_gt *gt)
{}

static void rps_unpin(struct intel_gt *gt)
{}

static int perf_request_latency(void *arg)
{}

static int s_sync0(void *arg)
{}

static int s_sync1(void *arg)
{}

static int s_many(void *arg)
{}

static int perf_series_engines(void *arg)
{}

struct p_thread {};

static void p_sync0(struct kthread_work *work)
{}

static void p_sync1(struct kthread_work *work)
{}

static void p_many(struct kthread_work *work)
{}

static int perf_parallel_engines(void *arg)
{}

int i915_request_perf_selftests(struct drm_i915_private *i915)
{}