summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-02-21 18:25:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-02-21 18:36:10 +0000
commitaf0e1c583e4235028a750551b4637c79ff482b30 (patch)
treedc206c8dda9f8d6e9c31c4127e8761ea3fbf6032
parent545aa339822306e93bf01069175f252cd4feb579 (diff)
igt/gem_exec_scheduler: Fix test for context priorities
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99893 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_exec_schedule.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/gem_exec_schedule.c b/tests/gem_exec_schedule.c
index d8454d58..b3f61fea 100644
--- a/tests/gem_exec_schedule.c
+++ b/tests/gem_exec_schedule.c
@@ -27,7 +27,7 @@
#include "igt_vgem.h"
#define LOCAL_PARAM_HAS_SCHEDULER 41
-#define LOCAL_CONTEXT_PARAM_PRIORITY 5
+#define LOCAL_CONTEXT_PARAM_PRIORITY 6
#define LO 0
#define HI 1
@@ -39,7 +39,7 @@
IGT_TEST_DESCRIPTION("Check that we can control the order of execution");
-static void ctx_set_priority(int fd, uint32_t ctx, int prio)
+static int __ctx_set_priority(int fd, uint32_t ctx, int prio)
{
struct local_i915_gem_context_param param;
@@ -49,7 +49,17 @@ static void ctx_set_priority(int fd, uint32_t ctx, int prio)
param.param = LOCAL_CONTEXT_PARAM_PRIORITY;
param.value = prio;
- gem_context_set_param(fd, &param);
+ return __gem_context_set_param(fd, &param);
+}
+
+static void ctx_set_priority(int fd, uint32_t ctx, int prio)
+{
+ igt_assert_eq(__ctx_set_priority(fd, ctx, prio), 0);
+}
+
+static void ctx_has_priority(int fd)
+{
+ igt_require(__ctx_set_priority(fd, 0, MAX_PRIO) == 0);
}
static void store_dword(int fd, uint32_t ctx, unsigned ring,
@@ -467,7 +477,7 @@ igt_main
igt_subtest_group {
igt_fixture {
igt_require(has_scheduler(fd));
- ctx_set_priority(fd, 0, MAX_PRIO);
+ ctx_has_priority(fd);
}
for (e = intel_execution_engines; e->name; e++) {