amdgpu: add sync_file import and export functions

v2: update amdgpu-symbol-check

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
main
Marek Olšák 2017-09-11 21:12:12 +02:00
parent ad4df736a9
commit b6e24501a1
3 changed files with 52 additions and 0 deletions

View File

@ -40,6 +40,8 @@ amdgpu_cs_query_reset_state
amdgpu_cs_signal_semaphore amdgpu_cs_signal_semaphore
amdgpu_cs_submit amdgpu_cs_submit
amdgpu_cs_submit_raw amdgpu_cs_submit_raw
amdgpu_cs_syncobj_export_sync_file
amdgpu_cs_syncobj_import_sync_file
amdgpu_cs_wait_fences amdgpu_cs_wait_fences
amdgpu_cs_wait_semaphore amdgpu_cs_wait_semaphore
amdgpu_device_deinitialize amdgpu_device_deinitialize

View File

@ -1382,6 +1382,36 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev,
int shared_fd, int shared_fd,
uint32_t *syncobj); uint32_t *syncobj);
/**
* Export kernel sync object to a sync_file.
*
* \param dev - \c [in] device handle
* \param syncobj - \c [in] sync object handle
* \param sync_file_fd - \c [out] sync_file file descriptor.
*
* \return 0 on success\n
* <0 - Negative POSIX Error code
*
*/
int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev,
uint32_t syncobj,
int *sync_file_fd);
/**
* Import kernel sync object from a sync_file.
*
* \param dev - \c [in] device handle
* \param syncobj - \c [in] sync object handle
* \param sync_file_fd - \c [in] sync_file file descriptor.
*
* \return 0 on success\n
* <0 - Negative POSIX Error code
*
*/
int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev,
uint32_t syncobj,
int sync_file_fd);
/** /**
* Submit raw command submission to kernel * Submit raw command submission to kernel
* *

View File

@ -635,6 +635,26 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev,
return drmSyncobjFDToHandle(dev->fd, shared_fd, handle); return drmSyncobjFDToHandle(dev->fd, shared_fd, handle);
} }
int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev,
uint32_t syncobj,
int *sync_file_fd)
{
if (NULL == dev)
return -EINVAL;
return drmSyncobjExportSyncFile(dev->fd, syncobj, sync_file_fd);
}
int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev,
uint32_t syncobj,
int sync_file_fd)
{
if (NULL == dev)
return -EINVAL;
return drmSyncobjImportSyncFile(dev->fd, syncobj, sync_file_fd);
}
int amdgpu_cs_submit_raw(amdgpu_device_handle dev, int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
amdgpu_context_handle context, amdgpu_context_handle context,
amdgpu_bo_list_handle bo_list_handle, amdgpu_bo_list_handle bo_list_handle,