aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2018-08-30 02:48:29 -0400
committerChristian König <easy2remember.chk@googlemail.com>2018-09-06 05:09:19 -0400
commit0a6730ea27b68c7ac4171c29a816c29d26a9637a (patch)
tree980c0f828eae86675dadbef42ef85c1633927b87 /drivers
parente28bd101ae1b0f3f653e160c0339c95da7e0fc1e (diff)
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: 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/
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c2
-rw-r--r--drivers/gpu/drm/drm_syncobj.c5
-rw-r--r--drivers/gpu/drm/v3d/v3d_gem.c4
-rw-r--r--drivers/gpu/drm/vc4/vc4_gem.c2
4 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 502b94fb116a..5db7b1b460da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1102,7 +1102,7 @@ static int amdgpu_syncobj_lookup_and_add_to_sync(struct amdgpu_cs_parser *p,
1102{ 1102{
1103 int r; 1103 int r;
1104 struct dma_fence *fence; 1104 struct dma_fence *fence;
1105 r = drm_syncobj_find_fence(p->filp, handle, &fence); 1105 r = drm_syncobj_find_fence(p->filp, handle, 0, &fence);
1106 if (r) 1106 if (r)
1107 return r; 1107 return r;
1108 1108
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index abbb22c97f7a..e04b0f336af0 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -222,6 +222,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
222 * drm_syncobj_find_fence - lookup and reference the fence in a sync object 222 * drm_syncobj_find_fence - lookup and reference the fence in a sync object
223 * @file_private: drm file private pointer 223 * @file_private: drm file private pointer
224 * @handle: sync object handle to lookup. 224 * @handle: sync object handle to lookup.
225 * @point: timeline point
225 * @fence: out parameter for the fence 226 * @fence: out parameter for the fence
226 * 227 *
227 * This is just a convenience function that combines drm_syncobj_find() and 228 * 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 * dma_fence_put(). 233 * dma_fence_put().
233 */ 234 */
234int drm_syncobj_find_fence(struct drm_file *file_private, 235int drm_syncobj_find_fence(struct drm_file *file_private,
235 u32 handle, 236 u32 handle, u64 point,
236 struct dma_fence **fence) 237 struct dma_fence **fence)
237{ 238{
238 struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); 239 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 if (fd < 0) 504 if (fd < 0)
504 return fd; 505 return fd;
505 506
506 ret = drm_syncobj_find_fence(file_private, handle, &fence); 507 ret = drm_syncobj_find_fence(file_private, handle, 0, &fence);
507 if (ret) 508 if (ret)
508 goto err_put_fd; 509 goto err_put_fd;
509 510
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 5ce24098a5fd..9b9ab34fb461 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -521,12 +521,12 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
521 kref_init(&exec->refcount); 521 kref_init(&exec->refcount);
522 522
523 ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl, 523 ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
524 &exec->bin.in_fence); 524 0, &exec->bin.in_fence);
525 if (ret == -EINVAL) 525 if (ret == -EINVAL)
526 goto fail; 526 goto fail;
527 527
528 ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl, 528 ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl,
529 &exec->render.in_fence); 529 0, &exec->render.in_fence);
530 if (ret == -EINVAL) 530 if (ret == -EINVAL)
531 goto fail; 531 goto fail;
532 532
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 7910b9acedd6..928718b467bd 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -1173,7 +1173,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
1173 1173
1174 if (args->in_sync) { 1174 if (args->in_sync) {
1175 ret = drm_syncobj_find_fence(file_priv, args->in_sync, 1175 ret = drm_syncobj_find_fence(file_priv, args->in_sync,
1176 &in_fence); 1176 0, &in_fence);
1177 if (ret) 1177 if (ret)
1178 goto fail; 1178 goto fail;
1179 1179