aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu
diff options
context:
space:
mode:
authorBas Nieuwenhuizen2017-12-16 17:27:10 -0600
committerDave Airlie2017-12-17 17:51:50 -0600
commit5889f6ba1a250777ff8b6ba96a35dba3f02071ff (patch)
tree4c93388d30e90c2f575165e34471b3f461e26012 /amdgpu
parent1abccedc4d18305e8c3e3dd00d3262c134ef1d44 (diff)
downloadexternal-libdrm-5889f6ba1a250777ff8b6ba96a35dba3f02071ff.tar.gz
external-libdrm-5889f6ba1a250777ff8b6ba96a35dba3f02071ff.tar.xz
external-libdrm-5889f6ba1a250777ff8b6ba96a35dba3f02071ff.zip
amdgpu: Add syncobj reset & signal wrappers.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'amdgpu')
-rwxr-xr-xamdgpu/amdgpu-symbol-check2
-rw-r--r--amdgpu/amdgpu.h28
-rw-r--r--amdgpu/amdgpu_cs.c18
3 files changed, 48 insertions, 0 deletions
diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
index 59db3cfe..3f298d13 100755
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-symbol-check
@@ -45,6 +45,8 @@ amdgpu_cs_submit
45amdgpu_cs_submit_raw 45amdgpu_cs_submit_raw
46amdgpu_cs_syncobj_export_sync_file 46amdgpu_cs_syncobj_export_sync_file
47amdgpu_cs_syncobj_import_sync_file 47amdgpu_cs_syncobj_import_sync_file
48amdgpu_cs_syncobj_reset
49amdgpu_cs_syncobj_signal
48amdgpu_cs_syncobj_wait 50amdgpu_cs_syncobj_wait
49amdgpu_cs_wait_fences 51amdgpu_cs_wait_fences
50amdgpu_cs_wait_semaphore 52amdgpu_cs_wait_semaphore
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index c95cb03c..2eb03bf1 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1382,6 +1382,34 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev,
1382 uint32_t syncobj); 1382 uint32_t syncobj);
1383 1383
1384/** 1384/**
1385 * Reset kernel sync objects to unsignalled state.
1386 *
1387 * \param dev - \c [in] device handle
1388 * \param syncobjs - \c [in] array of sync object handles
1389 * \param syncobj_count - \c [in] number of handles in syncobjs
1390 *
1391 * \return 0 on success\n
1392 * <0 - Negative POSIX Error code
1393 *
1394*/
1395int amdgpu_cs_syncobj_reset(amdgpu_device_handle dev,
1396 const uint32_t *syncobjs, uint32_t syncobj_count);
1397
1398/**
1399 * Signal kernel sync objects.
1400 *
1401 * \param dev - \c [in] device handle
1402 * \param syncobjs - \c [in] array of sync object handles
1403 * \param syncobj_count - \c [in] number of handles in syncobjs
1404 *
1405 * \return 0 on success\n
1406 * <0 - Negative POSIX Error code
1407 *
1408*/
1409int amdgpu_cs_syncobj_signal(amdgpu_device_handle dev,
1410 const uint32_t *syncobjs, uint32_t syncobj_count);
1411
1412/**
1385 * Wait for one or all sync objects to signal. 1413 * Wait for one or all sync objects to signal.
1386 * 1414 *
1387 * \param dev - \c [in] self-explanatory 1415 * \param dev - \c [in] self-explanatory
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 9e157a84..987daa40 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -634,6 +634,24 @@ int amdgpu_cs_destroy_syncobj(amdgpu_device_handle dev,
634 return drmSyncobjDestroy(dev->fd, handle); 634 return drmSyncobjDestroy(dev->fd, handle);
635} 635}
636 636
637int amdgpu_cs_syncobj_reset(amdgpu_device_handle dev,
638 const uint32_t *syncobjs, uint32_t syncobj_count)
639{
640 if (NULL == dev)
641 return -EINVAL;
642
643 return drmSyncobjReset(dev->fd, syncobjs, syncobj_count);
644}
645
646int amdgpu_cs_syncobj_signal(amdgpu_device_handle dev,
647 const uint32_t *syncobjs, uint32_t syncobj_count)
648{
649 if (NULL == dev)
650 return -EINVAL;
651
652 return drmSyncobjSignal(dev->fd, syncobjs, syncobj_count);
653}
654
637int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, 655int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev,
638 uint32_t *handles, unsigned num_handles, 656 uint32_t *handles, unsigned num_handles,
639 int64_t timeout_nsec, unsigned flags, 657 int64_t timeout_nsec, unsigned flags,