All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Pekka Paalanen" <ppaalanen@gmail.com>,
	"Simon Ser" <contact@emersion.fr>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Rob Clark" <robdclark@chromium.org>,
	"Pekka Paalanen" <pekka.paalanen@collabora.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Gustavo Padovan" <gustavo@padovan.org>,
	linux-media@vger.kernel.org (open list:DMA BUFFER SHARING
	FRAMEWORK),
	linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER
	SHARING FRAMEWORK),
	linux-doc@vger.kernel.org (open list:DOCUMENTATION),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v9 05/15] dma-buf/sync_file: Surface sync-file uABI
Date: Thu,  2 Mar 2023 15:53:27 -0800	[thread overview]
Message-ID: <20230302235356.3148279-6-robdclark@gmail.com> (raw)
In-Reply-To: <20230302235356.3148279-1-robdclark@gmail.com>

From: Rob Clark <robdclark@chromium.org>

We had all of the internal driver APIs, but not the all important
userspace uABI, in the dma-buf doc.  Fix that.  And re-arrange the
comments slightly as otherwise the comments for the ioctl nr defines
would not show up.

v2: Fix docs build warning coming from newly including the uabi header
    in the docs build

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
---
 Documentation/driver-api/dma-buf.rst | 10 ++++++--
 include/uapi/linux/sync_file.h       | 37 +++++++++++-----------------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst
index 183e480d8cea..ff3f8da296af 100644
--- a/Documentation/driver-api/dma-buf.rst
+++ b/Documentation/driver-api/dma-buf.rst
@@ -203,8 +203,8 @@ DMA Fence unwrap
 .. kernel-doc:: include/linux/dma-fence-unwrap.h
    :internal:
 
-DMA Fence uABI/Sync File
-~~~~~~~~~~~~~~~~~~~~~~~~
+DMA Fence Sync File
+~~~~~~~~~~~~~~~~~~~
 
 .. kernel-doc:: drivers/dma-buf/sync_file.c
    :export:
@@ -212,6 +212,12 @@ DMA Fence uABI/Sync File
 .. kernel-doc:: include/linux/sync_file.h
    :internal:
 
+DMA Fence Sync File uABI
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: include/uapi/linux/sync_file.h
+   :internal:
+
 Indefinite DMA Fences
 ~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/include/uapi/linux/sync_file.h b/include/uapi/linux/sync_file.h
index ee2dcfb3d660..7e42a5b7558b 100644
--- a/include/uapi/linux/sync_file.h
+++ b/include/uapi/linux/sync_file.h
@@ -16,12 +16,16 @@
 #include <linux/types.h>
 
 /**
- * struct sync_merge_data - data passed to merge ioctl
+ * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences
  * @name:	name of new fence
  * @fd2:	file descriptor of second fence
  * @fence:	returns the fd of the new fence to userspace
  * @flags:	merge_data flags
  * @pad:	padding for 64-bit alignment, should always be zero
+ *
+ * Creates a new fence containing copies of the sync_pts in both
+ * the calling fd and sync_merge_data.fd2.  Returns the new fence's
+ * fd in sync_merge_data.fence
  */
 struct sync_merge_data {
 	char	name[32];
@@ -34,8 +38,8 @@ struct sync_merge_data {
 /**
  * struct sync_fence_info - detailed fence information
  * @obj_name:		name of parent sync_timeline
-* @driver_name:	name of driver implementing the parent
-* @status:		status of the fence 0:active 1:signaled <0:error
+ * @driver_name:	name of driver implementing the parent
+ * @status:		status of the fence 0:active 1:signaled <0:error
  * @flags:		fence_info flags
  * @timestamp_ns:	timestamp of status change in nanoseconds
  */
@@ -48,14 +52,19 @@ struct sync_fence_info {
 };
 
 /**
- * struct sync_file_info - data returned from fence info ioctl
+ * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file
  * @name:	name of fence
  * @status:	status of fence. 1: signaled 0:active <0:error
  * @flags:	sync_file_info flags
  * @num_fences	number of fences in the sync_file
  * @pad:	padding for 64-bit alignment, should always be zero
- * @sync_fence_info: pointer to array of structs sync_fence_info with all
+ * @sync_fence_info: pointer to array of struct &sync_fence_info with all
  *		 fences in the sync_file
+ *
+ * Takes a struct sync_file_info. If num_fences is 0, the field is updated
+ * with the actual number of fences. If num_fences is > 0, the system will
+ * use the pointer provided on sync_fence_info to return up to num_fences of
+ * struct sync_fence_info, with detailed fence information.
  */
 struct sync_file_info {
 	char	name[32];
@@ -69,30 +78,14 @@ struct sync_file_info {
 
 #define SYNC_IOC_MAGIC		'>'
 
-/**
+/*
  * Opcodes  0, 1 and 2 were burned during a API change to avoid users of the
  * old API to get weird errors when trying to handling sync_files. The API
  * change happened during the de-stage of the Sync Framework when there was
  * no upstream users available.
  */
 
-/**
- * DOC: SYNC_IOC_MERGE - merge two fences
- *
- * Takes a struct sync_merge_data.  Creates a new fence containing copies of
- * the sync_pts in both the calling fd and sync_merge_data.fd2.  Returns the
- * new fence's fd in sync_merge_data.fence
- */
 #define SYNC_IOC_MERGE		_IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
-
-/**
- * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
- *
- * Takes a struct sync_file_info. If num_fences is 0, the field is updated
- * with the actual number of fences. If num_fences is > 0, the system will
- * use the pointer provided on sync_fence_info to return up to num_fences of
- * struct sync_fence_info, with detailed fence information.
- */
 #define SYNC_IOC_FILE_INFO	_IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
 
 #endif /* _UAPI_LINUX_SYNC_H */
-- 
2.39.1


WARNING: multiple messages have this Message-ID (diff)
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: "Rob Clark" <robdclark@chromium.org>,
	"Gustavo Padovan" <gustavo@padovan.org>,
	"Pekka Paalanen" <pekka.paalanen@collabora.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	"moderated list:DMA BUFFER SHARING FRAMEWORK"
	<linaro-mm-sig@lists.linaro.org>,
	"Pekka Paalanen" <ppaalanen@gmail.com>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	freedreno@lists.freedesktop.org,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"open list:DMA BUFFER SHARING FRAMEWORK"
	<linux-media@vger.kernel.org>
Subject: [PATCH v9 05/15] dma-buf/sync_file: Surface sync-file uABI
Date: Thu,  2 Mar 2023 15:53:27 -0800	[thread overview]
Message-ID: <20230302235356.3148279-6-robdclark@gmail.com> (raw)
In-Reply-To: <20230302235356.3148279-1-robdclark@gmail.com>

From: Rob Clark <robdclark@chromium.org>

We had all of the internal driver APIs, but not the all important
userspace uABI, in the dma-buf doc.  Fix that.  And re-arrange the
comments slightly as otherwise the comments for the ioctl nr defines
would not show up.

v2: Fix docs build warning coming from newly including the uabi header
    in the docs build

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
---
 Documentation/driver-api/dma-buf.rst | 10 ++++++--
 include/uapi/linux/sync_file.h       | 37 +++++++++++-----------------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst
index 183e480d8cea..ff3f8da296af 100644
--- a/Documentation/driver-api/dma-buf.rst
+++ b/Documentation/driver-api/dma-buf.rst
@@ -203,8 +203,8 @@ DMA Fence unwrap
 .. kernel-doc:: include/linux/dma-fence-unwrap.h
    :internal:
 
-DMA Fence uABI/Sync File
-~~~~~~~~~~~~~~~~~~~~~~~~
+DMA Fence Sync File
+~~~~~~~~~~~~~~~~~~~
 
 .. kernel-doc:: drivers/dma-buf/sync_file.c
    :export:
@@ -212,6 +212,12 @@ DMA Fence uABI/Sync File
 .. kernel-doc:: include/linux/sync_file.h
    :internal:
 
+DMA Fence Sync File uABI
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: include/uapi/linux/sync_file.h
+   :internal:
+
 Indefinite DMA Fences
 ~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/include/uapi/linux/sync_file.h b/include/uapi/linux/sync_file.h
index ee2dcfb3d660..7e42a5b7558b 100644
--- a/include/uapi/linux/sync_file.h
+++ b/include/uapi/linux/sync_file.h
@@ -16,12 +16,16 @@
 #include <linux/types.h>
 
 /**
- * struct sync_merge_data - data passed to merge ioctl
+ * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences
  * @name:	name of new fence
  * @fd2:	file descriptor of second fence
  * @fence:	returns the fd of the new fence to userspace
  * @flags:	merge_data flags
  * @pad:	padding for 64-bit alignment, should always be zero
+ *
+ * Creates a new fence containing copies of the sync_pts in both
+ * the calling fd and sync_merge_data.fd2.  Returns the new fence's
+ * fd in sync_merge_data.fence
  */
 struct sync_merge_data {
 	char	name[32];
@@ -34,8 +38,8 @@ struct sync_merge_data {
 /**
  * struct sync_fence_info - detailed fence information
  * @obj_name:		name of parent sync_timeline
-* @driver_name:	name of driver implementing the parent
-* @status:		status of the fence 0:active 1:signaled <0:error
+ * @driver_name:	name of driver implementing the parent
+ * @status:		status of the fence 0:active 1:signaled <0:error
  * @flags:		fence_info flags
  * @timestamp_ns:	timestamp of status change in nanoseconds
  */
@@ -48,14 +52,19 @@ struct sync_fence_info {
 };
 
 /**
- * struct sync_file_info - data returned from fence info ioctl
+ * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file
  * @name:	name of fence
  * @status:	status of fence. 1: signaled 0:active <0:error
  * @flags:	sync_file_info flags
  * @num_fences	number of fences in the sync_file
  * @pad:	padding for 64-bit alignment, should always be zero
- * @sync_fence_info: pointer to array of structs sync_fence_info with all
+ * @sync_fence_info: pointer to array of struct &sync_fence_info with all
  *		 fences in the sync_file
+ *
+ * Takes a struct sync_file_info. If num_fences is 0, the field is updated
+ * with the actual number of fences. If num_fences is > 0, the system will
+ * use the pointer provided on sync_fence_info to return up to num_fences of
+ * struct sync_fence_info, with detailed fence information.
  */
 struct sync_file_info {
 	char	name[32];
@@ -69,30 +78,14 @@ struct sync_file_info {
 
 #define SYNC_IOC_MAGIC		'>'
 
-/**
+/*
  * Opcodes  0, 1 and 2 were burned during a API change to avoid users of the
  * old API to get weird errors when trying to handling sync_files. The API
  * change happened during the de-stage of the Sync Framework when there was
  * no upstream users available.
  */
 
-/**
- * DOC: SYNC_IOC_MERGE - merge two fences
- *
- * Takes a struct sync_merge_data.  Creates a new fence containing copies of
- * the sync_pts in both the calling fd and sync_merge_data.fd2.  Returns the
- * new fence's fd in sync_merge_data.fence
- */
 #define SYNC_IOC_MERGE		_IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
-
-/**
- * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
- *
- * Takes a struct sync_file_info. If num_fences is 0, the field is updated
- * with the actual number of fences. If num_fences is > 0, the system will
- * use the pointer provided on sync_fence_info to return up to num_fences of
- * struct sync_fence_info, with detailed fence information.
- */
 #define SYNC_IOC_FILE_INFO	_IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
 
 #endif /* _UAPI_LINUX_SYNC_H */
-- 
2.39.1


  parent reply	other threads:[~2023-03-02 23:54 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 23:53 [Intel-gfx] [PATCH v9 00/15] dma-fence: Deadline awareness Rob Clark
2023-03-02 23:53 ` Rob Clark
2023-03-02 23:53 ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 01/15] dma-buf/dma-fence: Add deadline awareness Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 02/15] dma-buf/fence-array: Add fence deadline support Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 03/15] dma-buf/fence-chain: " Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 04/15] dma-buf/dma-resv: Add a way to set fence deadline Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` Rob Clark [this message]
2023-03-02 23:53   ` [PATCH v9 05/15] dma-buf/sync_file: Surface sync-file uABI Rob Clark
2023-03-02 23:53 ` [PATCH v9 06/15] dma-buf/sync_file: Add SET_DEADLINE ioctl Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 07/15] dma-buf/sw_sync: Add fence deadline support Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 08/15] drm/scheduler: " Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 09/15] drm/syncobj: Add deadline support for syncobj waits Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 10/15] drm/vblank: Add helper to get next vblank time Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53 ` [PATCH v9 11/15] drm/atomic-helper: Set fence deadline for vblank Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-03 15:12   ` Ville Syrjälä
2023-03-03 15:12     ` Ville Syrjälä
2023-03-03 15:45     ` Rob Clark
2023-03-03 15:45       ` Rob Clark
2023-03-03 15:52       ` Ville Syrjälä
2023-03-03 15:52         ` Ville Syrjälä
2023-03-02 23:53 ` [PATCH v9 12/15] drm/msm: Add deadline based boost support Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-03 10:10   ` Dmitry Baryshkov
2023-03-03 10:10     ` Dmitry Baryshkov
2023-03-03 17:03     ` Rob Clark
2023-03-03 17:03       ` Rob Clark
2023-03-03 23:53       ` Dmitry Baryshkov
2023-03-03 23:53         ` Dmitry Baryshkov
2023-03-02 23:53 ` [PATCH v9 13/15] drm/msm: Add wait-boost support Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-03 10:04   ` Dmitry Baryshkov
2023-03-03 10:04     ` Dmitry Baryshkov
2023-03-02 23:53 ` [PATCH v9 14/15] drm/msm/atomic: Switch to vblank_start helper Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-03 10:04   ` Dmitry Baryshkov
2023-03-03 10:04     ` Dmitry Baryshkov
2023-03-02 23:53 ` [Intel-gfx] [PATCH v9 15/15] drm/i915: Add deadline based boost support Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-02 23:53   ` Rob Clark
2023-03-03  3:21   ` [Intel-gfx] " Rodrigo Vivi
2023-03-03  3:21     ` Rodrigo Vivi
2023-03-03  3:21     ` Rodrigo Vivi
2023-03-03  9:58     ` [Intel-gfx] " Tvrtko Ursulin
2023-03-03  9:58       ` Tvrtko Ursulin
2023-03-03  9:58       ` Tvrtko Ursulin
2023-03-03 11:21       ` [Intel-gfx] " Andi Shyti
2023-03-03 11:21         ` Andi Shyti
2023-03-03 11:21         ` Andi Shyti
2023-03-03 14:48       ` Rob Clark
2023-03-03 14:48         ` Rob Clark
2023-03-03 14:48         ` Rob Clark
2023-03-03 15:00         ` [Intel-gfx] " Ville Syrjälä
2023-03-03 15:00           ` Ville Syrjälä
2023-03-03 15:00           ` Ville Syrjälä
2023-03-03 15:19           ` [Intel-gfx] " Ville Syrjälä
2023-03-03 15:19             ` Ville Syrjälä
2023-03-03 15:19             ` Ville Syrjälä
2023-03-03 15:43             ` [Intel-gfx] " Rob Clark
2023-03-03 15:43               ` Rob Clark
2023-03-03 15:43               ` Rob Clark
2023-03-03 15:07         ` [Intel-gfx] " Tvrtko Ursulin
2023-03-03 15:07           ` Tvrtko Ursulin
2023-03-03 15:07           ` Tvrtko Ursulin
2023-03-03 15:41           ` [Intel-gfx] [Freedreno] " Rob Clark
2023-03-03 15:41             ` Rob Clark
2023-03-03 15:41             ` Rob Clark
2023-03-03 18:20           ` [Intel-gfx] " Matt Turner
2023-03-03 18:20             ` Matt Turner
2023-03-03 18:20             ` Matt Turner
2023-03-03 14:56     ` [Intel-gfx] " Rob Clark
2023-03-03 14:56       ` Rob Clark
2023-03-03 14:56       ` Rob Clark

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=20230302235356.3148279-6-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=contact@emersion.fr \
    --cc=corbet@lwn.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=luben.tuikov@amd.com \
    --cc=michel@daenzer.net \
    --cc=pekka.paalanen@collabora.com \
    --cc=ppaalanen@gmail.com \
    --cc=robdclark@chromium.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tvrtko.ursulin@intel.com \
    /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.