diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-17 11:28:03 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-20 09:15:09 +0000 |
commit | dd61508a38b677dfffc66d5591257ee1e21a4597 (patch) | |
tree | 2f3f6c6225ef89c83c9f7ca851338d3ac8b0380b /lib/ioctl_wrappers.c | |
parent | aaafccbc7d2e8d463c2bffc6eeb8371401e3e60a (diff) |
lib: Remove overzealous assertion on gem_set_caching()
When the asserts were added for the acceptable error codes for
SET_CACHING ioctl, foresight was not given to the possibility that the
device may not handle the caching mode and return -ENODEV. Remove the
error code assertion from the library, that is the job for the ABI
tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r-- | lib/ioctl_wrappers.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 7b656cce..8748cfcf 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -208,10 +208,10 @@ static int __gem_set_caching(int fd, uint32_t handle, uint32_t caching) arg.caching = caching; err = 0; - if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_SET_CACHING, &arg)) { + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_SET_CACHING, &arg)) err = -errno; - igt_assert(errno == ENOTTY || errno == EINVAL); - } + + errno = 0; return err; } @@ -229,7 +229,6 @@ static int __gem_set_caching(int fd, uint32_t handle, uint32_t caching) void gem_set_caching(int fd, uint32_t handle, uint32_t caching) { igt_require(__gem_set_caching(fd, handle, caching) == 0); - errno = 0; } /** |