diff mbox series

[3/5] drm: expand drm_syncobj_find_fence to support timeline point

Message ID 20180823082542.2998-3-david1.zhou@amd.com (mailing list archive)
State New, archived
Headers show
Series [1/5] drm: fix syncobj null_fence_enable_signaling | expand

Commit Message

Chunming Zhou Aug. 23, 2018, 8:25 a.m. UTC
we can fetch timeline point fence after expanded.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
 drivers/gpu/drm/drm_syncobj.c          | 6 ++++--
 drivers/gpu/drm/v3d/v3d_gem.c          | 4 ++--
 drivers/gpu/drm/vc4/vc4_gem.c          | 2 +-
 include/drm/drm_syncobj.h              | 2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)

Comments

Christian König Aug. 23, 2018, 9:03 a.m. UTC | #1
Am 23.08.2018 um 10:25 schrieb Chunming Zhou:
> we can fetch timeline point fence after expanded.
>
> Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
>   drivers/gpu/drm/drm_syncobj.c          | 6 ++++--
>   drivers/gpu/drm/v3d/v3d_gem.c          | 4 ++--
>   drivers/gpu/drm/vc4/vc4_gem.c          | 2 +-
>   include/drm/drm_syncobj.h              | 2 +-
>   5 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 7a625f3989a0..4d3f1a6ee078 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1062,7 +1062,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, &fence, 0);
>   	if (r)
>   		return r;
>   
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index d4b48fb410a1..3aac0b50a104 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -218,6 +218,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
>    * @file_private: drm file private pointer
>    * @handle: sync object handle to lookup.
>    * @fence: out parameter for the fence
> + * @point: timeline point
>    *
>    * This is just a convenience function that combines drm_syncobj_find() and
>    * drm_syncobj_fence_get().
> @@ -228,7 +229,8 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
>    */
>   int drm_syncobj_find_fence(struct drm_file *file_private,
>   			   u32 handle,
> -			   struct dma_fence **fence)
> +			   struct dma_fence **fence,
> +			   u64 point)
>   {
>   	struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle);
>   	int ret = 0;
> @@ -498,7 +500,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, &fence, 0);
>   	if (ret)
>   		goto err_put_fd;
>   
> diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
> index e1fcbb4cd0ae..f6dfb8140a62 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,
>   	kref_init(&exec->refcount);
>   
>   	ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
> -				     &exec->bin.in_fence);
> +				     &exec->bin.in_fence, 0);
>   	if (ret == -EINVAL)
>   		goto fail;
>   
>   	ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl,
> -				     &exec->render.in_fence);
> +				     &exec->render.in_fence, 0);
>   	if (ret == -EINVAL)
>   		goto fail;
>   
> diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
> index 7910b9acedd6..f7b4971342e8 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,
>   
>   	if (args->in_sync) {
>   		ret = drm_syncobj_find_fence(file_priv, args->in_sync,
> -					     &in_fence);
> +					     &in_fence, 0);
>   		if (ret)
>   			goto fail;
>   
> diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
> index e419c79ba94d..9962f7a1672c 100644
> --- a/include/drm/drm_syncobj.h
> +++ b/include/drm/drm_syncobj.h
> @@ -135,7 +135,7 @@ 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,
> -			   struct dma_fence **fence);
> +			   struct dma_fence **fence, u64 point);

The fence is the result of the function and should come last.

Christian.

>   void drm_syncobj_free(struct kref *kref);
>   int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
>   		       struct dma_fence *fence);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 7a625f3989a0..4d3f1a6ee078 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1062,7 +1062,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, &fence, 0);
 	if (r)
 		return r;
 
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index d4b48fb410a1..3aac0b50a104 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -218,6 +218,7 @@  static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
  * @file_private: drm file private pointer
  * @handle: sync object handle to lookup.
  * @fence: out parameter for the fence
+ * @point: timeline point
  *
  * This is just a convenience function that combines drm_syncobj_find() and
  * drm_syncobj_fence_get().
@@ -228,7 +229,8 @@  static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
  */
 int drm_syncobj_find_fence(struct drm_file *file_private,
 			   u32 handle,
-			   struct dma_fence **fence)
+			   struct dma_fence **fence,
+			   u64 point)
 {
 	struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle);
 	int ret = 0;
@@ -498,7 +500,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, &fence, 0);
 	if (ret)
 		goto err_put_fd;
 
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index e1fcbb4cd0ae..f6dfb8140a62 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,
 	kref_init(&exec->refcount);
 
 	ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
-				     &exec->bin.in_fence);
+				     &exec->bin.in_fence, 0);
 	if (ret == -EINVAL)
 		goto fail;
 
 	ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl,
-				     &exec->render.in_fence);
+				     &exec->render.in_fence, 0);
 	if (ret == -EINVAL)
 		goto fail;
 
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 7910b9acedd6..f7b4971342e8 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,
 
 	if (args->in_sync) {
 		ret = drm_syncobj_find_fence(file_priv, args->in_sync,
-					     &in_fence);
+					     &in_fence, 0);
 		if (ret)
 			goto fail;
 
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
index e419c79ba94d..9962f7a1672c 100644
--- a/include/drm/drm_syncobj.h
+++ b/include/drm/drm_syncobj.h
@@ -135,7 +135,7 @@  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,
-			   struct dma_fence **fence);
+			   struct dma_fence **fence, u64 point);
 void drm_syncobj_free(struct kref *kref);
 int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
 		       struct dma_fence *fence);