diff options
-rw-r--r-- | libdrm/xf86drm.c | 29 | ||||
-rw-r--r-- | libdrm/xf86mm.h | 9 | ||||
-rw-r--r-- | shared-core/drm.h | 4 |
3 files changed, 23 insertions, 19 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 0849f896..dc18d6f9 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -2345,7 +2345,7 @@ int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, void *data, * DRM_FENCE_MASK_DRIVER */ -int drmFenceCreate(int fd, unsigned flags, int class, unsigned type, +int drmFenceCreate(int fd, unsigned flags, int fence_class, unsigned type, drmFence *fence) { drm_fence_arg_t arg; @@ -2353,11 +2353,12 @@ int drmFenceCreate(int fd, unsigned flags, int class, unsigned type, memset(&arg, 0, sizeof(arg)); arg.flags = flags; arg.type = type; - arg.class = class; + arg.fence_class = fence_class; + if (ioctl(fd, DRM_IOCTL_FENCE_CREATE, &arg)) return -errno; fence->handle = arg.handle; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->flags = arg.flags; fence->signaled = 0; @@ -2370,19 +2371,21 @@ int drmFenceCreate(int fd, unsigned flags, int class, unsigned type, * DRM_FENCE_MASK_DRIVER */ -int drmFenceBuffers(int fd, unsigned flags, drmFence *fence) +int drmFenceBuffers(int fd, unsigned flags, uint32_t fence_class, drmFence *fence) { drm_fence_arg_t arg; memset(&arg, 0, sizeof(arg)); arg.flags = flags; + arg.fence_class = fence_class; if (ioctl(fd, DRM_IOCTL_FENCE_BUFFERS, &arg)) return -errno; fence->handle = arg.handle; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->flags = arg.flags; + fence->sequence = arg.sequence; fence->signaled = 0; return 0; } @@ -2409,7 +2412,7 @@ int drmFenceReference(int fd, unsigned handle, drmFence *fence) if (ioctl(fd, DRM_IOCTL_FENCE_REFERENCE, &arg)) return -errno; fence->handle = arg.handle; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->flags = arg.flags; fence->signaled = arg.signaled; @@ -2438,7 +2441,7 @@ int drmFenceFlush(int fd, drmFence *fence, unsigned flush_type) if (ioctl(fd, DRM_IOCTL_FENCE_FLUSH, &arg)) return -errno; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->signaled = arg.signaled; return 0; @@ -2453,7 +2456,7 @@ int drmFenceUpdate(int fd, drmFence *fence) if (ioctl(fd, DRM_IOCTL_FENCE_SIGNALED, &arg)) return -errno; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->signaled = arg.signaled; return 0; @@ -2486,14 +2489,14 @@ int drmFenceEmit(int fd, unsigned flags, drmFence *fence, unsigned emit_type) drm_fence_arg_t arg; memset(&arg, 0, sizeof(arg)); - arg.class = fence->class; + arg.fence_class = fence->fence_class; arg.flags = flags; arg.handle = fence->handle; arg.type = emit_type; if (ioctl(fd, DRM_IOCTL_FENCE_EMIT, &arg)) return -errno; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->signaled = arg.signaled; return 0; @@ -2532,7 +2535,7 @@ int drmFenceWait(int fd, unsigned flags, drmFence *fence, unsigned flush_type) if (ret) return -errno; - fence->class = arg.class; + fence->fence_class = arg.fence_class; fence->type = arg.type; fence->signaled = arg.signaled; return 0; @@ -2878,7 +2881,7 @@ int drmBOUnmap(int fd, drmBO *buf) return 0; } -int drmBOValidate(int fd, drmBO *buf, +int drmBOValidate(int fd, drmBO *buf, uint32_t fence_class, uint64_t flags, uint64_t mask, unsigned hint) { @@ -2892,7 +2895,7 @@ int drmBOValidate(int fd, drmBO *buf, req->bo_req.flags = flags; req->bo_req.mask = mask; req->bo_req.hint = hint; - req->bo_req.fence_class = 0; /* Backwards compatibility. */ + req->bo_req.fence_class = fence_class; req->op = drm_bo_validate; do{ diff --git a/libdrm/xf86mm.h b/libdrm/xf86mm.h index d86644ca..cacd13af 100644 --- a/libdrm/xf86mm.h +++ b/libdrm/xf86mm.h @@ -96,10 +96,11 @@ typedef struct _drmMMListHead typedef struct _drmFence { unsigned handle; - int class; + int fence_class; unsigned type; unsigned flags; unsigned signaled; + uint32_t sequence; unsigned pad[4]; /* for future expansion */ } drmFence; @@ -148,7 +149,7 @@ typedef struct _drmBOList { * Fence functions. */ -extern int drmFenceCreate(int fd, unsigned flags, int class, +extern int drmFenceCreate(int fd, unsigned flags, int fence_class, unsigned type, drmFence *fence); extern int drmFenceDestroy(int fd, const drmFence *fence); extern int drmFenceReference(int fd, unsigned handle, drmFence *fence); @@ -160,7 +161,7 @@ extern int drmFenceWait(int fd, unsigned flags, drmFence *fence, unsigned flush_type); extern int drmFenceEmit(int fd, unsigned flags, drmFence *fence, unsigned emit_type); -extern int drmFenceBuffers(int fd, unsigned flags, drmFence *fence); +extern int drmFenceBuffers(int fd, unsigned flags, uint32_t fence_class, drmFence *fence); /* @@ -188,7 +189,7 @@ extern int drmBOUnReference(int fd, drmBO *buf); extern int drmBOMap(int fd, drmBO *buf, unsigned mapFlags, unsigned mapHint, void **address); extern int drmBOUnmap(int fd, drmBO *buf); -extern int drmBOValidate(int fd, drmBO *buf, uint64_t flags, +extern int drmBOValidate(int fd, drmBO *buf, uint32_t fence_class, uint64_t flags, uint64_t mask, unsigned hint); extern int drmBOFence(int fd, drmBO *buf, unsigned flags, unsigned fenceHandle); diff --git a/shared-core/drm.h b/shared-core/drm.h index 30c7a1a3..b4754ead 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -647,11 +647,11 @@ struct drm_set_version { struct drm_fence_arg { unsigned int handle; - unsigned int class; + unsigned int fence_class; unsigned int type; unsigned int flags; unsigned int signaled; - unsigned int pad64; + unsigned int sequence; uint64_t expand_pad[3]; /*Future expansion */ }; |