summaryrefslogtreecommitdiff
path: root/tests/gem_exec_whisper.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2017-10-16 11:05:15 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-10-17 10:26:30 +0300
commit588555f779095a9d282f414aec22e5532891ecdc (patch)
treebfdf1caa268e1e9edda392942e122a6156f6a1ed /tests/gem_exec_whisper.c
parentf6dfe556659f5473e4bf13cc8d4770ac39c7d678 (diff)
lib/i915: Extract helpers for determining scheduler capabilities
Couple of tests are using either determining scheduler capabilities or pretty printing. Let's move those to helpers in lib. We can also keep the value obtained from getparam static. v2: Break the trend of expanding ioctl_wrappers Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/gem_exec_whisper.c')
-rw-r--r--tests/gem_exec_whisper.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c
index e7f7b1f1..5ff8f396 100644
--- a/tests/gem_exec_whisper.c
+++ b/tests/gem_exec_whisper.c
@@ -191,21 +191,8 @@ static void fini_hang(struct hang *h)
close(h->fd);
}
-#define LOCAL_PARAM_HAS_SCHEDULER 41
#define LOCAL_CONTEXT_PARAM_PRIORITY 6
-static bool __has_scheduler(int fd)
-{
- drm_i915_getparam_t gp;
- int has = -1;
-
- gp.param = LOCAL_PARAM_HAS_SCHEDULER;
- gp.value = &has;
- drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
-
- return has > 0;
-}
-
static int __ctx_set_priority(int fd, uint32_t ctx, int prio)
{
struct local_i915_gem_context_param param;
@@ -250,13 +237,8 @@ static void whisper(int fd, unsigned engine, unsigned flags)
int debugfs;
if (flags & PRIORITY) {
- int __fd = drm_open_driver(DRIVER_INTEL);
- bool has_scheduler = __has_scheduler(__fd);
- bool ctx_has_priority =
- __ctx_set_priority(__fd, 0, 1) == 0;
- close(__fd);
-
- igt_require(has_scheduler && ctx_has_priority);
+ igt_require(gem_scheduler_enabled(fd));
+ igt_require(gem_scheduler_has_ctx_priority(fd));
}
debugfs = igt_debugfs_dir(fd);