All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 01/12] dma-buf: add interface for user fence synchronization
Date: Tue,  4 May 2021 15:27:18 +0200	[thread overview]
Message-ID: <20210504132729.2046-2-christian.koenig@amd.com> (raw)
In-Reply-To: <20210504132729.2046-1-christian.koenig@amd.com>

This is a RFC/WIP patch which just adds the interface and lockdep
annotation without any actual implementation.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/dma-buf/dma-resv.c | 18 ++++++++++++++++++
 include/linux/dma-resv.h   |  1 +
 2 files changed, 19 insertions(+)

diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c
index 6ddbeb5dfbf6..e0305424957b 100644
--- a/drivers/dma-buf/dma-resv.c
+++ b/drivers/dma-buf/dma-resv.c
@@ -681,3 +681,21 @@ bool dma_resv_test_signaled_rcu(struct dma_resv *obj, bool test_all)
 	return ret;
 }
 EXPORT_SYMBOL_GPL(dma_resv_test_signaled_rcu);
+
+/**
+ * dma_resv_sync_user_fence - block for user fences to signal
+ *
+ * @obj: The DMA resv object with the user fence attached
+ *
+ * To make sure we have proper synchronization between accesses block for user
+ * fences before starting a dma_fence based operation on the buffer.
+ */
+int dma_resv_sync_user_fence(struct dma_resv *obj)
+{
+	might_fault();
+
+	/* TODO: Actually come up with an implementation for this! */
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dma_resv_sync_user_fence);
diff --git a/include/linux/dma-resv.h b/include/linux/dma-resv.h
index d44a77e8a7e3..c525a36be900 100644
--- a/include/linux/dma-resv.h
+++ b/include/linux/dma-resv.h
@@ -289,5 +289,6 @@ long dma_resv_wait_timeout_rcu(struct dma_resv *obj, bool wait_all, bool intr,
 			       unsigned long timeout);
 
 bool dma_resv_test_signaled_rcu(struct dma_resv *obj, bool test_all);
+int dma_resv_sync_user_fence(struct dma_resv *obj);
 
 #endif /* _LINUX_RESERVATION_H */
-- 
2.25.1

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

  reply	other threads:[~2021-05-04 13:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 13:27 [RFC] Implicit vs explicit user fence sync Christian König
2021-05-04 13:27 ` Christian König [this message]
2021-05-04 13:27 ` [PATCH 02/12] RDMA/mlx5: add DMA-buf user fence support Christian König
2021-05-04 13:27 ` [PATCH 03/12] drm/amdgpu: " Christian König
2021-05-04 13:27 ` [PATCH 04/12] drm/gem: dd DMA-buf user fence support for the atomic helper Christian König
2021-05-04 13:27 ` [PATCH 05/12] drm/etnaviv: add DMA-buf user fence support Christian König
2021-05-04 13:27 ` [PATCH 06/12] drm/i915: " Christian König
2021-05-04 13:27 ` [PATCH 07/12] drm/lima: " Christian König
2021-05-04 13:27 ` [PATCH 08/12] drm/msm: " Christian König
2021-05-04 13:27 ` [PATCH 09/12] drm/nouveau: " Christian König
2021-05-04 13:27 ` [PATCH 10/12] drm/panfrost: " Christian König
2021-05-04 13:27 ` [PATCH 11/12] drm/radeon: " Christian König
2021-05-04 13:27 ` [PATCH 12/12] drm/v3d: " Christian König
2021-05-04 14:15 ` [RFC] Implicit vs explicit user fence sync Daniel Vetter
2021-05-04 14:26   ` Christian König
2021-05-04 15:11     ` Daniel Vetter
2021-05-10 18:12       ` Christian König
2021-05-11  7:31         ` Daniel Vetter
2021-05-11  7:47           ` Christian König
2021-05-11 14:23             ` Daniel Vetter
2021-05-11 15:32               ` Christian König
2021-05-11 16:48                 ` Daniel Vetter
2021-05-11 19:34                   ` Christian König
2021-05-12  8:13                     ` Daniel Vetter
2021-05-12  8:23                       ` Christian König
2021-05-12  8:50                         ` 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=20210504132729.2046-2-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.