Commit 0a6730ea authored by Chunming Zhou's avatar Chunming Zhou Committed by Christian König

drm: expand drm_syncobj_find_fence to support timeline point v2

we can fetch timeline point fence after expanded.
v2: The parameter fence is the result of the function and should come last.
Signed-off-by: default avatarChunming Zhou <david1.zhou@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/246541/
parent e28bd101
...@@ -1102,7 +1102,7 @@ static int amdgpu_syncobj_lookup_and_add_to_sync(struct amdgpu_cs_parser *p, ...@@ -1102,7 +1102,7 @@ static int amdgpu_syncobj_lookup_and_add_to_sync(struct amdgpu_cs_parser *p,
{ {
int r; int r;
struct dma_fence *fence; struct dma_fence *fence;
r = drm_syncobj_find_fence(p->filp, handle, &fence); r = drm_syncobj_find_fence(p->filp, handle, 0, &fence);
if (r) if (r)
return r; return r;
......
...@@ -222,6 +222,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) ...@@ -222,6 +222,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
* drm_syncobj_find_fence - lookup and reference the fence in a sync object * drm_syncobj_find_fence - lookup and reference the fence in a sync object
* @file_private: drm file private pointer * @file_private: drm file private pointer
* @handle: sync object handle to lookup. * @handle: sync object handle to lookup.
* @point: timeline point
* @fence: out parameter for the fence * @fence: out parameter for the fence
* *
* This is just a convenience function that combines drm_syncobj_find() and * This is just a convenience function that combines drm_syncobj_find() and
...@@ -232,7 +233,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) ...@@ -232,7 +233,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
* dma_fence_put(). * 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, u64 point,
struct dma_fence **fence) struct dma_fence **fence)
{ {
struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle);
...@@ -503,7 +504,7 @@ static int drm_syncobj_export_sync_file(struct drm_file *file_private, ...@@ -503,7 +504,7 @@ static int drm_syncobj_export_sync_file(struct drm_file *file_private,
if (fd < 0) if (fd < 0)
return fd; return fd;
ret = drm_syncobj_find_fence(file_private, handle, &fence); ret = drm_syncobj_find_fence(file_private, handle, 0, &fence);
if (ret) if (ret)
goto err_put_fd; goto err_put_fd;
......
...@@ -521,12 +521,12 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, ...@@ -521,12 +521,12 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
kref_init(&exec->refcount); kref_init(&exec->refcount);
ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl, ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
&exec->bin.in_fence); 0, &exec->bin.in_fence);
if (ret == -EINVAL) if (ret == -EINVAL)
goto fail; goto fail;
ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl, ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl,
&exec->render.in_fence); 0, &exec->render.in_fence);
if (ret == -EINVAL) if (ret == -EINVAL)
goto fail; goto fail;
......
...@@ -1173,7 +1173,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data, ...@@ -1173,7 +1173,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
if (args->in_sync) { if (args->in_sync) {
ret = drm_syncobj_find_fence(file_priv, args->in_sync, ret = drm_syncobj_find_fence(file_priv, args->in_sync,
&in_fence); 0, &in_fence);
if (ret) if (ret)
goto fail; goto fail;
......
...@@ -134,7 +134,7 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, ...@@ -134,7 +134,7 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
struct dma_fence *fence); struct dma_fence *fence);
int drm_syncobj_find_fence(struct drm_file *file_private, int drm_syncobj_find_fence(struct drm_file *file_private,
u32 handle, u32 handle, u64 point,
struct dma_fence **fence); struct dma_fence **fence);
void drm_syncobj_free(struct kref *kref); void drm_syncobj_free(struct kref *kref);
int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment