diff options
Diffstat (limited to 'lib/i915')
-rw-r--r-- | lib/i915/gem_submission.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c index 2a57e7ab..882d4f41 100644 --- a/lib/i915/gem_submission.c +++ b/lib/i915/gem_submission.c @@ -22,6 +22,9 @@ */ #include <stdbool.h> +#include <sys/ioctl.h> + +#include <i915_drm.h> #include "igt_core.h" #include "igt_sysfs.h" @@ -41,6 +44,18 @@ * semaphores for synchronization between engines. */ +static bool has_semaphores(int fd, int dir) +{ + int val = 0; + struct drm_i915_getparam gp = { + gp.param = I915_PARAM_HAS_SEMAPHORES, + gp.value = &val, + }; + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) < 0) + val = igt_sysfs_get_boolean(dir, "semaphores"); + return val; +} + /** * gem_submission_method: * @fd: open i915 drm file descriptor @@ -69,7 +84,7 @@ unsigned gem_submission_method(int fd) goto out; } - active = igt_sysfs_get_boolean(dir, "semaphores"); + active = has_semaphores(fd, dir); if (active) { flags |= GEM_SUBMISSION_SEMAPHORES; } |