|
@@ -29,9 +29,9 @@
|
|
/**
|
|
/**
|
|
* DOC: Overview
|
|
* DOC: Overview
|
|
*
|
|
*
|
|
- * DRM synchronisation objects (syncobj) are a persistent objects,
|
|
|
|
- * that contain an optional fence. The fence can be updated with a new
|
|
|
|
- * fence, or be NULL.
|
|
|
|
|
|
+ * DRM synchronisation objects (syncobj, see struct &drm_syncobj) are
|
|
|
|
+ * persistent objects that contain an optional fence. The fence can be updated
|
|
|
|
+ * with a new fence, or be NULL.
|
|
*
|
|
*
|
|
* syncobj's can be waited upon, where it will wait for the underlying
|
|
* syncobj's can be waited upon, where it will wait for the underlying
|
|
* fence.
|
|
* fence.
|
|
@@ -61,7 +61,8 @@
|
|
* @file_private: drm file private pointer
|
|
* @file_private: drm file private pointer
|
|
* @handle: sync object handle to lookup.
|
|
* @handle: sync object handle to lookup.
|
|
*
|
|
*
|
|
- * Returns a reference to the syncobj pointed to by handle or NULL.
|
|
|
|
|
|
+ * Returns a reference to the syncobj pointed to by handle or NULL. The
|
|
|
|
+ * reference must be released by calling drm_syncobj_put().
|
|
*/
|
|
*/
|
|
struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
|
|
struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
|
|
u32 handle)
|
|
u32 handle)
|
|
@@ -229,6 +230,19 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * drm_syncobj_find_fence - lookup and reference the fence in a sync object
|
|
|
|
+ * @file_private: drm file private pointer
|
|
|
|
+ * @handle: sync object handle to lookup.
|
|
|
|
+ * @fence: out parameter for the fence
|
|
|
|
+ *
|
|
|
|
+ * This is just a convenience function that combines drm_syncobj_find() and
|
|
|
|
+ * drm_syncobj_fence_get().
|
|
|
|
+ *
|
|
|
|
+ * Returns 0 on success or a negative error value on failure. On success @fence
|
|
|
|
+ * contains a reference to the fence, which must be released by calling
|
|
|
|
+ * dma_fence_put().
|
|
|
|
+ */
|
|
int drm_syncobj_find_fence(struct drm_file *file_private,
|
|
int drm_syncobj_find_fence(struct drm_file *file_private,
|
|
u32 handle,
|
|
u32 handle,
|
|
struct dma_fence **fence)
|
|
struct dma_fence **fence)
|
|
@@ -269,6 +283,12 @@ EXPORT_SYMBOL(drm_syncobj_free);
|
|
* @out_syncobj: returned syncobj
|
|
* @out_syncobj: returned syncobj
|
|
* @flags: DRM_SYNCOBJ_* flags
|
|
* @flags: DRM_SYNCOBJ_* flags
|
|
* @fence: if non-NULL, the syncobj will represent this fence
|
|
* @fence: if non-NULL, the syncobj will represent this fence
|
|
|
|
+ *
|
|
|
|
+ * This is the first function to create a sync object. After creating, drivers
|
|
|
|
+ * probably want to make it available to userspace, either through
|
|
|
|
+ * drm_syncobj_get_handle() or drm_syncobj_get_fd().
|
|
|
|
+ *
|
|
|
|
+ * Returns 0 on success or a negative error value on failure.
|
|
*/
|
|
*/
|
|
int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
|
|
int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
|
|
struct dma_fence *fence)
|
|
struct dma_fence *fence)
|
|
@@ -302,6 +322,14 @@ EXPORT_SYMBOL(drm_syncobj_create);
|
|
|
|
|
|
/**
|
|
/**
|
|
* drm_syncobj_get_handle - get a handle from a syncobj
|
|
* drm_syncobj_get_handle - get a handle from a syncobj
|
|
|
|
+ * @file_private: drm file private pointer
|
|
|
|
+ * @syncobj: Sync object to export
|
|
|
|
+ * @handle: out parameter with the new handle
|
|
|
|
+ *
|
|
|
|
+ * Exports a sync object created with drm_syncobj_create() as a handle on
|
|
|
|
+ * @file_private to userspace.
|
|
|
|
+ *
|
|
|
|
+ * Returns 0 on success or a negative error value on failure.
|
|
*/
|
|
*/
|
|
int drm_syncobj_get_handle(struct drm_file *file_private,
|
|
int drm_syncobj_get_handle(struct drm_file *file_private,
|
|
struct drm_syncobj *syncobj, u32 *handle)
|
|
struct drm_syncobj *syncobj, u32 *handle)
|
|
@@ -388,6 +416,15 @@ static int drm_syncobj_alloc_file(struct drm_syncobj *syncobj)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * drm_syncobj_get_fd - get a file descriptor from a syncobj
|
|
|
|
+ * @syncobj: Sync object to export
|
|
|
|
+ * @p_fd: out parameter with the new file descriptor
|
|
|
|
+ *
|
|
|
|
+ * Exports a sync object created with drm_syncobj_create() as a file descriptor.
|
|
|
|
+ *
|
|
|
|
+ * Returns 0 on success or a negative error value on failure.
|
|
|
|
+ */
|
|
int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd)
|
|
int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|