Add a buffer object waitIdle user-space function.
Fix some names and minor glitches.
drm_fence_arg_t arg;
int ret;
+ if (flush_type == 0) {
+ flush_type = fence->type;
+ }
+
if (!(fence->flags & DRM_FENCE_FLAG_SHAREABLE)) {
if ((flush_type & fence->signaled) == flush_type) {
return 0;
drmBOCopyReply(rep, buf);
return 0;
}
+
+int drmBOWaitIdle(int fd, drmBO *buf, unsigned hint)
+{
+ drm_bo_arg_t arg;
+ drm_bo_arg_request_t *req = &arg.d.req;
+ drm_bo_arg_reply_t *rep = &arg.d.rep;
+ int ret = 0;
+
+ if ((buf->flags & DRM_BO_FLAG_SHAREABLE) ||
+ (buf->replyFlags & DRM_BO_REP_BUSY)) {
+ arg.handled = 0;
+ req->handle = buf->handle;
+ req->op = drm_bo_wait_idle;
+ req->hint = hint;
+ arg.next = 0;
+
+ ret = ioctl(fd, DRM_IOCTL_BUFOBJ, &arg);
+
+ if (ret)
+ return ret;
+ if (!arg.handled)
+ return -EFAULT;
+ if (rep->ret)
+ return rep->ret;
+ drmBOCopyReply(rep, buf);
+ }
+ return 0;
+}
-int drmBufBusy(int fd, drmBO *buf, int *busy)
+int drmBOBusy(int fd, drmBO *buf, int *busy)
{
if (!(buf->flags & DRM_BO_FLAG_SHAREABLE) &&
!(buf->replyFlags & DRM_BO_REP_BUSY)) {
unsigned hint);
extern int drmBOFence(int fd, drmBO *buf, unsigned flags, unsigned fenceHandle);
extern int drmBOInfo(int fd, drmBO *buf);
-extern int drmBufBusy(int fd, drmBO *buf, int *busy);
+extern int drmBOBusy(int fd, drmBO *buf, int *busy);
extern int drmAddValidateItem(drmBOList *list, drmBO *buf, unsigned flags,
int *newItem);
extern int drmBOValidateList(int fd, drmBOList *list);
extern int drmBOFenceList(int fd, drmBOList *list, unsigned fenceHandle);
-
+extern int drmBOWaitIdle(int fd, drmBO *buf, unsigned hint);
/*
* Initialization functions.
unsigned long flags;
if (type & ~fence->type) {
- DRM_ERROR("Flush trying to extend fence type\n");
+ DRM_ERROR("Flush trying to extend fence type, "
+ "0x%x, 0x%x\n", type, fence->type);
return -EINVAL;
}
int signaled;
if (mask & ~fence->type) {
- DRM_ERROR("Wait trying to extend fence type\n");
+ DRM_ERROR("Wait trying to extend fence type"
+ " 0x%08x 0x%08x\n", mask, fence->type);
return -EINVAL;
}