summaryrefslogtreecommitdiff
path: root/lib/ioctl_wrappers.c
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@intel.com>2016-11-08 12:31:06 +0200
committerMika Kuoppala <mika.kuoppala@intel.com>2016-11-11 16:33:10 +0200
commit773ac7cc60357b91a5747217b926cca7ef71a5c1 (patch)
treefdb1a68a15b3fd816e70838a747c23bc92bcb545 /lib/ioctl_wrappers.c
parent1af5605a35a82932c13711675bfa5f034f7920fa (diff)
lib: substitute cxt BAN_PERIOD with BANNABLE
Context BAN_PERIOD will get depracated so subsitute it with BANNABLE property. Make ctx param test to accept both variants for now until kernel changes have landed, to not break BAT. v2: check against - EINVAL on get/set ban as it can return -EPERM v3: better naming for get/set (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r--lib/ioctl_wrappers.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 8b75b9d4..9d67a19c 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -962,9 +962,21 @@ void gem_context_require_param(int fd, uint64_t param)
igt_require(igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0);
}
-void gem_context_require_ban_period(int fd)
+void gem_context_require_bannable(int fd)
{
static int has_ban_period = -1;
+ static int has_bannable = -1;
+
+ if (has_bannable < 0) {
+ struct local_i915_gem_context_param p;
+
+ p.context = 0;
+ p.param = LOCAL_CONTEXT_PARAM_BANNABLE;
+ p.value = 0;
+ p.size = 0;
+
+ has_bannable = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0;
+ }
if (has_ban_period < 0) {
struct local_i915_gem_context_param p;
@@ -977,7 +989,7 @@ void gem_context_require_ban_period(int fd)
has_ban_period = igt_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0;
}
- igt_require(has_ban_period);
+ igt_require(has_ban_period || has_bannable);
}
int __gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t flags, uint32_t *handle)