aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu
diff options
context:
space:
mode:
authorMarek Olšák2017-09-11 14:58:03 -0500
committerMarek Olšák2017-10-12 13:35:57 -0500
commit59aa57b363ba8de550aced1d397c54fd9e5e213c (patch)
treed644cee67ea1bc4c33e6a1bcf6d80b98588e45ce /amdgpu
parent2048a9e7278d64954080077fb29d603fbb611873 (diff)
downloadexternal-libdrm-59aa57b363ba8de550aced1d397c54fd9e5e213c.tar.gz
external-libdrm-59aa57b363ba8de550aced1d397c54fd9e5e213c.tar.xz
external-libdrm-59aa57b363ba8de550aced1d397c54fd9e5e213c.zip
amdgpu: add amdgpu_cs_syncobj_wait
v2: update amdgpu-symbol-check Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'amdgpu')
-rwxr-xr-xamdgpu/amdgpu-symbol-check1
-rw-r--r--amdgpu/amdgpu.h20
-rw-r--r--amdgpu/amdgpu_cs.c12
3 files changed, 33 insertions, 0 deletions
diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
index bc9ed3f9..7ecfc982 100755
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-symbol-check
@@ -42,6 +42,7 @@ amdgpu_cs_submit
42amdgpu_cs_submit_raw 42amdgpu_cs_submit_raw
43amdgpu_cs_syncobj_export_sync_file 43amdgpu_cs_syncobj_export_sync_file
44amdgpu_cs_syncobj_import_sync_file 44amdgpu_cs_syncobj_import_sync_file
45amdgpu_cs_syncobj_wait
45amdgpu_cs_wait_fences 46amdgpu_cs_wait_fences
46amdgpu_cs_wait_semaphore 47amdgpu_cs_wait_semaphore
47amdgpu_device_deinitialize 48amdgpu_device_deinitialize
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index b44b9b64..979acfc8 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1354,6 +1354,26 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev,
1354 uint32_t syncobj); 1354 uint32_t syncobj);
1355 1355
1356/** 1356/**
1357 * Wait for one or all sync objects to signal.
1358 *
1359 * \param dev - \c [in] self-explanatory
1360 * \param handles - \c [in] array of sync object handles
1361 * \param num_handles - \c [in] self-explanatory
1362 * \param timeout_nsec - \c [in] self-explanatory
1363 * \param flags - \c [in] a bitmask of DRM_SYNCOBJ_WAIT_FLAGS_*
1364 * \param first_signaled - \c [in] self-explanatory
1365 *
1366 * \return 0 on success\n
1367 * -ETIME - Timeout
1368 * <0 - Negative POSIX Error code
1369 *
1370 */
1371int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev,
1372 uint32_t *handles, unsigned num_handles,
1373 int64_t timeout_nsec, unsigned flags,
1374 uint32_t *first_signaled);
1375
1376/**
1357 * Export kernel sync object to shareable fd. 1377 * Export kernel sync object to shareable fd.
1358 * 1378 *
1359 * \param dev - \c [in] device handle 1379 * \param dev - \c [in] device handle
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 4a055366..2cde7bff 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -615,6 +615,18 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev,
615 return drmSyncobjDestroy(dev->fd, handle); 615 return drmSyncobjDestroy(dev->fd, handle);
616} 616}
617 617
618int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev,
619 uint32_t *handles, unsigned num_handles,
620 int64_t timeout_nsec, unsigned flags,
621 uint32_t *first_signaled)
622{
623 if (NULL == dev)
624 return -EINVAL;
625
626 return drmSyncobjWait(dev->fd, handles, num_handles, timeout_nsec,
627 flags, first_signaled);
628}
629
618int amdgpu_cs_export_syncobj(amdgpu_device_handle dev, 630int amdgpu_cs_export_syncobj(amdgpu_device_handle dev,
619 uint32_t handle, 631 uint32_t handle,
620 int *shared_fd) 632 int *shared_fd)