[i-g-t,5/5] igt_hang_ctx: Add preemptible parameter
diff mbox

Message ID 20171207224823.30052-5-antonio.argenziano@intel.com
State New
Headers show

Commit Message

Antonio Argenziano Dec. 7, 2017, 10:48 p.m. UTC
This patch adds a parameter to make the hanging context conditionally
pre-emptible.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/igt_gt.c | 2 +-
 lib/igt_gt.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 614fd83b..a36e5506 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -296,7 +296,7 @@  igt_hang_t igt_hang_ctx(int fd, igt_hang_opt_t opts)
 	emit_recursive_batch(&spin, fd, (igt_spin_opt_t){
 			.ctx = opts.ctx,
 			.engine =  opts.ring,
-			.preemptible = false});
+			.preemptible = opts.preemptible});
 
 	if (opts.offset)
 		*opts.offset = spin.gtt_offset;
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 3f3e2d96..17fcee33 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -42,6 +42,7 @@  typedef struct igt_hang_opt {
 	int ring;
 	unsigned flags;
 	uint64_t *offset;
+	bool preemptible;
 } igt_hang_opt_t;
 
 igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags);