public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/gem_exec_scheduler: HAS_SCHEDULER no longer means HAS_PREEMPTION
@ 2017-09-25 20:48 Chris Wilson
  2017-09-25 20:56 ` Chris Wilson
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Chris Wilson @ 2017-09-25 20:48 UTC (permalink / raw)
  To: intel-gfx

Michal wants to limit machines that can do preemption, which means that
we no longer can assume that if we have a scheduler for execbuf, that
implies we have preemption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_exec_schedule.c | 35 +++++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/tests/gem_exec_schedule.c b/tests/gem_exec_schedule.c
index 0b1925f1..377f8a88 100644
--- a/tests/gem_exec_schedule.c
+++ b/tests/gem_exec_schedule.c
@@ -33,6 +33,7 @@
 #include "igt_sysfs.h"
 
 #define LOCAL_PARAM_HAS_SCHEDULER 41
+#define LOCAL_PARAM_HAS_PREEMPTION 50
 #define LOCAL_CONTEXT_PARAM_PRIORITY 6
 
 #define LO 0
@@ -878,6 +879,18 @@ static bool has_scheduler(int fd)
 	return has > 0;
 }
 
+static bool has_preemption(int fd)
+{
+	drm_i915_getparam_t gp;
+	int has = -1;
+
+	gp.param = LOCAL_PARAM_HAS_PREEMPTION;
+	gp.value = &has;
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+
+	return has > 0;
+}
+
 #define HAVE_EXECLISTS 0x1
 #define HAVE_GUC 0x2
 static unsigned print_welcome(int fd)
@@ -969,17 +982,23 @@ igt_main
 				igt_subtest_f("promotion-%s", e->name)
 					promotion(fd, e->exec_id | e->flags);
 
-				igt_subtest_f("preempt-%s", e->name)
-					preempt(fd, e->exec_id | e->flags, 0);
+				igt_subtest_group {
+					igt_fixture {
+						igt_require(has_preemption(fd));
+					}
+
+					igt_subtest_f("preempt-%s", e->name)
+						preempt(fd, e->exec_id | e->flags, 0);
 
-				igt_subtest_f("preempt-contexts-%s", e->name)
-					preempt(fd, e->exec_id | e->flags, NEW_CTX);
+					igt_subtest_f("preempt-contexts-%s", e->name)
+						preempt(fd, e->exec_id | e->flags, NEW_CTX);
 
-				igt_subtest_f("preempt-other-%s", e->name)
-					preempt_other(fd, e->exec_id | e->flags);
+					igt_subtest_f("preempt-other-%s", e->name)
+						preempt_other(fd, e->exec_id | e->flags);
 
-				igt_subtest_f("preempt-self-%s", e->name)
-					preempt_self(fd, e->exec_id | e->flags);
+					igt_subtest_f("preempt-self-%s", e->name)
+						preempt_self(fd, e->exec_id | e->flags);
+				}
 
 				igt_subtest_f("deep-%s", e->name)
 					deep(fd, e->exec_id | e->flags);
-- 
2.14.1

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

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

end of thread, other threads:[~2017-09-28 16:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25 20:48 [PATCH igt] igt/gem_exec_scheduler: HAS_SCHEDULER no longer means HAS_PREEMPTION Chris Wilson
2017-09-25 20:56 ` Chris Wilson
2017-09-25 21:25 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-26  3:22 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-26  9:32 ` [PATCH igt] " Chris Wilson
2017-09-26  9:41   ` Chris Wilson
2017-09-26 12:14   ` Joonas Lahtinen
2017-09-26 12:21     ` Chris Wilson
2017-09-27 12:24     ` Chris Wilson
2017-09-26 18:32 ` ✓ Fi.CI.BAT: success for igt/gem_exec_scheduler: HAS_SCHEDULER no longer means HAS_PREEMPTION (rev2) Patchwork
2017-09-27  3:36 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-09-27 18:47 ` [PATCH igt v3] igt/gem_exec_scheduler: HAS_SCHEDULER no longer means HAS_PREEMPTION Chris Wilson
2017-09-28 14:33   ` Joonas Lahtinen
2017-09-27 19:38 ` ✓ Fi.CI.BAT: success for igt/gem_exec_scheduler: HAS_SCHEDULER no longer means HAS_PREEMPTION (rev3) Patchwork
2017-09-28  1:16 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-09-28 16:01 ` ✓ Fi.CI.IGT: success " Patchwork

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