summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-06 10:49:20 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-13 09:35:35 +0100
commitc66b2425e706bec5ce6df8664d19b06e047eb0ee (patch)
tree5dd078f1c21b574ed38c0a86fbb41290b3698291
parent9ca2cc12b4a11c20b41479e94ac8837321c0a2b1 (diff)
lib/gt: api polish for igt_can_hang_ring
Align with common igt library style: - Push the igt_require into the function. - Push the intel_gen into the function. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r--lib/igt_gt.c12
-rw-r--r--lib/igt_gt.h2
-rw-r--r--tests/gem_concurrent_blit.c2
-rw-r--r--tests/gem_pread_after_blit.c2
-rw-r--r--tests/gem_reloc_vs_gpu.c8
5 files changed, 10 insertions, 16 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 526cbee0..c003a7ca 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -29,16 +29,12 @@
#include "igt_debugfs.h"
#include "ioctl_wrappers.h"
#include "intel_reg.h"
+#include "intel_chipset.h"
-int igt_can_hang_ring(int fd, int gen, int ring)
+void igt_require_hang_ring(int fd, int ring)
{
- if (!gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD))
- return 0;
-
- if (gen < 5) /* safe resets */
- return 0;
-
- return 1;
+ igt_require(gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD));
+ igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
}
struct igt_hang_ring igt_hang_ring(int fd, int gen, int ring)
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 19bbcef2..1ed78837 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -24,7 +24,7 @@
#ifndef IGT_GT_H
#define IGT_GT_H
-int igt_can_hang_ring(int fd, int gen, int ring);
+void igt_require_hang_ring(int fd, int ring);
struct igt_hang_ring {
unsigned handle;
diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c
index 72619801..245ad458 100644
--- a/tests/gem_concurrent_blit.c
+++ b/tests/gem_concurrent_blit.c
@@ -474,7 +474,7 @@ static struct igt_hang_ring rcs_hang(void)
static void hang_require(void)
{
- igt_require(igt_can_hang_ring(fd, gen, -1));
+ igt_require_hang_ring(fd, -1);
}
static void do_overwrite_source(const struct access_mode *mode,
diff --git a/tests/gem_pread_after_blit.c b/tests/gem_pread_after_blit.c
index c09c8dc4..6e4bd625 100644
--- a/tests/gem_pread_after_blit.c
+++ b/tests/gem_pread_after_blit.c
@@ -239,7 +239,7 @@ igt_main
igt_stop_signal_helper();
igt_subtest_f("%s-hang", t->name) {
- igt_require(igt_can_hang_ring(fd, batch->gen, -1));
+ igt_require_hang_ring(fd, -1);
do_test(fd, t->cache, src, start, dst, 1, bcs_hang);
}
}
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index bb8615b6..68bd17d3 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -263,9 +263,7 @@ static void do_forked_test(int fd, unsigned flags)
struct igt_helper_process thrasher = {};
if (flags & HANG)
- igt_require(igt_can_hang_ring(fd,
- intel_gen(devid),
- I915_EXEC_BLT));
+ igt_require_hang_ring(fd, I915_EXEC_BLT);
if (flags & (THRASH | THRASH_INACTIVE)) {
uint64_t val = (flags & THRASH_INACTIVE) ?
@@ -328,7 +326,7 @@ igt_main
do_test(fd, false, no_hang);
igt_subtest("interruptible-hang") {
- igt_require(igt_can_hang_ring(fd, intel_gen(devid), I915_EXEC_BLT));
+ igt_require_hang_ring(fd, I915_EXEC_BLT);
do_test(fd, false, bcs_hang);
}
@@ -336,7 +334,7 @@ igt_main
do_test(fd, true, no_hang);
igt_subtest("faulting-reloc-interruptible-hang") {
- igt_require(igt_can_hang_ring(fd, intel_gen(devid), I915_EXEC_BLT));
+ igt_require_hang_ring(fd, I915_EXEC_BLT);
do_test(fd, true, bcs_hang);
}
igt_stop_signal_helper();