Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 01/17] lib/gt: api polish for igt_can_hang_ring
@ 2015-02-10 18:05 Daniel Vetter
  2015-02-10 18:05 ` [PATCH i-g-t 02/17] lib/ioctl: api polish for gem_context_has_param Daniel Vetter
                   ` (16 more replies)
  0 siblings, 17 replies; 32+ messages in thread
From: Daniel Vetter @ 2015-02-10 18:05 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

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>
---
 lib/igt_gt.c                 | 12 ++++--------
 lib/igt_gt.h                 |  2 +-
 tests/gem_concurrent_blit.c  |  2 +-
 tests/gem_pread_after_blit.c |  2 +-
 tests/gem_reloc_vs_gpu.c     |  8 +++-----
 5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 526cbee03308..c003a7ca30f0 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 19bbcef2a91e..1ed78837cf5b 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 726198012c14..245ad4581783 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 c09c8dc49ee0..6e4bd6257feb 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 bb8615b6a593..68bd17d3ae5b 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();
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-02-11  8:48 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-10 18:05 [PATCH i-g-t 01/17] lib/gt: api polish for igt_can_hang_ring Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 02/17] lib/ioctl: api polish for gem_context_has_param Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 03/17] lib/ioctl: gem_ prefix for igt_require_mmap_wc Daniel Vetter
2015-02-10 21:58   ` Chris Wilson
2015-02-11  8:37     ` Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 04/17] igt/ioctls: doc for gem_mmap Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 05/17] lib/ioctls: make gem_context_set/get_param infallible Daniel Vetter
2015-02-10 21:54   ` Chris Wilson
2015-02-11  8:42     ` Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 06/17] lib/ioctl: Add gem_context_destroy helpers Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 07/17] tests/gem_ctx_*: Use helpers Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 08/17] tests/gem_reset_stat: Use new ctx helpers Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 09/17] lib/ioctl: Document ctx param functions Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 10/17] tests: Add gem_ctx_param_basic Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 11/17] tests: Add invalid pad tests for ctx create/destroy Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 12/17] tests/gem_ppgtt: Start rcs before bcs for context tests Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 13/17] tests: Align subtest with naming convention Daniel Vetter
2015-02-10 21:53   ` Chris Wilson
2015-02-11  8:44     ` Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 14/17] lib/igt_aux: s/swap/igt_swap/ Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 15/17] tests/gem_wait: Adjust makefile Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 16/17] doc: Consolidate naming conventions into docbook Daniel Vetter
2015-02-10 18:06 ` [PATCH i-g-t 17/17] lib/igt_gt: Document and consolidate Daniel Vetter
2015-02-10 21:36 ` [PATCH i-g-t 01/17] lib/gt: api polish for igt_can_hang_ring Chris Wilson
2015-02-10 21:56   ` Daniel Vetter
2015-02-10 21:59   ` [PATCH i-g-t] lib/chipset: Cache devid Daniel Vetter
2015-02-10 22:28     ` Chris Wilson
2015-02-10 22:37       ` Daniel Vetter
2015-02-10 22:39         ` Daniel Vetter
2015-02-10 22:45           ` Daniel Vetter
2015-02-10 22:50             ` Chris Wilson
2015-02-11  8:49               ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox