[Intel-gfx] [PATCH i-g-t 3/3] tests/gem_reset_stats: Enforce full chip reset mode before run
Michel Thierry
michel.thierry at intel.com
Tue Jun 20 18:25:02 UTC 2017
Platforms with per-engine reset enabled (i915.reset=2) are unlikely to
perform a full chip reset, keeping the reset_count unmodified. In order
to keep the expectations of this test, enforce that full GPU reset is
enabled (i915.reset=1).
Later on, we can expand the reset_stats ioctl to also return the number
of per-engine resets and use reset_count + reset_engine_count when
checking for the updated reset count.
Signed-off-by: Michel Thierry <michel.thierry at intel.com>
---
tests/gem_reset_stats.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 73afeeb2..6777868f 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -27,6 +27,8 @@
#define _GNU_SOURCE
#include "igt.h"
+#include "igt_sysfs.h"
+#include <limits.h>
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@@ -777,15 +779,23 @@ igt_main
int fd;
bool has_reset_stats;
+ bool using_full_reset;
fd = drm_open_driver(DRIVER_INTEL);
devid = intel_get_drm_devid(fd);
has_reset_stats = gem_has_reset_stats(fd);
+ igt_assert(igt_sysfs_set_parameter
+ (fd, "reset", "%d", 1 /* only global reset */));
+
+ using_full_reset = (gem_gpu_reset_type(fd) == 1);
+
close(fd);
igt_require_f(has_reset_stats,
"No reset stats ioctl support. Too old kernel?\n");
+ igt_require_f(using_full_reset,
+ "Full GPU reset is not enabled. Is enable_hangcheck set?\n");
}
igt_subtest("params")
@@ -831,4 +841,13 @@ igt_main
igt_subtest_f("defer-hangcheck-%s", e->name)
RUN_TEST(defer_hangcheck(e));
}
+
+ igt_fixture {
+ int fd;
+
+ fd = drm_open_driver(DRIVER_INTEL);
+ igt_assert(igt_sysfs_set_parameter
+ (fd, "reset", "%d", INT_MAX /* any reset method */));
+ close(fd);
+ }
}
--
2.11.0
More information about the Intel-gfx
mailing list