diff options
author | David Mao <david.mao@amd.com> | 2017-11-28 11:22:26 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-11-29 22:05:25 -0500 |
commit | 1749d56ea00f350a74f662bdad82bcafa19889da (patch) | |
tree | b793ece13dc36ca90cb0bf16d1af8a17036c7aa1 | |
parent | aeab24aa9e074043965cf911f60a3736c4f6455d (diff) |
amdgpu: Adding amdgpu_cs_create_syncobj2 to create syncobj as signaled initially
Signed-off-by: David Mao <david.mao@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | amdgpu/amdgpu.h | 15 | ||||
-rw-r--r-- | amdgpu/amdgpu_cs.c | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index df85a24c..c95cb03c 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1344,6 +1344,21 @@ const char *amdgpu_get_marketing_name(amdgpu_device_handle dev); /** * Create kernel sync object * + * \param dev - \c [in] device handle + * \param flags - \c [in] flags that affect creation + * \param syncobj - \c [out] sync object handle + * + * \return 0 on success\n + * <0 - Negative POSIX Error code + * +*/ +int amdgpu_cs_create_syncobj2(amdgpu_device_handle dev, + uint32_t flags, + uint32_t *syncobj); + +/** + * Create kernel sync object + * * \param dev - \c [in] device handle * \param syncobj - \c [out] sync object handle * diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index b9fc01e7..9e157a84 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -606,6 +606,16 @@ int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem) return amdgpu_cs_unreference_sem(sem); } +int amdgpu_cs_create_syncobj2(amdgpu_device_handle dev, + uint32_t flags, + uint32_t *handle) +{ + if (NULL == dev) + return -EINVAL; + + return drmSyncobjCreate(dev->fd, flags, handle); +} + int amdgpu_cs_create_syncobj(amdgpu_device_handle dev, uint32_t *handle) { |