linux/drivers/gpu/drm/i915/selftests/igt_live_test.h
Tvrtko Ursulin 0647ece381 drm/i915/selftests: Fix engine reset count storage for multi-tile
Engine->id namespace is per-tile so struct igt_live_test->reset_engine[]
needs to be two-dimensional so engine reset counts from all tiles can be
stored with no aliasing. With aliasing, if we had a real multi-tile
platform, the reset counts would be incorrect for same engine instance on
different tiles.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 0c29efa23f ("drm/i915/selftests: Consider multi-gt instead of to_gt()")
Reported-by: Alan Previn Teres Alexis <alan.previn.teres.alexis@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231201122109.729006-1-tvrtko.ursulin@linux.intel.com
2023-12-07 11:39:01 +00:00

37 lines
918 B
C

/*
* SPDX-License-Identifier: MIT
*
* Copyright © 2019 Intel Corporation
*/
#ifndef IGT_LIVE_TEST_H
#define IGT_LIVE_TEST_H
#include "gt/intel_gt_defines.h" /* for I915_MAX_GT */
#include "gt/intel_engine.h" /* for I915_NUM_ENGINES */
struct drm_i915_private;
struct igt_live_test {
struct drm_i915_private *i915;
const char *func;
const char *name;
unsigned int reset_global;
unsigned int reset_engine[I915_MAX_GT][I915_NUM_ENGINES];
};
/*
* Flush the GPU state before and after the test to ensure that no residual
* code is running on the GPU that may affect this test. Also compare the
* state before and after the test and alert if it unexpectedly changes,
* e.g. if the GPU was reset.
*/
int igt_live_test_begin(struct igt_live_test *t,
struct drm_i915_private *i915,
const char *func,
const char *name);
int igt_live_test_end(struct igt_live_test *t);
#endif /* IGT_LIVE_TEST_H */