drm: add flags to drm_syncobj_find_fence
authorChunming Zhou <david1.zhou@amd.com>
Mon, 15 Oct 2018 08:55:47 +0000 (16:55 +0800)
committerChristian König <easy2remember.chk@googlemail.com>
Tue, 16 Oct 2018 12:50:16 +0000 (14:50 +0200)
flags can be used by driver to decide whether need to block wait submission.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
SIgned-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.kernel.org/patch/10641339/
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/drm_syncobj.c
drivers/gpu/drm/v3d/v3d_gem.c
drivers/gpu/drm/vc4/vc4_gem.c
include/drm/drm_syncobj.h

index 663043c8f0f5710244cb4bc787a8cd19fc076b50..8e9a65a1587576d25a421bb9842e0fd68583adc7 100644 (file)
@@ -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;
 
index 5bcb3ef9b2566ec8fb44d0deacdb55ddbf15dbbc..094513125153c28263557a41db3c7a878a6a7685 100644 (file)
@@ -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);
@@ -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;
 
index 2814c72cb09027389f40cb8959e86f69230ec772..e688369ca82b9fcaf3725ca45e3f125f38224fb2 100644 (file)
@@ -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;
 
index 5b22e996af6c5b6c1d335687902f74ef8ed43db6..251198194c38863b032256460e5ed554662c066c 100644 (file)
@@ -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;
 
index 425432b85a87a0ceef900430e81b42c232cfbd96..2eda44def63902fff30b455d619d5f49385650a0 100644 (file)
@@ -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,