aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu
diff options
context:
space:
mode:
authorMarek Olšák2017-09-11 14:12:12 -0500
committerMarek Olšák2017-10-12 13:35:57 -0500
commitb6e24501a1f8c58501fdfa39b435e440ee667feb (patch)
tree64168fc12002df6f27107a514cc0e5f47d5b3ab4 /amdgpu
parentad4df736a9f8098cd47008c72948ceff9e9f9dac (diff)
downloadexternal-libdrm-b6e24501a1f8c58501fdfa39b435e440ee667feb.tar.gz
external-libdrm-b6e24501a1f8c58501fdfa39b435e440ee667feb.tar.xz
external-libdrm-b6e24501a1f8c58501fdfa39b435e440ee667feb.zip
amdgpu: add sync_file import and export functions
v2: update amdgpu-symbol-check Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'amdgpu')
-rwxr-xr-xamdgpu/amdgpu-symbol-check2
-rw-r--r--amdgpu/amdgpu.h30
-rw-r--r--amdgpu/amdgpu_cs.c20
3 files changed, 52 insertions, 0 deletions
diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
index c5b85b52..bc9ed3f9 100755
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-symbol-check
@@ -40,6 +40,8 @@ amdgpu_cs_query_reset_state
40amdgpu_cs_signal_semaphore 40amdgpu_cs_signal_semaphore
41amdgpu_cs_submit 41amdgpu_cs_submit
42amdgpu_cs_submit_raw 42amdgpu_cs_submit_raw
43amdgpu_cs_syncobj_export_sync_file
44amdgpu_cs_syncobj_import_sync_file
43amdgpu_cs_wait_fences 45amdgpu_cs_wait_fences
44amdgpu_cs_wait_semaphore 46amdgpu_cs_wait_semaphore
45amdgpu_device_deinitialize 47amdgpu_device_deinitialize
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 238b1aaa..b44b9b64 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1383,6 +1383,36 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev,
1383 uint32_t *syncobj); 1383 uint32_t *syncobj);
1384 1384
1385/** 1385/**
1386 * Export kernel sync object to a sync_file.
1387 *
1388 * \param dev - \c [in] device handle
1389 * \param syncobj - \c [in] sync object handle
1390 * \param sync_file_fd - \c [out] sync_file file descriptor.
1391 *
1392 * \return 0 on success\n
1393 * <0 - Negative POSIX Error code
1394 *
1395 */
1396int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev,
1397 uint32_t syncobj,
1398 int *sync_file_fd);
1399
1400/**
1401 * Import kernel sync object from a sync_file.
1402 *
1403 * \param dev - \c [in] device handle
1404 * \param syncobj - \c [in] sync object handle
1405 * \param sync_file_fd - \c [in] sync_file file descriptor.
1406 *
1407 * \return 0 on success\n
1408 * <0 - Negative POSIX Error code
1409 *
1410 */
1411int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev,
1412 uint32_t syncobj,
1413 int sync_file_fd);
1414
1415/**
1386 * Submit raw command submission to kernel 1416 * Submit raw command submission to kernel
1387 * 1417 *
1388 * \param dev - \c [in] device handle 1418 * \param dev - \c [in] device handle
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index dfba8754..4a055366 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -635,6 +635,26 @@ int amdgpu_cs_import_syncobj(amdgpu_device_handle dev,
635 return drmSyncobjFDToHandle(dev->fd, shared_fd, handle); 635 return drmSyncobjFDToHandle(dev->fd, shared_fd, handle);
636} 636}
637 637
638int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev,
639 uint32_t syncobj,
640 int *sync_file_fd)
641{
642 if (NULL == dev)
643 return -EINVAL;
644
645 return drmSyncobjExportSyncFile(dev->fd, syncobj, sync_file_fd);
646}
647
648int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev,
649 uint32_t syncobj,
650 int sync_file_fd)
651{
652 if (NULL == dev)
653 return -EINVAL;
654
655 return drmSyncobjImportSyncFile(dev->fd, syncobj, sync_file_fd);
656}
657
638int amdgpu_cs_submit_raw(amdgpu_device_handle dev, 658int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
639 amdgpu_context_handle context, 659 amdgpu_context_handle context,
640 amdgpu_bo_list_handle bo_list_handle, 660 amdgpu_bo_list_handle bo_list_handle,