Commit f7f0ca57 authored by Matthew Auld's avatar Matthew Auld
Browse files

drm/i915/selftests: use live_subtests for live_migrate



Probably a good idea to do an igt_flush_test() at the end of each
subtest, just to be sure the previous work has been flushed and doesn't
somehow interfere with the current subtest.

Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris.p.wilson@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221202122844.428006-2-matthew.auld@intel.com
parent 35168a6c
Loading
Loading
Loading
Loading
+21 −7
Original line number Diff line number Diff line
@@ -486,7 +486,8 @@ global_clear(struct intel_migrate *migrate, u32 sz, struct rnd_state *prng)

static int live_migrate_copy(void *arg)
{
	struct intel_migrate *migrate = arg;
	struct intel_gt *gt = arg;
	struct intel_migrate *migrate = &gt->migrate;
	struct drm_i915_private *i915 = migrate->context->engine->i915;
	I915_RND_STATE(prng);
	int i;
@@ -507,7 +508,8 @@ static int live_migrate_copy(void *arg)

static int live_migrate_clear(void *arg)
{
	struct intel_migrate *migrate = arg;
	struct intel_gt *gt = arg;
	struct intel_migrate *migrate = &gt->migrate;
	struct drm_i915_private *i915 = migrate->context->engine->i915;
	I915_RND_STATE(prng);
	int i;
@@ -593,7 +595,10 @@ static int __thread_migrate_copy(void *arg)

static int thread_migrate_copy(void *arg)
{
	return threaded_migrate(arg, __thread_migrate_copy, 0);
	struct intel_gt *gt = arg;
	struct intel_migrate *migrate = &gt->migrate;

	return threaded_migrate(migrate, __thread_migrate_copy, 0);
}

static int __thread_global_copy(void *arg)
@@ -605,7 +610,10 @@ static int __thread_global_copy(void *arg)

static int thread_global_copy(void *arg)
{
	return threaded_migrate(arg, __thread_global_copy, 0);
	struct intel_gt *gt = arg;
	struct intel_migrate *migrate = &gt->migrate;

	return threaded_migrate(migrate, __thread_global_copy, 0);
}

static int __thread_migrate_clear(void *arg)
@@ -624,12 +632,18 @@ static int __thread_global_clear(void *arg)

static int thread_migrate_clear(void *arg)
{
	return threaded_migrate(arg, __thread_migrate_clear, 0);
	struct intel_gt *gt = arg;
	struct intel_migrate *migrate = &gt->migrate;

	return threaded_migrate(migrate, __thread_migrate_clear, 0);
}

static int thread_global_clear(void *arg)
{
	return threaded_migrate(arg, __thread_global_clear, 0);
	struct intel_gt *gt = arg;
	struct intel_migrate *migrate = &gt->migrate;

	return threaded_migrate(migrate, __thread_global_clear, 0);
}

int intel_migrate_live_selftests(struct drm_i915_private *i915)
@@ -647,7 +661,7 @@ int intel_migrate_live_selftests(struct drm_i915_private *i915)
	if (!gt->migrate.context)
		return 0;

	return i915_subtests(tests, &gt->migrate);
	return intel_gt_live_subtests(tests, gt);
}

static struct drm_i915_gem_object *