drm: add drmSyncobjWait wrapper

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
main
Marek Olšák 2017-09-11 21:57:32 +02:00
parent b6e24501a1
commit 2048a9e727
2 changed files with 25 additions and 0 deletions

View File

@ -4225,3 +4225,25 @@ int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd)
*sync_file_fd = args.fd;
return 0;
}
int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles,
int64_t timeout_nsec, unsigned flags,
uint32_t *first_signaled)
{
struct drm_syncobj_wait args;
int ret;
memclear(args);
args.handles = (intptr_t)handles;
args.timeout_nsec = timeout_nsec;
args.count_handles = num_handles;
args.flags = flags;
ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_WAIT, &args);
if (ret < 0)
return ret;
if (first_signaled)
*first_signaled = args.first_signaled;
return ret;
}

View File

@ -860,6 +860,9 @@ extern int drmSyncobjFDToHandle(int fd, int obj_fd, uint32_t *handle);
extern int drmSyncobjImportSyncFile(int fd, uint32_t handle, int sync_file_fd);
extern int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd);
extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles,
int64_t timeout_nsec, unsigned flags,
uint32_t *first_signaled);
#if defined(__cplusplus)
}