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,
	"Daniel Stone" <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>,
	"Gustavo Padovan" <gustavo.padovan@collabora.co.uk>,
	"John Harrison" <John.C.Harrison@Intel.com>
Subject: [PATCH v2 09/11] dma-buf/sync_timeline: de-stage sync_timeline
Date: Wed, 27 Jan 2016 11:30:37 -0200	[thread overview]
Message-ID: <1453901439-19467-10-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1453901439-19467-1-git-send-email-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 +-
 .../{staging/android/uapi => dma-buf}/sw_sync.h    |  0
 drivers/{staging/android => dma-buf}/sync_debug.c  |  5 ++--
 drivers/dma-buf/sync_debug.h                       | 35 ++++++++++++++++++++++
 .../android/sync.c => dma-buf/sync_timeline.c}     |  7 +++--
 drivers/staging/android/Kconfig                    | 20 -------------
 .../sync.h => include/linux/sync_timeline.h        | 24 +++------------
 .../sync.h => include/trace/events/sync_timeline.h |  9 +++---
 9 files changed, 62 insertions(+), 51 deletions(-)
 rename drivers/{staging/android/uapi => dma-buf}/sw_sync.h (100%)
 rename drivers/{staging/android => dma-buf}/sync_debug.c (99%)
 create mode 100644 drivers/dma-buf/sync_debug.h
 rename drivers/{staging/android/sync.c => dma-buf/sync_timeline.c} (98%)
 rename drivers/staging/android/sync.h => include/linux/sync_timeline.h (85%)
 rename drivers/staging/android/trace/sync.h => include/trace/events/sync_timeline.h (73%)

diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
index 9824bc4..73df024 100644
--- a/drivers/dma-buf/Kconfig
+++ b/drivers/dma-buf/Kconfig
@@ -8,4 +8,14 @@ config SYNC_FILE
 	---help---
 	  This option enables the fence framework synchronization to export
 	  sync_files to userspace that can represent one or more fences.
+
+config SW_SYNC
+	bool "Software synchronization objects"
+	default n
+	depends on SYNC_FILE
+	---help---
+	  A sync object driver that uses a 32bit counter to coordinate
+	  synchronization. Useful when there is no hardware primitive backing
+	  the synchronization.
+
 endmenu
diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
index 4a424ec..78d8ec4 100644
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -1,2 +1,3 @@
 obj-y := dma-buf.o fence.o reservation.o seqno-fence.o
-obj-$(CONFIG_SYNC_FILE)		+= sync_file.o
+obj-$(CONFIG_SYNC_FILE)		+= sync_file.o sync_debug.o
+obj-$(CONFIG_SW_SYNC)		+= sync_timeline.o
diff --git a/drivers/staging/android/uapi/sw_sync.h b/drivers/dma-buf/sw_sync.h
similarity index 100%
rename from drivers/staging/android/uapi/sw_sync.h
rename to drivers/dma-buf/sw_sync.h
diff --git a/drivers/staging/android/sync_debug.c b/drivers/dma-buf/sync_debug.c
similarity index 99%
rename from drivers/staging/android/sync_debug.c
rename to drivers/dma-buf/sync_debug.c
index 9312e6f..7da9ff5 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/dma-buf/sync_debug.c
@@ -30,9 +30,10 @@
 #include <linux/sync_file.h>
 #include <linux/types.h>
 #include <linux/kconfig.h>
+#include <linux/sync_timeline.h>
 
-#include "uapi/sw_sync.h"
-#include "sync.h"
+#include "sync_debug.h"
+#include "sw_sync.h"
 
 #ifdef CONFIG_DEBUG_FS
 
diff --git a/drivers/dma-buf/sync_debug.h b/drivers/dma-buf/sync_debug.h
new file mode 100644
index 0000000..5b71685
--- /dev/null
+++ b/drivers/dma-buf/sync_debug.h
@@ -0,0 +1,35 @@
+/*
+ * drivers/dma-buf/sync_debug.h
+ *
+ * Copyright (C) 2012 Google, Inc.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _LINUX_SYNC_DEBUG_H
+#define _LINUX_SYNC_DEBUG_H
+
+#include <linux/types.h>
+#include <linux/sync_timeline.h>
+#include <linux/sync_file.h>
+
+#ifdef CONFIG_DEBUG_FS
+void sync_timeline_debug_add(struct sync_timeline *obj);
+void sync_timeline_debug_remove(struct sync_timeline *obj);
+void sync_file_debug_add(struct sync_file *sync_file);
+void sync_file_debug_remove(struct sync_file *sync_file);
+void sync_dump(void);
+
+#else
+#define sync_timeline_debug_add(obj)
+#define sync_timeline_debug_remove(obj)
+#define sync_file_debug_add(fence)
+#define sync_file_debug_remove(fence)
+#define sync_dump()
+#endif
+
+#endif /* _LINUX_SYNC_DEBUG_H */
diff --git a/drivers/staging/android/sync.c b/drivers/dma-buf/sync_timeline.c
similarity index 98%
rename from drivers/staging/android/sync.c
rename to drivers/dma-buf/sync_timeline.c
index ea816dd..b354b0c 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/dma-buf/sync_timeline.c
@@ -22,11 +22,12 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/anon_inodes.h>
-
-#include "sync.h"
+#include <linux/sync_timeline.h>
 
 #define CREATE_TRACE_POINTS
-#include "trace/sync.h"
+#include <trace/events/sync_timeline.h>
+
+#include "sync_debug.h"
 
 static const struct fence_ops timeline_fence_ops;
 
diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 2756988..4b18fee 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -38,26 +38,6 @@ config ANDROID_LOW_MEMORY_KILLER
 	  scripts (/init.rc), and it defines priority values with minimum free memory size
 	  for each priority.
 
-config SYNC
-	bool "Synchronization framework"
-	default n
-	select ANON_INODES
-	select DMA_SHARED_BUFFER
-	---help---
-	  This option enables the framework for synchronization between multiple
-	  drivers.  Sync implementations can take advantage of hardware
-	  synchronization built into devices like GPUs.
-
-config SW_SYNC
-	bool "Software synchronization objects"
-	default n
-	depends on SYNC
-	depends on SYNC_FILE
-	---help---
-	  A sync object driver that uses a 32bit counter to coordinate
-	  synchronization.  Useful when there is no hardware primitive backing
-	  the synchronization.
-
 source "drivers/staging/android/ion/Kconfig"
 
 endif # if ANDROID
diff --git a/drivers/staging/android/sync.h b/include/linux/sync_timeline.h
similarity index 85%
rename from drivers/staging/android/sync.h
rename to include/linux/sync_timeline.h
index be94a80..27a2eda 100644
--- a/drivers/staging/android/sync.h
+++ b/include/linux/sync_timeline.h
@@ -1,5 +1,5 @@
 /*
- * include/linux/sync.h
+ * include/linux/sync_timeline.h
  *
  * Copyright (C) 2012 Google, Inc.
  *
@@ -10,8 +10,8 @@
  *
  */
 
-#ifndef _LINUX_SYNC_H
-#define _LINUX_SYNC_H
+#ifndef _LINUX_SYNC_TIMELINE_H
+#define _LINUX_SYNC_TIMELINE_H
 
 #include <linux/types.h>
 #include <linux/kref.h>
@@ -111,20 +111,4 @@ void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc);
 struct fence *sync_pt_create(struct sync_timeline *parent, int size,
 			     unsigned int inc);
 
-#ifdef CONFIG_DEBUG_FS
-
-void sync_timeline_debug_add(struct sync_timeline *obj);
-void sync_timeline_debug_remove(struct sync_timeline *obj);
-void sync_file_debug_add(struct sync_file *fence);
-void sync_file_debug_remove(struct sync_file *fence);
-void sync_dump(void);
-
-#else
-# define sync_timeline_debug_add(obj)
-# define sync_timeline_debug_remove(obj)
-# define sync_file_debug_add(fence)
-# define sync_file_debug_remove(fence)
-# define sync_dump()
-#endif
-
-#endif /* _LINUX_SYNC_H */
+#endif /* _LINUX_SYNC_TIMELINE_H */
diff --git a/drivers/staging/android/trace/sync.h b/include/trace/events/sync_timeline.h
similarity index 73%
rename from drivers/staging/android/trace/sync.h
rename to include/trace/events/sync_timeline.h
index d7f6457f..c4b769b 100644
--- a/drivers/staging/android/trace/sync.h
+++ b/include/trace/events/sync_timeline.h
@@ -1,11 +1,10 @@
 #undef TRACE_SYSTEM
-#define TRACE_INCLUDE_PATH ../../drivers/staging/android/trace
-#define TRACE_SYSTEM sync
+#define TRACE_SYSTEM sync_timeline
 
-#if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _TRACE_SYNC_H
+#if !defined(_TRACE_SYNC_TIMELINE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SYNC_TIMELINE_H
 
-#include "../sync.h"
+#include <linux/sync_timeline.h>
 #include <linux/tracepoint.h>
 
 TRACE_EVENT(sync_timeline,
-- 
2.5.0

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

  parent reply	other threads:[~2016-01-27 13:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 13:30 [PATCH v2 00/11] sync framework de-staging: part 2 - de-stage Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 01/11] dma-buf/sync_file: de-stage sync_file Gustavo Padovan
2016-01-27 14:31   ` Maarten Lankhorst
2016-01-27 17:03     ` Gustavo Padovan
2016-01-27 18:17       ` Emil Velikov
2016-01-27 20:25         ` Gustavo Padovan
2016-01-27 21:41           ` Greg Hackmann
2016-01-28  9:23             ` Daniel Vetter
2016-01-29 17:46               ` Greg Hackmann
2016-01-27 13:30 ` [PATCH v2 02/11] staging/android: store last signaled value on sync timeline Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 03/11] staging/android: remove .fill_driver_data() timeline ops Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 04/11] staging/android: remove .{fence, timeline}_value_str() from timeline_ops Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 05/11] staging/android: remove struct sync_timeline_ops Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 06/11] staging/android: remove sw_sync_timeline and sw_sync_pt Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 07/11] staging/android: remove sw_sync.[ch] files Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 08/11] staging/android: rename android_fence to timeline_fence Gustavo Padovan
2016-01-27 13:30 ` Gustavo Padovan [this message]
2016-01-27 13:30 ` [PATCH v2 10/11] dma-buf/sync_file: bring debug back to sync file Gustavo Padovan
2016-01-27 13:30 ` [PATCH v2 11/11] dma-buf/sync_file: bring sync_dump() back 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=1453901439-19467-10-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=gregkh@linuxfoundation.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.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).