Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1318235 > unrolled thread

[PATCH 00/11] sync framework de-staging: part 2 - de-stage

Started byGustavo Padovan <gustavo@padovan.org>
First post2016-01-26 19:40 +0100
Last post2016-01-26 21:10 +0100
Articles 6 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/11] sync framework de-staging: part 2 - de-stage Gustavo Padovan <gustavo@padovan.org> - 2016-01-26 19:40 +0100
    [PATCH 08/11] staging/android: rename android_fence to timeline_fence Gustavo Padovan <gustavo@padovan.org> - 2016-01-26 19:40 +0100
    [PATCH 10/11] dma-buf/sync_file: bring debug back to sync file Gustavo Padovan <gustavo@padovan.org> - 2016-01-26 19:40 +0100
    [PATCH 03/11] staging/android: remove .fill_driver_data() timeline ops Gustavo Padovan <gustavo@padovan.org> - 2016-01-26 19:40 +0100
    [PATCH 11/11] dma-buf/sync_file: bring sync_dump() back Gustavo Padovan <gustavo@padovan.org> - 2016-01-26 19:40 +0100
    Re: [PATCH 09/11] dma-buf/sync_timeline: de-stage sync_timeline Gustavo Padovan <gustavo@padovan.org> - 2016-01-26 21:10 +0100

#1318235 — [PATCH 00/11] sync framework de-staging: part 2 - de-stage

FromGustavo Padovan <gustavo@padovan.org>
Date2016-01-26 19:40 +0100
Subject[PATCH 00/11] sync framework de-staging: part 2 - de-stage
Message-ID<qVgH0-88L-3@gated-at.bofh.it>
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

This patch series de-stage the sync framework and it a follow up on the         
clean up series I've sent last week:                                            

http://thread.gmane.org/gmane.comp.video.dri.devel/145509                       

Now in part 2 we finish the de-stage of the sync framework. It start with the   
move of sync_file from staging to drivers/dma-buf, followed by a bunch of clean 
ups on sync_timeline and sw_sync. Finally we de-stage the later two plus the    
debug routines.

Gustavo Padovan (11):
  dma-buf/sync_file: de-stage sync_file
  staging/android: store last signaled value on sync timeline
  staging/android: remove .fill_driver_data() timeline ops
  staging/android: remove .{fence,timeline}_value_str() from
    timeline_ops
  staging/android: remove struct sync_timeline_ops
  staging/android: remove sw_sync_timeline and sw_sync_pt
  staging/android: remove sw_sync.[ch] files
  staging/android: rename android_fence to timeline_fence
  dma-buf/sync_timeline: de-stage sync_timeline
  dma-buf/sync_file: bring debug back to sync file
  dma-buf/sync_file: bring sync_dump() back

 drivers/Kconfig                        |   2 +
 drivers/dma-buf/Kconfig                |  21 ++
 drivers/dma-buf/Makefile               |   2 +
 drivers/dma-buf/sw_sync.h              |  32 ++
 drivers/dma-buf/sync_debug.c           | 374 +++++++++++++++++++
 drivers/dma-buf/sync_debug.h           |  35 ++
 drivers/dma-buf/sync_file.c            | 451 +++++++++++++++++++++++
 drivers/dma-buf/sync_timeline.c        | 222 +++++++++++
 drivers/staging/android/Kconfig        |  19 -
 drivers/staging/android/Makefile       |   1 -
 drivers/staging/android/sw_sync.c      | 103 ------
 drivers/staging/android/sw_sync.h      |  59 ---
 drivers/staging/android/sync.c         | 652 ---------------------------------
 drivers/staging/android/sync.h         | 261 -------------
 drivers/staging/android/sync_debug.c   | 372 -------------------
 drivers/staging/android/trace/sync.h   |  82 -----
 drivers/staging/android/uapi/sw_sync.h |  32 --
 drivers/staging/android/uapi/sync.h    |  97 -----
 include/linux/sync_file.h              | 123 +++++++
 include/linux/sync_timeline.h          | 114 ++++++
 include/trace/events/sync_file.h       |  57 +++
 include/trace/events/sync_timeline.h   |  31 ++
 include/uapi/linux/sync.h              |  97 +++++
 23 files changed, 1561 insertions(+), 1678 deletions(-)
 create mode 100644 drivers/dma-buf/Kconfig
 create mode 100644 drivers/dma-buf/sw_sync.h
 create mode 100644 drivers/dma-buf/sync_debug.c
 create mode 100644 drivers/dma-buf/sync_debug.h
 create mode 100644 drivers/dma-buf/sync_file.c
 create mode 100644 drivers/dma-buf/sync_timeline.c
 delete mode 100644 drivers/staging/android/sw_sync.c
 delete mode 100644 drivers/staging/android/sw_sync.h
 delete mode 100644 drivers/staging/android/sync.c
 delete mode 100644 drivers/staging/android/sync.h
 delete mode 100644 drivers/staging/android/sync_debug.c
 delete mode 100644 drivers/staging/android/trace/sync.h
 delete mode 100644 drivers/staging/android/uapi/sw_sync.h
 delete mode 100644 drivers/staging/android/uapi/sync.h
 create mode 100644 include/linux/sync_file.h
 create mode 100644 include/linux/sync_timeline.h
 create mode 100644 include/trace/events/sync_file.h
 create mode 100644 include/trace/events/sync_timeline.h
 create mode 100644 include/uapi/linux/sync.h

-- 
2.5.0

[toc] | [next] | [standalone]


#1318240 — [PATCH 08/11] staging/android: rename android_fence to timeline_fence

FromGustavo Padovan <gustavo@padovan.org>
Date2016-01-26 19:40 +0100
Subject[PATCH 08/11] staging/android: rename android_fence to timeline_fence
Message-ID<qVgH1-88L-49@gated-at.bofh.it>
In reply to#1318235
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

We are moving out of staging/adroid so rename it to a name that is not
related to android anymore.

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

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 07fe995..ea816dd 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -28,7 +28,7 @@
 #define CREATE_TRACE_POINTS
 #include "trace/sync.h"
 
-static const struct fence_ops android_fence_ops;
+static const struct fence_ops timeline_fence_ops;
 
 struct sync_timeline *sync_timeline_create(int size, const char *drv_name,
 					   const char *name)
@@ -126,7 +126,7 @@ struct fence *sync_pt_create(struct sync_timeline *obj, int size,
 
 	spin_lock_irqsave(&obj->child_list_lock, flags);
 	sync_timeline_get(obj);
-	fence_init(fence, &android_fence_ops, &obj->child_list_lock,
+	fence_init(fence, &timeline_fence_ops, &obj->child_list_lock,
 		   obj->context, value);
 	list_add_tail(&fence->child_list, &obj->child_list_head);
 	INIT_LIST_HEAD(&fence->active_list);
@@ -135,21 +135,21 @@ struct fence *sync_pt_create(struct sync_timeline *obj, int size,
 }
 EXPORT_SYMBOL(sync_pt_create);
 
-static const char *android_fence_get_driver_name(struct fence *fence)
+static const char *timeline_fence_get_driver_name(struct fence *fence)
 {
 	struct sync_timeline *parent = fence_parent(fence);
 
 	return parent->drv_name;
 }
 
-static const char *android_fence_get_timeline_name(struct fence *fence)
+static const char *timeline_fence_get_timeline_name(struct fence *fence)
 {
 	struct sync_timeline *parent = fence_parent(fence);
 
 	return parent->name;
 }
 
-static void android_fence_release(struct fence *fence)
+static void timeline_fence_release(struct fence *fence)
 {
 	struct sync_timeline *parent = fence_parent(fence);
 	unsigned long flags;
@@ -164,25 +164,25 @@ static void android_fence_release(struct fence *fence)
 	fence_free(fence);
 }
 
-static bool android_fence_signaled(struct fence *fence)
+static bool timeline_fence_signaled(struct fence *fence)
 {
 	struct sync_timeline *parent = fence_parent(fence);
 
 	return (fence->seqno > parent->value) ? false : true;
 }
 
-static bool android_fence_enable_signaling(struct fence *fence)
+static bool timeline_fence_enable_signaling(struct fence *fence)
 {
 	struct sync_timeline *parent = fence_parent(fence);
 
-	if (android_fence_signaled(fence))
+	if (timeline_fence_signaled(fence))
 		return false;
 
 	list_add_tail(&fence->active_list, &parent->active_list_head);
 	return true;
 }
 
-static int android_fence_fill_driver_data(struct fence *fence,
+static int timeline_fence_fill_driver_data(struct fence *fence,
 					  void *data, int size)
 {
 	if (size < sizeof(fence->seqno))
@@ -193,13 +193,13 @@ static int android_fence_fill_driver_data(struct fence *fence,
 	return sizeof(fence->seqno);
 }
 
-static void android_fence_value_str(struct fence *fence,
+static void timeline_fence_value_str(struct fence *fence,
 				    char *str, int size)
 {
 	snprintf(str, size, "%d", fence->seqno);
 }
 
-static void android_fence_timeline_value_str(struct fence *fence,
+static void timeline_fence_timeline_value_str(struct fence *fence,
 					     char *str, int size)
 {
 	struct sync_timeline *parent = fence_parent(fence);
@@ -207,15 +207,15 @@ static void android_fence_timeline_value_str(struct fence *fence,
 	snprintf(str, size, "%d", parent->value);
 }
 
-static const struct fence_ops android_fence_ops = {
-	.get_driver_name = android_fence_get_driver_name,
-	.get_timeline_name = android_fence_get_timeline_name,
-	.enable_signaling = android_fence_enable_signaling,
-	.signaled = android_fence_signaled,
+static const struct fence_ops timeline_fence_ops = {
+	.get_driver_name = timeline_fence_get_driver_name,
+	.get_timeline_name = timeline_fence_get_timeline_name,
+	.enable_signaling = timeline_fence_enable_signaling,
+	.signaled = timeline_fence_signaled,
 	.wait = fence_default_wait,
-	.release = android_fence_release,
-	.fill_driver_data = android_fence_fill_driver_data,
-	.fence_value_str = android_fence_value_str,
-	.timeline_value_str = android_fence_timeline_value_str,
+	.release = timeline_fence_release,
+	.fill_driver_data = timeline_fence_fill_driver_data,
+	.fence_value_str = timeline_fence_value_str,
+	.timeline_value_str = timeline_fence_timeline_value_str,
 };
 
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1318243 — [PATCH 10/11] dma-buf/sync_file: bring debug back to sync file

FromGustavo Padovan <gustavo@padovan.org>
Date2016-01-26 19:40 +0100
Subject[PATCH 10/11] dma-buf/sync_file: bring debug back to sync file
Message-ID<qVgH2-88L-59@gated-at.bofh.it>
In reply to#1318235
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Enable reports of sync_files through <debugfs>/sync/info

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/dma-buf/sync_file.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 92474dd..aa1215d 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -29,6 +29,8 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/sync_file.h>
 
+#include "sync_debug.h"
+
 static const struct file_operations sync_file_fops;
 
 static struct sync_file *sync_file_alloc(int size, const char *name)
@@ -87,6 +89,8 @@ struct sync_file *sync_file_create(const char *name, struct fence *fence)
 			       fence_check_cb_func))
 		atomic_dec(&sync_file->status);
 
+	sync_file_debug_add(sync_file);
+
 	return sync_file;
 }
 EXPORT_SYMBOL(sync_file_create);
@@ -188,6 +192,7 @@ struct sync_file *sync_file_merge(const char *name,
 		atomic_sub(num_fences - i, &sync_file->status);
 	sync_file->num_fences = i;
 
+	sync_file_debug_add(sync_file);
 	return sync_file;
 }
 EXPORT_SYMBOL(sync_file_merge);
@@ -246,6 +251,8 @@ static int sync_file_release(struct inode *inode, struct file *file)
 {
 	struct sync_file *sync_file = file->private_data;
 
+	sync_file_debug_remove(sync_file);
+
 	kref_put(&sync_file->kref, sync_file_free);
 	return 0;
 }
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1318245 — [PATCH 03/11] staging/android: remove .fill_driver_data() timeline ops

FromGustavo Padovan <gustavo@padovan.org>
Date2016-01-26 19:40 +0100
Subject[PATCH 03/11] staging/android: remove .fill_driver_data() timeline ops
Message-ID<qVgH2-88L-65@gated-at.bofh.it>
In reply to#1318235
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

The .fill_driver_data() ops was just a useless abstraction for
fence_ops op of the same name.

Now that we use fence->seqno to store the value it is cleaner to
remove the abstraction and fill the data directly.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/sw_sync.c | 14 --------------
 drivers/staging/android/sync.c    |  9 +++++----
 drivers/staging/android/sync.h    |  7 -------
 3 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index b9d53d3..428e22c 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -38,19 +38,6 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value)
 }
 EXPORT_SYMBOL(sw_sync_pt_create);
 
-static int sw_sync_fill_driver_data(struct fence *fence,
-				    void *data, int size)
-{
-	struct sw_sync_pt *pt = (struct sw_sync_pt *)fence;
-
-	if (size < sizeof(pt->value))
-		return -ENOMEM;
-
-	memcpy(data, &pt->value, sizeof(pt->value));
-
-	return sizeof(pt->value);
-}
-
 static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline,
 				       char *str, int size)
 {
@@ -68,7 +55,6 @@ static void sw_sync_fence_value_str(struct fence *fence, char *str, int size)
 
 static struct sync_timeline_ops sw_sync_timeline_ops = {
 	.driver_name = "sw_sync",
-	.fill_driver_data = sw_sync_fill_driver_data,
 	.timeline_value_str = sw_sync_timeline_value_str,
 	.fence_value_str = sw_sync_fence_value_str,
 };
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 4eea5c3..39af5fb 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -185,11 +185,12 @@ static bool android_fence_enable_signaling(struct fence *fence)
 static int android_fence_fill_driver_data(struct fence *fence,
 					  void *data, int size)
 {
-	struct sync_timeline *parent = fence_parent(fence);
+	if (size < sizeof(fence->seqno))
+		return -ENOMEM;
+
+	memcpy(data, &fence->seqno, sizeof(fence->seqno));
 
-	if (!parent->ops->fill_driver_data)
-		return 0;
-	return parent->ops->fill_driver_data(fence, data, size);
+	return sizeof(fence->seqno);
 }
 
 static void android_fence_value_str(struct fence *fence,
diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h
index 4d3dfbf..500838b 100644
--- a/drivers/staging/android/sync.h
+++ b/drivers/staging/android/sync.h
@@ -27,10 +27,6 @@ struct sync_timeline;
 /**
  * struct sync_timeline_ops - sync object implementation ops
  * @driver_name:	name of the implementation
- * @fill_driver_data:	write implementation specific driver data to data.
- *			  should return an error if there is not enough room
- *			  as specified by size.  This information is returned
- *			  to userspace by SYNC_IOC_FENCE_INFO.
  * @timeline_value_str: fill str with the value of the sync_timeline's counter
  * @fence_value_str:	fill str with the value of the fence
  */
@@ -38,9 +34,6 @@ struct sync_timeline_ops {
 	const char *driver_name;
 
 	/* optional */
-	int (*fill_driver_data)(struct fence *fence, void *data, int size);
-
-	/* optional */
 	void (*timeline_value_str)(struct sync_timeline *timeline, char *str,
 				   int size);
 
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1318247 — [PATCH 11/11] dma-buf/sync_file: bring sync_dump() back

FromGustavo Padovan <gustavo@padovan.org>
Date2016-01-26 19:40 +0100
Subject[PATCH 11/11] dma-buf/sync_file: bring sync_dump() back
Message-ID<qVgH2-88L-63@gated-at.bofh.it>
In reply to#1318235
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

During the de-stage of sync framework it was easy to keep sync_dump() out
to avoid an early de-stage of all debug code, but now that sync_debug.c
was de-staged bring sync_dump() back.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/dma-buf/sync_file.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index aa1215d..fd7e3b9 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -218,15 +218,19 @@ int sync_file_wait(struct sync_file *sync_file, long timeout)
 	if (ret < 0) {
 		return ret;
 	} else if (ret == 0) {
-		if (timeout)
+		if (timeout) {
 			pr_info("sync_file timeout on [%p] after %dms\n",
 				sync_file, jiffies_to_msecs(timeout));
+			sync_dump();
+		}
 		return -ETIME;
 	}
 
 	ret = atomic_read(&sync_file->status);
-	if (ret)
+	if (ret) {
 		pr_info("sync_file error %ld on [%p]\n", ret, sync_file);
+		sync_dump();
+	}
 
 	return ret;
 }
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1318327 — Re: [PATCH 09/11] dma-buf/sync_timeline: de-stage sync_timeline

FromGustavo Padovan <gustavo@padovan.org>
Date2016-01-26 21:10 +0100
SubjectRe: [PATCH 09/11] dma-buf/sync_timeline: de-stage sync_timeline
Message-ID<qVi66-No-1@gated-at.bofh.it>
In reply to#1318235
2016-01-26 Gustavo Padovan <gustavo@padovan.org>:

> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> De-stage the remaining bit of sync framework: sync_timeline and sw_sync
> plus some debugging routines.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/dma-buf/Kconfig                |  10 +
>  drivers/dma-buf/Makefile               |   3 +-
>  drivers/dma-buf/sw_sync.h              |  32 +++
>  drivers/dma-buf/sync_debug.c           | 374 +++++++++++++++++++++++++++++++++
>  drivers/dma-buf/sync_debug.h           |  35 +++
>  drivers/dma-buf/sync_timeline.c        | 222 +++++++++++++++++++
>  drivers/staging/android/Kconfig        |  20 --
>  drivers/staging/android/sync.c         | 221 -------------------
>  drivers/staging/android/sync.h         | 130 ------------
>  drivers/staging/android/sync_debug.c   | 373 --------------------------------
>  drivers/staging/android/trace/sync.h   |  32 ---
>  drivers/staging/android/uapi/sw_sync.h |  32 ---
>  include/linux/sync_timeline.h          | 114 ++++++++++
>  include/trace/events/sync_timeline.h   |  31 +++
>  14 files changed, 820 insertions(+), 809 deletions(-)
>  create mode 100644 drivers/dma-buf/sw_sync.h
>  create mode 100644 drivers/dma-buf/sync_debug.c
>  create mode 100644 drivers/dma-buf/sync_debug.h
>  create mode 100644 drivers/dma-buf/sync_timeline.c
>  delete mode 100644 drivers/staging/android/sync.c
>  delete mode 100644 drivers/staging/android/sync.h
>  delete mode 100644 drivers/staging/android/sync_debug.c
>  delete mode 100644 drivers/staging/android/trace/sync.h
>  delete mode 100644 drivers/staging/android/uapi/sw_sync.h
>  create mode 100644 include/linux/sync_timeline.h
>  create mode 100644 include/trace/events/sync_timeline.h

Seems I forgot git format-patch -M. I'll resend the series.

	Gustavo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web