linux/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c

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

#include "gt/intel_migrate.h"
#include "gt/intel_gpu_commands.h"
#include "gem/i915_gem_ttm_move.h"

#include "i915_deps.h"

#include "selftests/igt_reset.h"
#include "selftests/igt_spinner.h"

static int igt_fill_check_buffer(struct drm_i915_gem_object *obj,
				 struct intel_gt *gt,
				 bool fill)
{}

static int igt_create_migrate(struct intel_gt *gt, enum intel_region_id src,
			      enum intel_region_id dst)
{}

static int igt_smem_create_migrate(void *arg)
{}

static int igt_lmem_create_migrate(void *arg)
{}

static int igt_same_create_migrate(void *arg)
{}

static int lmem_pages_migrate_one(struct i915_gem_ww_ctx *ww,
				  struct drm_i915_gem_object *obj,
				  struct i915_vma *vma,
				  bool silent_migrate)
{}

static int __igt_lmem_pages_migrate(struct intel_gt *gt,
				    struct i915_address_space *vm,
				    struct i915_deps *deps,
				    struct igt_spinner *spin,
				    struct dma_fence *spin_fence,
				    bool borked_migrate)
{}

static int igt_lmem_pages_failsafe_migrate(void *arg)
{}

/*
 * This subtest tests that unbinding at migration is indeed performed
 * async. We launch a spinner and a number of migrations depending on
 * that spinner to have terminated. Before each migration we bind a
 * vma, which should then be async unbound by the migration operation.
 * If we are able to schedule migrations without blocking while the
 * spinner is still running, those unbinds are indeed async and non-
 * blocking.
 *
 * Note that each async bind operation is awaiting the previous migration
 * due to the moving fence resulting from the migration.
 */
static int igt_async_migrate(struct intel_gt *gt)
{}

/*
 * Setting ASYNC_FAIL_ALLOC to 2 will simulate memory allocation failure while
 * arming the migration error check and block async migration. This
 * will cause us to deadlock and hangcheck will terminate the spinner
 * causing the test to fail.
 */
#define ASYNC_FAIL_ALLOC
static int igt_lmem_async_migrate(void *arg)
{}

int i915_gem_migrate_live_selftests(struct drm_i915_private *i915)
{}