diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-17 10:55:21 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-17 10:59:48 +0200 |
commit | 086c058a417317491320129d2cbeb68d1cfcfefe (patch) | |
tree | b206708018ddc58bed9179e44b77c899dc3dc81b /libdrm | |
parent | 0d1926d36e59ddfc34d8c9c0cdef10b71a49ecf1 (diff) |
Remove the op ioctl, and replace it with a setuser ioctl.
Remove need for lock for now.
May create races when we clean memory areas or on takedown.
Needs to be fixed.
Really do a validate on buffer creation in order to avoid problems with
fixed memory buffers.
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 65 |
1 files changed, 20 insertions, 45 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index b8f3b986..78cbb099 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -2695,62 +2695,37 @@ int drmBOUnmap(int fd, drmBO *buf) return 0; } -int drmBOValidate(int fd, drmBO *buf, uint32_t fence_class, - uint64_t flags, uint64_t mask, - unsigned hint) +int drmBOSetStatus(int fd, drmBO *buf, uint32_t fence_class, + uint64_t flags, uint64_t mask, + unsigned int hint, + unsigned int desired_tile_stride, + unsigned int tile_info) { - struct drm_bo_op_arg arg; - struct drm_bo_op_req *req = &arg.d.req; - struct drm_bo_arg_rep *rep = &arg.d.rep; + struct drm_bo_map_wait_idle_arg arg; + struct drm_bo_info_req *req = &arg.d.req; + struct drm_bo_info_rep *rep = &arg.d.rep; int ret = 0; memset(&arg, 0, sizeof(arg)); - req->bo_req.handle = buf->handle; - req->bo_req.flags = flags; - req->bo_req.mask = mask; - req->bo_req.hint = hint; - req->bo_req.fence_class = fence_class; - req->op = drm_bo_validate; - - do{ - ret = ioctl(fd, DRM_IOCTL_BO_OP, &arg); + req->mask = mask; + req->flags = flags; + req->handle = buf->handle; + req->hint = hint; + req->fence_class = fence_class; + req->desired_tile_stride = desired_tile_stride; + req->tile_info = tile_info; + + do { + ret = ioctl(fd, DRM_IOCTL_BO_SETSTATUS, &arg); } while (ret && errno == EAGAIN); if (ret) - return -errno; - if (!arg.handled) - return -EFAULT; - if (rep->ret) - return rep->ret; + return -errno; - drmBOCopyReply(&rep->bo_info, buf); - return 0; + drmBOCopyReply(rep, buf); } -int drmBOFence(int fd, drmBO *buf, unsigned flags, unsigned fenceHandle) -{ - struct drm_bo_op_arg arg; - struct drm_bo_op_req *req = &arg.d.req; - struct drm_bo_arg_rep *rep = &arg.d.rep; - int ret = 0; - - memset(&arg, 0, sizeof(arg)); - req->bo_req.handle = buf->handle; - req->bo_req.flags = flags; - req->arg_handle = fenceHandle; - req->op = drm_bo_fence; - - ret = ioctl(fd, DRM_IOCTL_BO_OP, &arg); - if (ret) - return -errno; - if (!arg.handled) - return -EFAULT; - if (rep->ret) - return rep->ret; - return 0; -} - int drmBOInfo(int fd, drmBO *buf) { struct drm_bo_reference_info_arg arg; |