[PATCH] drm: Adding amdgpu_cs_create_syncobj2 to be able to create sync object as signaled initially

Mao, David David.Mao at amd.com
Thu Nov 23 12:18:19 UTC 2017


Signed-off-by: David Mao <david.mao at amd.com>
---
 amdgpu/amdgpu.h    | 15 +++++++++++++++
 amdgpu/amdgpu_cs.c | 10 ++++++++++
 2 files changed, 25 insertions(+)

diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 78fbd1e..47bdb3a 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1727,6 +1727,21 @@ const char *amdgpu_get_marketing_name(amdgpu_device_handle dev);
 /**
  *  Create kernel sync object
  *
+ * \param   dev         - \c [in]  device handle
+ * \param   flags       - \c [in]  flags that affect creation
+ * \param   syncobj     - \c [out] sync object handle
+ *
+ * \return   0 on success\n
+ *          <0 - Negative POSIX Error code
+ *
+*/
+int amdgpu_cs_create_syncobj2(amdgpu_device_handle dev,
+                             uint32_t  flags,
+                             uint32_t *syncobj);
+
+/**
+ *  Create kernel sync object
+ *
  * \param   dev              - \c [in]  device handle
  * \param   syncobj   - \c [out] sync object handle
  *
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 64ad911..76ce7fc 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -606,6 +606,16 @@ int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem)
        return amdgpu_cs_unreference_sem(sem);
 }

+int amdgpu_cs_create_syncobj2(amdgpu_device_handle dev,
+                               uint32_t  flags,
+                               uint32_t *handle)
+{
+       if (NULL == dev)
+               return -EINVAL;
+
+       return drmSyncobjCreate(dev->fd, flags, handle);
+}
+
 int amdgpu_cs_create_syncobj(amdgpu_device_handle dev,
                             uint32_t *handle)
 {
--
2.7.4


More information about the amd-gfx mailing list