Change-Id: I1e798d0fbb7e2023d6619f515a9cfaf029b62b6d Signed-off-by: Chunming Zhou <david1.zhou at amd.com> --- amdgpu/amdgpu.h | 21 +++++++++++++-------- amdgpu/amdgpu_cs.c | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index b5e4e3c6..583884e3 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -146,6 +146,11 @@ typedef struct amdgpu_semaphore *amdgpu_semaphore_handle; */ typedef uint32_t amdgpu_sem_handle; +/** + * Define handle for syncobj + */ +typedef uint32_t amdgpu_syncobj_handle; + /*--------------------------------------------------------------------------*/ /* -------------------------- Structures ---------------------------------- */ @@ -1735,7 +1740,7 @@ const char *amdgpu_get_marketing_name(amdgpu_device_handle dev); * */ int amdgpu_cs_create_syncobj(amdgpu_device_handle dev, - uint32_t *syncobj); + amdgpu_syncobj_handle *syncobj); /** * Destroy kernel sync object * @@ -1747,7 +1752,7 @@ int amdgpu_cs_create_syncobj(amdgpu_device_handle dev, * */ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev, - uint32_t syncobj); + amdgpu_syncobj_handle syncobj); /** * Wait for one or all sync objects to signal. @@ -1765,9 +1770,9 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev, * */ int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, - uint32_t *handles, unsigned num_handles, + amdgpu_syncobj_handle *handles, unsigned num_handles, int64_t timeout_nsec, unsigned flags, - uint32_t *first_signaled); + amdgpu_syncobj_handle *first_signaled); /** * Export kernel sync object to shareable fd. @@ -1781,7 +1786,7 @@ int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, * */ int amdgpu_cs_export_syncobj(amdgpu_device_handle dev, - uint32_t syncobj, + amdgpu_syncobj_handle syncobj, int *shared_fd); /** * Import kernel sync object from shareable fd. @@ -1796,7 +1801,7 @@ int amdgpu_cs_export_syncobj(amdgpu_device_handle dev, */ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev, int shared_fd, - uint32_t *syncobj); + amdgpu_syncobj_handle *syncobj); /** * Export kernel sync object to a sync_file. @@ -1810,7 +1815,7 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev, * */ int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev, - uint32_t syncobj, + amdgpu_syncobj_handle syncobj, int *sync_file_fd); /** @@ -1825,7 +1830,7 @@ int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev, * */ int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev, - uint32_t syncobj, + amdgpu_syncobj_handle syncobj, int sync_file_fd); /** diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 64ad9114..be7db19f 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -607,7 +607,7 @@ int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem) } int amdgpu_cs_create_syncobj(amdgpu_device_handle dev, - uint32_t *handle) + amdgpu_syncobj_handle *handle) { if (NULL == dev) return -EINVAL; @@ -616,7 +616,7 @@ int amdgpu_cs_create_syncobj(amdgpu_device_handle dev, } int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev, - uint32_t handle) + amdgpu_syncobj_handle handle) { if (NULL == dev) return -EINVAL; @@ -625,9 +625,9 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev, } int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, - uint32_t *handles, unsigned num_handles, + amdgpu_syncobj_handle *handles, unsigned num_handles, int64_t timeout_nsec, unsigned flags, - uint32_t *first_signaled) + amdgpu_syncobj_handle *first_signaled) { if (NULL == dev) return -EINVAL; @@ -637,7 +637,7 @@ int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, } int amdgpu_cs_export_syncobj(amdgpu_device_handle dev, - uint32_t handle, + amdgpu_syncobj_handle handle, int *shared_fd) { if (NULL == dev) @@ -648,7 +648,7 @@ int amdgpu_cs_export_syncobj(amdgpu_device_handle dev, int amdgpu_cs_import_syncobj(amdgpu_device_handle dev, int shared_fd, - uint32_t *handle) + amdgpu_syncobj_handle *handle) { if (NULL == dev) return -EINVAL; @@ -657,7 +657,7 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev, } int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev, - uint32_t syncobj, + amdgpu_syncobj_handle syncobj, int *sync_file_fd) { if (NULL == dev) @@ -667,7 +667,7 @@ int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev, } int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev, - uint32_t syncobj, + amdgpu_syncobj_handle syncobj, int sync_file_fd) { if (NULL == dev) -- 2.14.1