[PATCH 1/2] drm/syncobj: Export drm_syncobj_destroy
Ian Forbes
ian.forbes at broadcom.com
Thu Jun 26 20:11:52 UTC 2025
In order for vmwgfx to use syncobj and maintain compatibility with our
existing userspace fencing IOCTLs we need to be able to call this function.
Signed-off-by: Ian Forbes <ian.forbes at broadcom.com>
---
drivers/gpu/drm/drm_syncobj.c | 13 +++++++++++--
include/drm/drm_syncobj.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index e1b0fa4000cd..dcb1dfa68138 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -633,8 +633,16 @@ static int drm_syncobj_create_as_handle(struct drm_file *file_private,
return ret;
}
-static int drm_syncobj_destroy(struct drm_file *file_private,
- u32 handle)
+/**
+ * drm_syncobj_destroy - remove a userspace handle from a syncobj
+ * @file_private: drm file private pointer
+ * @handle: the userspace handle to remove
+ *
+ * Removes the userspace syncobj handle @handle from the idr.
+ *
+ * Returns 0 on success or a negative error value on failure.
+ */
+int drm_syncobj_destroy(struct drm_file *file_private, u32 handle)
{
struct drm_syncobj *syncobj;
@@ -648,6 +656,7 @@ static int drm_syncobj_destroy(struct drm_file *file_private,
drm_syncobj_put(syncobj);
return 0;
}
+EXPORT_SYMBOL(drm_syncobj_destroy);
static int drm_syncobj_file_release(struct inode *inode, struct file *file)
{
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
index b40052132e52..9552f34a0f27 100644
--- a/include/drm/drm_syncobj.h
+++ b/include/drm/drm_syncobj.h
@@ -131,6 +131,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
struct dma_fence *fence);
int drm_syncobj_get_handle(struct drm_file *file_private,
struct drm_syncobj *syncobj, u32 *handle);
+int drm_syncobj_destroy(struct drm_file *file_private, u32 handle);
int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd);
#endif
--
2.50.0
More information about the dri-devel
mailing list