amdgpu: typedef syncobj handle
PATCH 1/1 amdgpu: typedef syncobj handle
Change-Id I1e798d0fbb7e2023d6619f515a9cfaf029b62b6d
Signed-off-by Chunming Zhou <[email protected]>
--- amdgpu/amdgpu.h | 21 +++++++++++++-------- amdgpu/amdgpu_cs.c | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-)
amdgpu/amdgpu.h +13 -8
@@ -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);/**
amdgpu/amdgpu_cs.c +8 -8
@@ -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)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Am 23.01.2018 um 07:00 schrieb Chunming Zhou:
Quoted 2 lines
Change-Id I1e798d0fbb7e2023d6619f515a9cfaf029b62b6dSigned-off-by Chunming Zhou <[email protected]>
Not sure if that is a good idea cause the handle is actually not amdgpu specific but rather a general DRM handle, isn't it?
Christian.
Quoted 149 lines
--- amdgpu/amdgpu.h | 21 +++++++++++++-------- amdgpu/amdgpu_cs.c | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-)amdgpu/amdgpu.h +13
-8@@ -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);/** amdgpu/amdgpu_cs.c +7
-7@@ -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)
amdgpu/amdgpu_cs.c int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev, · line 673
Quoted 8 lines
amdgpu/amdgpu_cs.c +1
-1@@ -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)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx