diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-02 11:05:21 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-02 11:17:19 +0000 |
commit | 39858a1e752f8f26250171e8658388f0853c176c (patch) | |
tree | b38b348c71faecca5f4b68b30c3500bd29c9b0cd /lib/ioctl_wrappers.c | |
parent | 4de67b26788c60c19254c3e69e151ee200453895 (diff) |
lib: Mass conversion to to_user_pointer()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r-- | lib/ioctl_wrappers.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 9d67a19c..7b419ea6 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -338,7 +338,7 @@ static int __gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf gem_pwrite.handle = handle; gem_pwrite.offset = offset; gem_pwrite.size = length; - gem_pwrite.data_ptr = (uintptr_t)buf; + gem_pwrite.data_ptr = to_user_pointer(buf); err = 0; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite)) @@ -371,7 +371,7 @@ static int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint6 gem_pread.handle = handle; gem_pread.offset = offset; gem_pread.size = length; - gem_pread.data_ptr = (uintptr_t)buf; + gem_pread.data_ptr = to_user_pointer(buf); err = 0; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_PREAD, &gem_pread)) @@ -997,7 +997,7 @@ int __gem_userptr(int fd, void *ptr, int size, int read_only, uint32_t flags, ui struct local_i915_gem_userptr userptr; memset(&userptr, 0, sizeof(userptr)); - userptr.user_ptr = (uintptr_t)ptr; + userptr.user_ptr = to_user_pointer(ptr); userptr.user_size = size; userptr.flags = flags; if (read_only) @@ -1464,7 +1464,7 @@ bool gem_has_ring(int fd, unsigned ring) memset(&exec, 0, sizeof(exec)); memset(&execbuf, 0, sizeof(execbuf)); - execbuf.buffers_ptr = (uintptr_t)&exec; + execbuf.buffers_ptr = to_user_pointer(&exec); execbuf.buffer_count = 1; execbuf.flags = ring; return __gem_execbuf(fd, &execbuf) == -ENOENT; |