From af0e1c583e4235028a750551b4637c79ff482b30 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Feb 2017 18:25:58 +0000 Subject: igt/gem_exec_scheduler: Fix test for context priorities Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99893 Signed-off-by: Chris Wilson --- tests/gem_exec_schedule.c | 18 ++++++++++++++---- 1 file 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, ¶m); + return __gem_context_set_param(fd, ¶m); +} + +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++) { -- cgit v1.2.3