diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-06 16:13:56 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-06 16:58:34 +0000 |
commit | dd66ba8e5666a1ce7da0ddc226d074f591e1fa22 (patch) | |
tree | 3d73cc852276c074258d756bde4a75887b9b7ee1 | |
parent | 9051f43fa3c8d011921ac6ff75b763280f26d98f (diff) |
sna: Try to create userptr with the unsync'ed flag set first
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index e3da0320..26581ada 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -125,7 +125,8 @@ struct local_i915_gem_userptr { uint64_t user_ptr; uint32_t user_size; uint32_t flags; -#define I915_USERPTR_READ_ONLY 0x1 +#define I915_USERPTR_READ_ONLY (1<<0) +#define I915_USERPTR_UNSYNCHRONIZED (1<<31) uint32_t handle; }; @@ -230,14 +231,17 @@ static uint32_t gem_userptr(int fd, void *ptr, int size, int read_only) VG_CLEAR(arg); arg.user_ptr = (uintptr_t)ptr; arg.user_size = size; - arg.flags = 0; + arg.flags = I915_USERPTR_UNSYNCHRONIZED; if (read_only) arg.flags |= I915_USERPTR_READ_ONLY; if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg)) { - DBG(("%s: failed to map %p + %d bytes: %d\n", - __FUNCTION__, ptr, size, errno)); - return 0; + arg.flags &= ~I915_USERPTR_UNSYNCHRONIZED; + if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg)) { + DBG(("%s: failed to map %p + %d bytes: %d\n", + __FUNCTION__, ptr, size, errno)); + return 0; + } } return arg.handle; |