Skip to content

Commit

Permalink
drm: add flags to drm_syncobj_find_fence
Browse files Browse the repository at this point in the history
flags can be used by driver to decide whether need to block wait submission.

Signed-off-by: Chunming Zhou <[email protected]>
SIgned-off-by: Christian König <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.kernel.org/patch/10641339/
  • Loading branch information
amingriyue authored and easy2rememberchk committed Oct 16, 2018
1 parent 7bd01a0 commit 649fdce
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ static int amdgpu_syncobj_lookup_and_add_to_sync(struct amdgpu_cs_parser *p,
{
int r;
struct dma_fence *fence;
r = drm_syncobj_find_fence(p->filp, handle, 0, &fence);
r = drm_syncobj_find_fence(p->filp, handle, 0, 0, &fence);
if (r)
return r;

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/drm_syncobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
* dma_fence_put().
*/
int drm_syncobj_find_fence(struct drm_file *file_private,
u32 handle, u64 point,
u32 handle, u64 point, u64 flags,
struct dma_fence **fence)
{
struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle);
Expand Down Expand Up @@ -495,7 +495,7 @@ static int drm_syncobj_export_sync_file(struct drm_file *file_private,
if (fd < 0)
return fd;

ret = drm_syncobj_find_fence(file_private, handle, 0, &fence);
ret = drm_syncobj_find_fence(file_private, handle, 0, 0, &fence);
if (ret)
goto err_put_fd;

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/v3d/v3d_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,12 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
kref_init(&exec->refcount);

ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
0, &exec->bin.in_fence);
0, 0, &exec->bin.in_fence);
if (ret == -EINVAL)
goto fail;

ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl,
0, &exec->render.in_fence);
0, 0, &exec->render.in_fence);
if (ret == -EINVAL)
goto fail;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vc4/vc4_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data,

if (args->in_sync) {
ret = drm_syncobj_find_fence(file_priv, args->in_sync,
0, &in_fence);
0, 0, &in_fence);
if (ret)
goto fail;

Expand Down
2 changes: 1 addition & 1 deletion include/drm/drm_syncobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point,
struct dma_fence *fence);
int drm_syncobj_find_fence(struct drm_file *file_private,
u32 handle, u64 point,
u32 handle, u64 point, u64 flags,
struct dma_fence **fence);
void drm_syncobj_free(struct kref *kref);
int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
Expand Down

0 comments on commit 649fdce

Please sign in to comment.