More verbose error reporting in some cases.

Add a buffer object waitIdle user-space function.
Fix some names and minor glitches.
main
Thomas Hellstrom 2006-09-18 16:02:33 +02:00
parent f613022cee
commit c4fad4c961
3 changed files with 39 additions and 5 deletions

View File

@ -2407,6 +2407,10 @@ int drmFenceWait(int fd, unsigned flags, drmFence *fence, unsigned flush_type)
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;
@ -2964,8 +2968,36 @@ int drmBOInfo(int fd, drmBO *buf)
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)) {

View File

@ -202,7 +202,7 @@ extern int drmBOValidate(int fd, drmBO *buf, unsigned flags, unsigned mask,
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,
@ -210,7 +210,7 @@ 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.

View File

@ -207,7 +207,8 @@ int drm_fence_object_flush(drm_device_t * dev,
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;
}
@ -269,7 +270,8 @@ int drm_fence_object_wait(drm_device_t * dev, drm_fence_object_t * fence,
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;
}