dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chunming Zhou <david1.zhou@amd.com>
To: dri-devel@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Subject: [PATCH 3/5] drm: expand drm_syncobj_find_fence to support timeline point
Date: Thu, 23 Aug 2018 16:25:40 +0800	[thread overview]
Message-ID: <20180823082542.2998-3-david1.zhou@amd.com> (raw)
In-Reply-To: <20180823082542.2998-1-david1.zhou@amd.com>

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);
 void drm_syncobj_free(struct kref *kref);
 int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
 		       struct dma_fence *fence);
-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-08-23  8:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  8:25 [PATCH 1/5] drm: fix syncobj null_fence_enable_signaling Chunming Zhou
2018-08-23  8:25 ` [PATCH 2/5] drm: rename null fence to stub fence in syncobj Chunming Zhou
     [not found]   ` <20180823082542.2998-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-23  9:10     ` Christian König
2018-08-23  8:25 ` Chunming Zhou [this message]
2018-08-23  9:03   ` [PATCH 3/5] drm: expand drm_syncobj_find_fence to support timeline point Christian König
2018-08-23  8:25 ` [PATCH 4/5] drm: expand replace_fence " Chunming Zhou
     [not found]   ` <20180823082542.2998-4-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-23  9:06     ` Christian König
     [not found] ` <20180823082542.2998-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-23  8:25   ` [PATCH 5/5] drm: add syncobj timeline support v2 Chunming Zhou
     [not found]     ` <20180823082542.2998-5-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-23  9:08       ` Daniel Vetter
     [not found]         ` <20180823090819.GA21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-08-23  9:30           ` zhoucm1
2018-08-23  9:15       ` Christian König
2018-08-23  9:58         ` zhoucm1
2018-08-23 11:05           ` Christian König
2018-08-23  9:02 ` [PATCH 1/5] drm: fix syncobj null_fence_enable_signaling Christian König
     [not found]   ` <031985ce-bdae-c04d-5fd4-e4ec2416e878-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-23  9:04     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180823082542.2998-3-david1.zhou@amd.com \
    --to=david1.zhou@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).