diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-06 11:10:25 +0100 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-13 09:35:35 +0100 |
| commit | 8d21b39251615d3516522a9fe56f77e9bf9fdc62 (patch) | |
| tree | 4355634dada9b2082ba59b8d2b32950dec72ed1a /lib | |
| parent | 15801b4dadfef1e754d415414ad931be639c85bf (diff) | |
lib/ioctls: make gem_context_set/get_param infallible
We have separate require checks already, so these failing is a bug in
the test logic.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/igt_gt.c | 2 | ||||
| -rw-r--r-- | lib/ioctl_wrappers.c | 18 | ||||
| -rw-r--r-- | lib/ioctl_wrappers.h | 4 |
3 files changed, 8 insertions, 16 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 615f9893..e02219ac 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -55,7 +55,7 @@ struct igt_hang_ring igt_hang_ring(int fd, int gen, int ring) ban = param.value; param.value = 0; - igt_require(gem_context_set_param(fd, ¶m) == 0); + gem_context_set_param(fd, ¶m); memset(&reloc, 0, sizeof(reloc)); memset(&exec, 0, sizeof(exec)); diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index dd89e2c5..c8c0e1c1 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -1058,26 +1058,18 @@ off_t prime_get_size(int dma_buf_fd) return ret; } -int gem_context_get_param(int fd, struct local_i915_gem_context_param *p) +void gem_context_get_param(int fd, struct local_i915_gem_context_param *p) { #define LOCAL_I915_GEM_CONTEXT_GETPARAM 0x34 #define LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_GETPARAM, struct local_i915_gem_context_param) - if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, p)) - return -1; - - errno = 0; - return 0; + do_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, p); } -int gem_context_set_param(int fd, struct local_i915_gem_context_param *p) +void gem_context_set_param(int fd, struct local_i915_gem_context_param *p) { #define LOCAL_I915_GEM_CONTEXT_SETPARAM 0x35 #define LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CONTEXT_SETPARAM, struct local_i915_gem_context_param) - if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, p)) - return -1; - - errno = 0; - return 0; + do_ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, p); } void gem_context_require_param(int fd, uint64_t param) @@ -1089,5 +1081,5 @@ void gem_context_require_param(int fd, uint64_t param) p.value = 0; p.size = 0; - igt_require(gem_context_get_param(fd, &p) == 0); + igt_require(drmIoctl(fd, LOCAL_I915_GEM_CONTEXT_GETPARAM, &p) == 0); } diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index 663b3da2..23b8c9d5 100644 --- a/lib/ioctl_wrappers.h +++ b/lib/ioctl_wrappers.h @@ -132,7 +132,7 @@ struct local_i915_gem_context_param { }; void gem_context_require_param(int fd, uint64_t param); -int gem_context_get_param(int fd, struct local_i915_gem_context_param *p); -int gem_context_set_param(int fd, struct local_i915_gem_context_param *p); +void gem_context_get_param(int fd, struct local_i915_gem_context_param *p); +void gem_context_set_param(int fd, struct local_i915_gem_context_param *p); #endif /* IOCTL_WRAPPERS_H */ |
