dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chunming Zhou <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Chunming Zhou <david1.zhou-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 4/5] drm: expand replace_fence to support timeline point v2
Date: Wed, 29 Aug 2018 18:44:33 +0800	[thread overview]
Message-ID: <20180829104434.13265-4-david1.zhou@amd.com> (raw)
In-Reply-To: <20180829104434.13265-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>

we can place a fence to a timeline point after expanded.
v2: change func parameter order

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     |  2 +-
 drivers/gpu/drm/drm_syncobj.c              | 14 ++++++++------
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  2 +-
 drivers/gpu/drm/v3d/v3d_gem.c              |  2 +-
 drivers/gpu/drm/vc4/vc4_gem.c              |  2 +-
 include/drm/drm_syncobj.h                  |  2 +-
 6 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 0e8cf088175f..1dba9223927a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1151,7 +1151,7 @@ static void amdgpu_cs_post_dependencies(struct amdgpu_cs_parser *p)
 	int i;
 
 	for (i = 0; i < p->num_post_dep_syncobjs; ++i)
-		drm_syncobj_replace_fence(p->post_dep_syncobjs[i], p->fence);
+		drm_syncobj_replace_fence(p->post_dep_syncobjs[i], 0, p->fence);
 }
 
 static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 2dcb60f4c0f7..ab43559398d0 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -140,11 +140,13 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
 /**
  * drm_syncobj_replace_fence - replace fence in a sync object.
  * @syncobj: Sync object to replace fence in
+ * @point: timeline point
  * @fence: fence to install in sync file.
  *
- * This replaces the fence on a sync object.
+ * This replaces the fence on a sync object, or a timeline point fence.
  */
 void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
+			       u64 point,
 			       struct dma_fence *fence)
 {
 	struct dma_fence *old_fence;
@@ -206,7 +208,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
 		       &fence->lock, 0, 0);
 	dma_fence_signal(&fence->base);
 
-	drm_syncobj_replace_fence(syncobj, &fence->base);
+	drm_syncobj_replace_fence(syncobj, 0, &fence->base);
 
 	dma_fence_put(&fence->base);
 
@@ -257,7 +259,7 @@ void drm_syncobj_free(struct kref *kref)
 	struct drm_syncobj *syncobj = container_of(kref,
 						   struct drm_syncobj,
 						   refcount);
-	drm_syncobj_replace_fence(syncobj, NULL);
+	drm_syncobj_replace_fence(syncobj, 0, NULL);
 	kfree(syncobj);
 }
 EXPORT_SYMBOL(drm_syncobj_free);
@@ -297,7 +299,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
 	}
 
 	if (fence)
-		drm_syncobj_replace_fence(syncobj, fence);
+		drm_syncobj_replace_fence(syncobj, 0, fence);
 
 	*out_syncobj = syncobj;
 	return 0;
@@ -482,7 +484,7 @@ static int drm_syncobj_import_sync_file_fence(struct drm_file *file_private,
 		return -ENOENT;
 	}
 
-	drm_syncobj_replace_fence(syncobj, fence);
+	drm_syncobj_replace_fence(syncobj, 0, fence);
 	dma_fence_put(fence);
 	drm_syncobj_put(syncobj);
 	return 0;
@@ -964,7 +966,7 @@ drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
 		return ret;
 
 	for (i = 0; i < args->count_handles; i++)
-		drm_syncobj_replace_fence(syncobjs[i], NULL);
+		drm_syncobj_replace_fence(syncobjs[i], 0, NULL);
 
 	drm_syncobj_array_free(syncobjs, args->count_handles);
 
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 60dc2a865f5f..7209dd832d39 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -2211,7 +2211,7 @@ signal_fence_array(struct i915_execbuffer *eb,
 		if (!(flags & I915_EXEC_FENCE_SIGNAL))
 			continue;
 
-		drm_syncobj_replace_fence(syncobj, fence);
+		drm_syncobj_replace_fence(syncobj, 0, fence);
 	}
 }
 
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index d25c35c45c33..edb4b3651e1d 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -586,7 +586,7 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
 	/* Update the return sync object for the */
 	sync_out = drm_syncobj_find(file_priv, args->out_sync);
 	if (sync_out) {
-		drm_syncobj_replace_fence(sync_out,
+		drm_syncobj_replace_fence(sync_out, 0,
 					  &exec->render.base.s_fence->finished);
 		drm_syncobj_put(sync_out);
 	}
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 928718b467bd..5b22e996af6c 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -681,7 +681,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec,
 	exec->fence = &fence->base;
 
 	if (out_sync)
-		drm_syncobj_replace_fence(out_sync, exec->fence);
+		drm_syncobj_replace_fence(out_sync, 0, exec->fence);
 
 	vc4_update_bo_seqnos(exec, seqno);
 
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
index ab9055f943c7..425432b85a87 100644
--- a/include/drm/drm_syncobj.h
+++ b/include/drm/drm_syncobj.h
@@ -131,7 +131,7 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj)
 
 struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
 				     u32 handle);
-void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
+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,
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-08-29 10:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 10:44 [PATCH 1/5] drm: fix syncobj null_fence_enable_signaling Chunming Zhou
     [not found] ` <20180829104434.13265-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-29 10:44   ` [PATCH 2/5] drm: rename null fence to stub fence in syncobj Chunming Zhou
2018-08-29 10:44   ` Chunming Zhou [this message]
2018-08-29 10:44   ` [PATCH 5/5] [RFC]drm: add syncobj timeline support v3 Chunming Zhou
     [not found]     ` <20180829104434.13265-5-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-29 11:42       ` Christian König
2018-08-30  3:50         ` zhoucm1
     [not found]           ` <45ed2e67-0b20-fa45-9575-e3f29470d4fd-5C7GfCeVMHo@public.gmane.org>
2018-08-30  7:25             ` Christian König
     [not found]               ` <f6bf45a6-6f7e-587a-f41c-5ddb8df5284e-5C7GfCeVMHo@public.gmane.org>
2018-08-30 10:40                 ` zhoucm1
     [not found]                   ` <e3d4a0c9-80f9-73e6-d9ad-ecaf1e055bcf-5C7GfCeVMHo@public.gmane.org>
2018-08-30 11:32                     ` Christian König
     [not found]                       ` <60e0dd83-93c1-8cbf-03b6-f00739fb7078-5C7GfCeVMHo@public.gmane.org>
2018-09-03  4:13                         ` Chunming Zhou
2018-09-03  8:50                           ` Christian König
     [not found]                             ` <43b69e04-d71b-e77a-6a41-1d8cb9ec1b95-5C7GfCeVMHo@public.gmane.org>
2018-09-03 10:07                               ` Chunming Zhou
     [not found]                                 ` <ffdac62f-8c9d-ff29-d699-f42873250ac6-5C7GfCeVMHo@public.gmane.org>
2018-09-03 11:19                                   ` Christian König
     [not found]                                     ` <879aa2ac-26f4-b726-3e7e-807de27208c6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-04  4:04                                       ` zhoucm1
2018-09-04  7:00                                         ` Christian König
     [not found]                                           ` <4701566f-3b32-055c-3a5b-9c46708d85f1-5C7GfCeVMHo@public.gmane.org>
2018-09-04  7:53                                             ` zhoucm1
     [not found]                                               ` <9b3ba227-c8c5-4789-daff-6436fa5a2f28-5C7GfCeVMHo@public.gmane.org>
2018-09-04  8:05                                                 ` Christian König
     [not found]                                                   ` <94dd248e-15e2-7d27-e0ca-74e00b3e52c4-5C7GfCeVMHo@public.gmane.org>
2018-09-04  8:27                                                     ` zhoucm1
     [not found]                                                       ` <84d83bb0-5576-558d-1f73-8f41276dcf87-5C7GfCeVMHo@public.gmane.org>
2018-09-04  8:42                                                         ` Christian König
     [not found]                                                           ` <2f04c699-3259-ea87-e415-10c7e834460b-5C7GfCeVMHo@public.gmane.org>
2018-09-04  9:00                                                             ` zhoucm1
     [not found]                                                               ` <f2808965-22a5-bfe8-9eb1-e206e20265d8-5C7GfCeVMHo@public.gmane.org>
2018-09-04  9:20                                                                 ` Christian König
2018-09-05  3:36                                                                   ` zhoucm1
     [not found]                                                                     ` <8363b46b-52c4-1539-0928-df5b8894370e-5C7GfCeVMHo@public.gmane.org>
2018-09-05  6:55                                                                       ` Christian König
2018-08-29 10:44 ` [PATCH 3/5] drm: expand drm_syncobj_find_fence to support timeline point v2 Chunming Zhou
  -- strict thread matches above, loose matches on Subject: below --
2018-08-30  6:48 [PATCH 1/5] drm: fix syncobj null_fence_enable_signaling Chunming Zhou
     [not found] ` <20180830064831.5868-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-08-30  6:48   ` [PATCH 4/5] drm: expand replace_fence to support timeline point v2 Chunming Zhou

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=20180829104434.13265-4-david1.zhou@amd.com \
    --to=david1.zhou-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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).