]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm: expand drm_syncobj_find_fence to support timeline point v2
authorChunming Zhou <david1.zhou@amd.com>
Thu, 30 Aug 2018 06:48:29 +0000 (14:48 +0800)
committerChristian König <easy2remember.chk@googlemail.com>
Thu, 6 Sep 2018 09:09:19 +0000 (11:09 +0200)
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: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/246541/
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 502b94fb116a7070af89ce51da182c3a936e48a0..5db7b1b460daca15c9f73f5ab8d9952b8bd61d5c 100644 (file)
@@ -1102,7 +1102,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, &fence);
+       r = drm_syncobj_find_fence(p->filp, handle, 0, &fence);
        if (r)
                return r;
 
index abbb22c97f7afa2c969a05f3d85543c24d8a31c0..e04b0f336af0c4691665eecb2d4dddd5d799219d 100644 (file)
@@ -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
  * @file_private: drm file private pointer
  * @handle: sync object handle to lookup.
+ * @point: timeline point
  * @fence: out parameter for the fence
  *
  * 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)
  * dma_fence_put().
  */
 int drm_syncobj_find_fence(struct drm_file *file_private,
-                          u32 handle,
+                          u32 handle, u64 point,
                           struct dma_fence **fence)
 {
        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,
        if (fd < 0)
                return fd;
 
-       ret = drm_syncobj_find_fence(file_private, handle, &fence);
+       ret = drm_syncobj_find_fence(file_private, handle, 0, &fence);
        if (ret)
                goto err_put_fd;
 
index 5ce24098a5fdaa363e69bdde24e98322b152e2c1..9b9ab34fb461b03da385fb78fda22f1be1b87b71 100644 (file)
@@ -521,12 +521,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,
-                                    &exec->bin.in_fence);
+                                    0, &exec->bin.in_fence);
        if (ret == -EINVAL)
                goto fail;
 
        ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl,
-                                    &exec->render.in_fence);
+                                    0, &exec->render.in_fence);
        if (ret == -EINVAL)
                goto fail;
 
index 7910b9acedd6023269a932091de59cd905c4b0f2..928718b467bd223e555596ff00e619755a854ae0 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,
-                                            &in_fence);
+                                            0, &in_fence);
                if (ret)
                        goto fail;
 
index e419c79ba94dc8525dc186ac71e9057ab0ca4929..ab9055f943c7fd33abcb7f7cbdea013447887008 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,
                               struct dma_fence *fence);
 int drm_syncobj_find_fence(struct drm_file *file_private,
-                          u32 handle,
+                          u32 handle, u64 point,
                           struct dma_fence **fence);
 void drm_syncobj_free(struct kref *kref);
 int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,