Commit 9a09a423 authored by Chunming Zhou's avatar Chunming Zhou Committed by Christian König

drm: expand replace_fence to support timeline point v2

we can place a fence to a timeline point after expanded.
v2: change func parameter order
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/246543/
parent 0a6730ea
...@@ -1191,7 +1191,7 @@ static void amdgpu_cs_post_dependencies(struct amdgpu_cs_parser *p) ...@@ -1191,7 +1191,7 @@ static void amdgpu_cs_post_dependencies(struct amdgpu_cs_parser *p)
int i; int i;
for (i = 0; i < p->num_post_dep_syncobjs; ++i) for (i = 0; i < p->num_post_dep_syncobjs; ++i)
drm_syncobj_replace_fence(p->post_dep_syncobjs[i], p->fence); drm_syncobj_replace_fence(p->post_dep_syncobjs[i], 0, p->fence);
} }
static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
......
...@@ -167,11 +167,13 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj, ...@@ -167,11 +167,13 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
/** /**
* drm_syncobj_replace_fence - replace fence in a sync object. * drm_syncobj_replace_fence - replace fence in a sync object.
* @syncobj: Sync object to replace fence in * @syncobj: Sync object to replace fence in
* @point: timeline point
* @fence: fence to install in sync file. * @fence: fence to install in sync file.
* *
* This replaces the fence on a sync object. * This replaces the fence on a sync object, or a timeline point fence.
*/ */
void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
u64 point,
struct dma_fence *fence) struct dma_fence *fence)
{ {
struct dma_fence *old_fence; struct dma_fence *old_fence;
...@@ -211,7 +213,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) ...@@ -211,7 +213,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
&fence->lock, 0, 0); &fence->lock, 0, 0);
dma_fence_signal(&fence->base); dma_fence_signal(&fence->base);
drm_syncobj_replace_fence(syncobj, &fence->base); drm_syncobj_replace_fence(syncobj, 0, &fence->base);
dma_fence_put(&fence->base); dma_fence_put(&fence->base);
...@@ -262,7 +264,7 @@ void drm_syncobj_free(struct kref *kref) ...@@ -262,7 +264,7 @@ void drm_syncobj_free(struct kref *kref)
struct drm_syncobj *syncobj = container_of(kref, struct drm_syncobj *syncobj = container_of(kref,
struct drm_syncobj, struct drm_syncobj,
refcount); refcount);
drm_syncobj_replace_fence(syncobj, NULL); drm_syncobj_replace_fence(syncobj, 0, NULL);
kfree(syncobj); kfree(syncobj);
} }
EXPORT_SYMBOL(drm_syncobj_free); EXPORT_SYMBOL(drm_syncobj_free);
...@@ -302,7 +304,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, ...@@ -302,7 +304,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
} }
if (fence) if (fence)
drm_syncobj_replace_fence(syncobj, fence); drm_syncobj_replace_fence(syncobj, 0, fence);
*out_syncobj = syncobj; *out_syncobj = syncobj;
return 0; return 0;
...@@ -487,7 +489,7 @@ static int drm_syncobj_import_sync_file_fence(struct drm_file *file_private, ...@@ -487,7 +489,7 @@ static int drm_syncobj_import_sync_file_fence(struct drm_file *file_private,
return -ENOENT; return -ENOENT;
} }
drm_syncobj_replace_fence(syncobj, fence); drm_syncobj_replace_fence(syncobj, 0, fence);
dma_fence_put(fence); dma_fence_put(fence);
drm_syncobj_put(syncobj); drm_syncobj_put(syncobj);
return 0; return 0;
...@@ -969,7 +971,7 @@ drm_syncobj_reset_ioctl(struct drm_device *dev, void *data, ...@@ -969,7 +971,7 @@ drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
return ret; return ret;
for (i = 0; i < args->count_handles; i++) for (i = 0; i < args->count_handles; i++)
drm_syncobj_replace_fence(syncobjs[i], NULL); drm_syncobj_replace_fence(syncobjs[i], 0, NULL);
drm_syncobj_array_free(syncobjs, args->count_handles); drm_syncobj_array_free(syncobjs, args->count_handles);
......
...@@ -2166,7 +2166,7 @@ signal_fence_array(struct i915_execbuffer *eb, ...@@ -2166,7 +2166,7 @@ signal_fence_array(struct i915_execbuffer *eb,
if (!(flags & I915_EXEC_FENCE_SIGNAL)) if (!(flags & I915_EXEC_FENCE_SIGNAL))
continue; continue;
drm_syncobj_replace_fence(syncobj, fence); drm_syncobj_replace_fence(syncobj, 0, fence);
} }
} }
......
...@@ -584,7 +584,7 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, ...@@ -584,7 +584,7 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
/* Update the return sync object for the */ /* Update the return sync object for the */
sync_out = drm_syncobj_find(file_priv, args->out_sync); sync_out = drm_syncobj_find(file_priv, args->out_sync);
if (sync_out) { if (sync_out) {
drm_syncobj_replace_fence(sync_out, drm_syncobj_replace_fence(sync_out, 0,
&exec->render.base.s_fence->finished); &exec->render.base.s_fence->finished);
drm_syncobj_put(sync_out); drm_syncobj_put(sync_out);
} }
......
...@@ -681,7 +681,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec, ...@@ -681,7 +681,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec,
exec->fence = &fence->base; exec->fence = &fence->base;
if (out_sync) if (out_sync)
drm_syncobj_replace_fence(out_sync, exec->fence); drm_syncobj_replace_fence(out_sync, 0, exec->fence);
vc4_update_bo_seqnos(exec, seqno); vc4_update_bo_seqnos(exec, seqno);
......
...@@ -131,7 +131,7 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj) ...@@ -131,7 +131,7 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj)
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);
void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point,
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, u64 point, u32 handle, u64 point,
......
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