dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, "Rob Clark" <robdclark@gmail.com>,
	daniels@collabora.com, "Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Riley Andrews" <riandrews@android.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Arve Hjønnevåg" <arve@android.com>,
	"Greg Hackmann" <ghackmann@google.com>,
	"Maarten Lankhorst" <maarten.lankhorst@canonical.com>,
	"Gustavo Padovan" <gustavo.padovan@collabora.co.uk>,
	"John Harrison" <John.C.Harrison@Intel.com>
Subject: [RFC 01/29] staging/android: fix sync framework documentation
Date: Fri, 15 Jan 2016 12:55:11 -0200	[thread overview]
Message-ID: <1452869739-3304-2-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1452869739-3304-1-git-send-email-gustavo@padovan.org>

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Updates comments about functions and structures.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/sync.h | 45 ++++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h
index afa0752..7a4d820 100644
--- a/drivers/staging/android/sync.h
+++ b/drivers/staging/android/sync.h
@@ -110,15 +110,9 @@ struct sync_timeline {
 
 /**
  * struct sync_pt - sync point
- * @fence:		base fence class
+ * @base:		base fence class
  * @child_list:		membership in sync_timeline.child_list_head
  * @active_list:	membership in sync_timeline.active_list_head
- * @signaled_list:	membership in temporary signaled_list on stack
- * @fence:		sync_fence to which the sync_pt belongs
- * @pt_list:		membership in sync_fence.pt_list_head
- * @status:		1: signaled, 0:active, <0: error
- * @timestamp:		time which sync_pt status transitioned from active to
- *			  signaled or error.
  */
 struct sync_pt {
 	struct fence base;
@@ -144,12 +138,11 @@ struct sync_fence_cb {
  * @file:		file representing this fence
  * @kref:		reference count on fence.
  * @name:		name of sync_fence.  Useful for debugging
- * @pt_list_head:	list of sync_pts in the fence.  immutable once fence
- *			  is created
- * @status:		0: signaled, >0:active, <0: error
- *
- * @wq:			wait queue for fence signaling
  * @sync_fence_list:	membership in global fence list
+ * @num_fences		number of sync_pts in the fence
+ * @wq:			wait queue for fence signaling
+ * @status:		0: signaled, >0:active, <0: error
+ * @cbs:		sync_pts callback information
  */
 struct sync_fence {
 	struct file		*file;
@@ -172,9 +165,8 @@ typedef void (*sync_callback_t)(struct sync_fence *fence,
 
 /**
  * struct sync_fence_waiter - metadata for asynchronous waiter on a fence
- * @waiter_list:	membership in sync_fence.waiter_list_head
+ * @work:		wait_queue for the fence waiter
  * @callback:		function pointer to call when fence signals
- * @callback_data:	pointer to pass to @callback
  */
 struct sync_fence_waiter {
 	wait_queue_t work;
@@ -200,7 +192,8 @@ static inline void sync_fence_waiter_init(struct sync_fence_waiter *waiter,
  *
  * Creates a new sync_timeline which will use the implementation specified by
  * @ops.  @size bytes will be allocated allowing for implementation specific
- * data to be kept after the generic sync_timeline struct.
+ * data to be kept after the generic sync_timeline struct. Returns the
+ * sync_timeline object or NULL in case of error.
  */
 struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops,
 					   int size, const char *name);
@@ -231,7 +224,8 @@ void sync_timeline_signal(struct sync_timeline *obj);
  *
  * Creates a new sync_pt as a child of @parent.  @size bytes will be
  * allocated allowing for implementation specific data to be kept after
- * the generic sync_timeline struct.
+ * the generic sync_timeline struct. Returns the sync_pt object or
+ * NULL in case of error.
  */
 struct sync_pt *sync_pt_create(struct sync_timeline *parent, int size);
 
@@ -275,7 +269,8 @@ struct sync_fence *sync_fence_create_dma(const char *name, struct fence *pt);
  * @b:		fence b
  *
  * Creates a new fence which contains copies of all the sync_pts in both
- * @a and @b.  @a and @b remain valid, independent fences.
+ * @a and @b.  @a and @b remain valid, independent fences. Returns the
+ * new merged fence or NULL in case of error.
  */
 struct sync_fence *sync_fence_merge(const char *name,
 				    struct sync_fence *a, struct sync_fence *b);
@@ -285,7 +280,7 @@ struct sync_fence *sync_fence_merge(const char *name,
  * @fd:		fd referencing a fence
  *
  * Ensures @fd references a valid fence, increments the refcount of the backing
- * file, and returns the fence.
+ * file, and returns the fence. Returns the fence or NULL in case of error.
  */
 struct sync_fence *sync_fence_fdget(int fd);
 
@@ -313,10 +308,10 @@ void sync_fence_install(struct sync_fence *fence, int fd);
  * @fence:		fence to wait on
  * @waiter:		waiter callback struck
  *
- * Returns 1 if @fence has already signaled.
- *
  * Registers a callback to be called when @fence signals or has an error.
  * @waiter should be initialized with sync_fence_waiter_init().
+ *
+ * Returns 1 if @fence has already signaled, 0 if not or <0 if error.
  */
 int sync_fence_wait_async(struct sync_fence *fence,
 			  struct sync_fence_waiter *waiter);
@@ -326,11 +321,11 @@ int sync_fence_wait_async(struct sync_fence *fence,
  * @fence:		fence to wait on
  * @waiter:		waiter callback struck
  *
- * returns 0 if waiter was removed from fence's async waiter list.
- * returns -ENOENT if waiter was not found on fence's async waiter list.
- *
  * Cancels a previously registered async wait.  Will fail gracefully if
  * @waiter was never registered or if @fence has already signaled @waiter.
+ *
+ * Returns 0 if waiter was removed from fence's async waiter list.
+ * Returns -ENOENT if waiter was not found on fence's async waiter list.
  */
 int sync_fence_cancel_async(struct sync_fence *fence,
 			    struct sync_fence_waiter *waiter);
@@ -341,7 +336,9 @@ int sync_fence_cancel_async(struct sync_fence *fence,
  * @tiemout:	timeout in ms
  *
  * Wait for @fence to be signaled or have an error.  Waits indefinitely
- * if @timeout < 0
+ * if @timeout < 0.
+ *
+ * Returns 0 if fence signaled, > 0 if it is still active and <0 on error
  */
 int sync_fence_wait(struct sync_fence *fence, long timeout);
 
-- 
2.5.0

  reply	other threads:[~2016-01-15 14:55 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 14:55 [RFC 00/29] De-stage android's sync framework Gustavo Padovan
2016-01-15 14:55 ` Gustavo Padovan [this message]
2016-01-15 14:55 ` [RFC 02/29] staging/android: fix checkpatch warning Gustavo Padovan
2016-01-15 14:55 ` [RFC 03/29] staging/android: rename sync_fence_release Gustavo Padovan
2016-01-15 14:55 ` [RFC 04/29] staging/android: rename 'android_fence' to 'sync_fence' Gustavo Padovan
2016-01-15 14:55 ` [RFC 05/29] staging/android: remove not used sync_timeline ops Gustavo Padovan
2016-01-15 14:55 ` [RFC 06/29] staging/android: create a 'sync' dir for debugfs information Gustavo Padovan
2016-01-15 14:55 ` [RFC 07/29] staging/android: move sw_sync file to debugfs file Gustavo Padovan
2016-01-15 14:55 ` [RFC 08/29] staging/android: Remove WARN_ON_ONCE when releasing sync_fence Gustavo Padovan
2016-01-15 14:55 ` [RFC 09/29] staging/android: rename struct sync_fence's variables to 'sync_fence' Gustavo Padovan
2016-01-15 14:55 ` [RFC 10/29] staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb Gustavo Padovan
2016-01-15 14:55 ` [RFC 11/29] dma-buf/fence: move sync_timeline to fence_timeline Gustavo Padovan
2016-01-20  0:56   ` Greg Hackmann
2016-01-15 14:55 ` [RFC 12/29] staging/android: remove struct sync_pt Gustavo Padovan
2016-01-15 14:55 ` [RFC 13/29] dma-buf/fence: create fence_default_enable_signaling() Gustavo Padovan
2016-01-15 14:55 ` [RFC 14/29] dma-buf/fence: create fence_default_release() Gustavo Padovan
2016-01-15 14:55 ` [RFC 15/29] dma-buf/fence: create fence_default_get_driver_name() Gustavo Padovan
2016-01-15 14:55 ` [RFC 16/29] dma-buf/fence: create fence_default_timeline_name() Gustavo Padovan
2016-01-15 14:55 ` [RFC 17/29] dma-buf/fence: store last signaled value on fence timeline Gustavo Padovan
2016-01-15 14:55 ` [RFC 18/29] dma-buf/fence: create default .fence_value_str() and .timeline_value_str() Gustavo Padovan
2016-01-15 14:55 ` [RFC 19/29] dma-buf/fence: create fence_default_fill_driver_data() Gustavo Padovan
2016-01-15 14:55 ` [RFC 20/29] dma-buf/fence: remove fence_timeline_ops Gustavo Padovan
2016-01-15 14:55 ` [RFC 21/29] dma-buf/fence: add fence_create_on_timeline() Gustavo Padovan
2016-01-15 14:55 ` [RFC 22/29] staging/android: remove sync_pt_create() Gustavo Padovan
2016-01-15 14:55 ` [RFC 23/29] staging/android: remove sw_sync_timeline and sw_sync_pt Gustavo Padovan
2016-01-15 14:55 ` [RFC 24/29] dma-buf/fence: add debug to fence timeline Gustavo Padovan
2016-01-15 14:55 ` [RFC 25/29] dma-buf/fence: remove unused var from fence_timeline_signal() Gustavo Padovan
2016-01-15 14:55 ` [RFC 26/29] dma-buf/fence: remove pointless fence_timeline_signal at destroy phase Gustavo Padovan
2016-01-15 17:48   ` John Harrison
2016-01-15 18:02     ` Gustavo Padovan
2016-01-15 23:42       ` Greg Hackmann
2016-02-09 22:55         ` Tom Cherry
2016-02-25 15:26           ` Gustavo Padovan
2016-01-15 14:55 ` [RFC 27/29] dma-buf/fence: add .cleanup() callback Gustavo Padovan
2016-01-15 14:55 ` [RFC 28/29] staging/android: use .cleanup() to interrupt any sync_fence waiter Gustavo Padovan
2016-01-15 14:55 ` [RFC 29/29] dma-buf/fence: de-stage sync framework Gustavo Padovan
2016-01-15 19:11 ` [RFC 00/29] De-stage android's " Joe Perches
2016-01-19 11:00 ` Daniel Vetter
2016-01-19 15:23   ` Gustavo Padovan
2016-01-19 16:12     ` John Harrison
2016-01-19 17:52       ` Gustavo Padovan
2016-01-19 18:04         ` Daniel Vetter
2016-01-19 18:15           ` Gustavo Padovan
2016-03-23 15:07       ` Tomeu Vizoso
2016-01-19 20:10   ` Gustavo Padovan
2016-01-19 20:32     ` Daniel Vetter
2016-01-20 10:28 ` Maarten Lankhorst
2016-01-20 14:32   ` Gustavo Padovan
2016-01-20 15:02     ` Maarten Lankhorst
2016-01-20 16:29       ` Daniel Vetter
2016-01-20 18:28       ` Gustavo Padovan

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=1452869739-3304-2-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=John.C.Harrison@Intel.com \
    --cc=arve@android.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ghackmann@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@canonical.com \
    --cc=riandrews@android.com \
    --cc=robdclark@gmail.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 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).