Re: [Intel-gfx] [PATCH 03/13] staging/android/sync: Move sync framework out of staging

2015-12-22 Thread John Harrison

On 21/12/2015 15:46, Daniel Vetter wrote:

On Mon, Dec 21, 2015 at 02:20:59PM +, John Harrison wrote:

On 21/12/2015 10:03, Daniel Vetter wrote:

On Thu, Dec 17, 2015 at 09:35:03AM -0800, Jesse Barnes wrote:

On 12/11/2015 05:11 AM, john.c.harri...@intel.com wrote:

From: John Harrison 

The sync framework is now used by the i915 driver. Therefore it can be
moved out of staging and into the regular tree. Also, the public
interfaces can actually be made public and exported.

v3: New patch for series.

Signed-off-by: John Harrison 
Signed-off-by: Geoff Miller 
---
  drivers/android/Kconfig|  28 ++
  drivers/android/Makefile   |   2 +
  drivers/android/sw_sync.c  | 260 
  drivers/android/sw_sync.h  |  59 +++
  drivers/android/sync.c | 734 +
  drivers/android/sync.h | 366 
  drivers/android/sync_debug.c   | 256 
  drivers/android/trace/sync.h   |  82 
  drivers/staging/android/Kconfig|  28 --
  drivers/staging/android/Makefile   |   2 -
  drivers/staging/android/sw_sync.c  | 260 
  drivers/staging/android/sw_sync.h  |  59 ---
  drivers/staging/android/sync.c | 734 -
  drivers/staging/android/sync.h | 366 
  drivers/staging/android/sync_debug.c   | 256 
  drivers/staging/android/trace/sync.h   |  82 
  drivers/staging/android/uapi/sw_sync.h |  32 --
  drivers/staging/android/uapi/sync.h|  97 -
  include/uapi/Kbuild|   1 +
  include/uapi/sync/Kbuild   |   3 +
  include/uapi/sync/sw_sync.h|  32 ++
  include/uapi/sync/sync.h   |  97 +
  22 files changed, 1920 insertions(+), 1916 deletions(-)
  create mode 100644 drivers/android/sw_sync.c
  create mode 100644 drivers/android/sw_sync.h
  create mode 100644 drivers/android/sync.c
  create mode 100644 drivers/android/sync.h
  create mode 100644 drivers/android/sync_debug.c
  create mode 100644 drivers/android/trace/sync.h
  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/uapi/sync/Kbuild
  create mode 100644 include/uapi/sync/sw_sync.h
  create mode 100644 include/uapi/sync/sync.h

diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
index bdfc6c6..9edcd8f 100644
--- a/drivers/android/Kconfig
+++ b/drivers/android/Kconfig
@@ -32,6 +32,34 @@ config ANDROID_BINDER_IPC_32BIT
  Note that enabling this will break newer Android user-space.
+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
+   ---help---
+ A sync object driver that uses a 32bit counter to coordinate
+ synchronization.  Useful when there is no hardware primitive backing
+ the synchronization.
+
+config SW_SYNC_USER
+   bool "Userspace API for SW_SYNC"
+   default n
+   depends on SW_SYNC
+   ---help---
+ Provides a user space API to the sw sync object.
+ *WARNING* improper use of this can result in deadlocking kernel
+ drivers from userspace.
+
  endif # if ANDROID

IIRC we wanted to drop the user ABI altogether?  I think we can de-stage
this even before we push the new ABI on the i915 side to expose the sync
points (since we'll need an open source userspace for that), and any
changes/cleanups can happen outside of staging.

Just a head-up: Gustavo Padovan from Collabora is working to de-stage all
the syncpt stuff. Greg KH merged the TODO update for that work for 4.5,
which covers consensus (including ack from Google's Greg Hackmann on the
plan). Given that I think it'd be best to freeload on that effort. But
that means we need to push all the android/syncpt stuff down in the
series. I hope that works, and there's no functional depencies in the
fence conversion/scheduler core?

Thanks, Daniel

Do you have any idea on the timescale for their destaging? Is it definitely,
definitely happening or still just a 'some point in the future it would be
nice to...'? The 

Re: [Intel-gfx] [PATCH 03/13] staging/android/sync: Move sync framework out of staging

2015-12-21 Thread John Harrison

On 21/12/2015 10:03, Daniel Vetter wrote:

On Thu, Dec 17, 2015 at 09:35:03AM -0800, Jesse Barnes wrote:

On 12/11/2015 05:11 AM, john.c.harri...@intel.com wrote:

From: John Harrison 

The sync framework is now used by the i915 driver. Therefore it can be
moved out of staging and into the regular tree. Also, the public
interfaces can actually be made public and exported.

v3: New patch for series.

Signed-off-by: John Harrison 
Signed-off-by: Geoff Miller 
---
  drivers/android/Kconfig|  28 ++
  drivers/android/Makefile   |   2 +
  drivers/android/sw_sync.c  | 260 
  drivers/android/sw_sync.h  |  59 +++
  drivers/android/sync.c | 734 +
  drivers/android/sync.h | 366 
  drivers/android/sync_debug.c   | 256 
  drivers/android/trace/sync.h   |  82 
  drivers/staging/android/Kconfig|  28 --
  drivers/staging/android/Makefile   |   2 -
  drivers/staging/android/sw_sync.c  | 260 
  drivers/staging/android/sw_sync.h  |  59 ---
  drivers/staging/android/sync.c | 734 -
  drivers/staging/android/sync.h | 366 
  drivers/staging/android/sync_debug.c   | 256 
  drivers/staging/android/trace/sync.h   |  82 
  drivers/staging/android/uapi/sw_sync.h |  32 --
  drivers/staging/android/uapi/sync.h|  97 -
  include/uapi/Kbuild|   1 +
  include/uapi/sync/Kbuild   |   3 +
  include/uapi/sync/sw_sync.h|  32 ++
  include/uapi/sync/sync.h   |  97 +
  22 files changed, 1920 insertions(+), 1916 deletions(-)
  create mode 100644 drivers/android/sw_sync.c
  create mode 100644 drivers/android/sw_sync.h
  create mode 100644 drivers/android/sync.c
  create mode 100644 drivers/android/sync.h
  create mode 100644 drivers/android/sync_debug.c
  create mode 100644 drivers/android/trace/sync.h
  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/uapi/sync/Kbuild
  create mode 100644 include/uapi/sync/sw_sync.h
  create mode 100644 include/uapi/sync/sync.h

diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
index bdfc6c6..9edcd8f 100644
--- a/drivers/android/Kconfig
+++ b/drivers/android/Kconfig
@@ -32,6 +32,34 @@ config ANDROID_BINDER_IPC_32BIT
  
  	  Note that enabling this will break newer Android user-space.
  
+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
+   ---help---
+ A sync object driver that uses a 32bit counter to coordinate
+ synchronization.  Useful when there is no hardware primitive backing
+ the synchronization.
+
+config SW_SYNC_USER
+   bool "Userspace API for SW_SYNC"
+   default n
+   depends on SW_SYNC
+   ---help---
+ Provides a user space API to the sw sync object.
+ *WARNING* improper use of this can result in deadlocking kernel
+ drivers from userspace.
+
  endif # if ANDROID

IIRC we wanted to drop the user ABI altogether?  I think we can de-stage
this even before we push the new ABI on the i915 side to expose the sync
points (since we'll need an open source userspace for that), and any
changes/cleanups can happen outside of staging.

Just a head-up: Gustavo Padovan from Collabora is working to de-stage all
the syncpt stuff. Greg KH merged the TODO update for that work for 4.5,
which covers consensus (including ack from Google's Greg Hackmann on the
plan). Given that I think it'd be best to freeload on that effort. But
that means we need to push all the android/syncpt stuff down in the
series. I hope that works, and there's no functional depencies in the
fence conversion/scheduler core?

Thanks, Daniel


Do you have any idea on the timescale for their destaging? Is it 
definitely, definitely happening or still just a 'some point in the 
future it would be nice to...'? The Android driver certainly needs it 
and I believe Jesse's bufferless work will require it too. So sooner is 

Re: [Intel-gfx] [PATCH 03/13] staging/android/sync: Move sync framework out of staging

2015-12-21 Thread Daniel Vetter
On Thu, Dec 17, 2015 at 09:35:03AM -0800, Jesse Barnes wrote:
> On 12/11/2015 05:11 AM, john.c.harri...@intel.com wrote:
> > From: John Harrison 
> > 
> > The sync framework is now used by the i915 driver. Therefore it can be
> > moved out of staging and into the regular tree. Also, the public
> > interfaces can actually be made public and exported.
> > 
> > v3: New patch for series.
> > 
> > Signed-off-by: John Harrison 
> > Signed-off-by: Geoff Miller 
> > ---
> >  drivers/android/Kconfig|  28 ++
> >  drivers/android/Makefile   |   2 +
> >  drivers/android/sw_sync.c  | 260 
> >  drivers/android/sw_sync.h  |  59 +++
> >  drivers/android/sync.c | 734 
> > +
> >  drivers/android/sync.h | 366 
> >  drivers/android/sync_debug.c   | 256 
> >  drivers/android/trace/sync.h   |  82 
> >  drivers/staging/android/Kconfig|  28 --
> >  drivers/staging/android/Makefile   |   2 -
> >  drivers/staging/android/sw_sync.c  | 260 
> >  drivers/staging/android/sw_sync.h  |  59 ---
> >  drivers/staging/android/sync.c | 734 
> > -
> >  drivers/staging/android/sync.h | 366 
> >  drivers/staging/android/sync_debug.c   | 256 
> >  drivers/staging/android/trace/sync.h   |  82 
> >  drivers/staging/android/uapi/sw_sync.h |  32 --
> >  drivers/staging/android/uapi/sync.h|  97 -
> >  include/uapi/Kbuild|   1 +
> >  include/uapi/sync/Kbuild   |   3 +
> >  include/uapi/sync/sw_sync.h|  32 ++
> >  include/uapi/sync/sync.h   |  97 +
> >  22 files changed, 1920 insertions(+), 1916 deletions(-)
> >  create mode 100644 drivers/android/sw_sync.c
> >  create mode 100644 drivers/android/sw_sync.h
> >  create mode 100644 drivers/android/sync.c
> >  create mode 100644 drivers/android/sync.h
> >  create mode 100644 drivers/android/sync_debug.c
> >  create mode 100644 drivers/android/trace/sync.h
> >  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/uapi/sync/Kbuild
> >  create mode 100644 include/uapi/sync/sw_sync.h
> >  create mode 100644 include/uapi/sync/sync.h
> > 
> > diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
> > index bdfc6c6..9edcd8f 100644
> > --- a/drivers/android/Kconfig
> > +++ b/drivers/android/Kconfig
> > @@ -32,6 +32,34 @@ config ANDROID_BINDER_IPC_32BIT
> >  
> >   Note that enabling this will break newer Android user-space.
> >  
> > +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
> > +   ---help---
> > + A sync object driver that uses a 32bit counter to coordinate
> > + synchronization.  Useful when there is no hardware primitive backing
> > + the synchronization.
> > +
> > +config SW_SYNC_USER
> > +   bool "Userspace API for SW_SYNC"
> > +   default n
> > +   depends on SW_SYNC
> > +   ---help---
> > + Provides a user space API to the sw sync object.
> > + *WARNING* improper use of this can result in deadlocking kernel
> > + drivers from userspace.
> > +
> >  endif # if ANDROID
> 
> IIRC we wanted to drop the user ABI altogether?  I think we can de-stage
> this even before we push the new ABI on the i915 side to expose the sync
> points (since we'll need an open source userspace for that), and any
> changes/cleanups can happen outside of staging.

Just a head-up: Gustavo Padovan from Collabora is working to de-stage all
the syncpt stuff. Greg KH merged the TODO update for that work for 4.5,
which covers consensus (including ack from Google's Greg Hackmann on the
plan). Given that I think it'd be best to freeload on that effort. But
that means we need to push all the android/syncpt stuff down in the
series. I hope that works, and there's no functional depencies in the
fence conversion/scheduler core?

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Re: [Intel-gfx] [PATCH 03/13] staging/android/sync: Move sync framework out of staging

2015-12-21 Thread Daniel Vetter
On Mon, Dec 21, 2015 at 02:20:59PM +, John Harrison wrote:
> On 21/12/2015 10:03, Daniel Vetter wrote:
> >On Thu, Dec 17, 2015 at 09:35:03AM -0800, Jesse Barnes wrote:
> >>On 12/11/2015 05:11 AM, john.c.harri...@intel.com wrote:
> >>>From: John Harrison 
> >>>
> >>>The sync framework is now used by the i915 driver. Therefore it can be
> >>>moved out of staging and into the regular tree. Also, the public
> >>>interfaces can actually be made public and exported.
> >>>
> >>>v3: New patch for series.
> >>>
> >>>Signed-off-by: John Harrison 
> >>>Signed-off-by: Geoff Miller 
> >>>---
> >>>  drivers/android/Kconfig|  28 ++
> >>>  drivers/android/Makefile   |   2 +
> >>>  drivers/android/sw_sync.c  | 260 
> >>>  drivers/android/sw_sync.h  |  59 +++
> >>>  drivers/android/sync.c | 734 
> >>> +
> >>>  drivers/android/sync.h | 366 
> >>>  drivers/android/sync_debug.c   | 256 
> >>>  drivers/android/trace/sync.h   |  82 
> >>>  drivers/staging/android/Kconfig|  28 --
> >>>  drivers/staging/android/Makefile   |   2 -
> >>>  drivers/staging/android/sw_sync.c  | 260 
> >>>  drivers/staging/android/sw_sync.h  |  59 ---
> >>>  drivers/staging/android/sync.c | 734 
> >>> -
> >>>  drivers/staging/android/sync.h | 366 
> >>>  drivers/staging/android/sync_debug.c   | 256 
> >>>  drivers/staging/android/trace/sync.h   |  82 
> >>>  drivers/staging/android/uapi/sw_sync.h |  32 --
> >>>  drivers/staging/android/uapi/sync.h|  97 -
> >>>  include/uapi/Kbuild|   1 +
> >>>  include/uapi/sync/Kbuild   |   3 +
> >>>  include/uapi/sync/sw_sync.h|  32 ++
> >>>  include/uapi/sync/sync.h   |  97 +
> >>>  22 files changed, 1920 insertions(+), 1916 deletions(-)
> >>>  create mode 100644 drivers/android/sw_sync.c
> >>>  create mode 100644 drivers/android/sw_sync.h
> >>>  create mode 100644 drivers/android/sync.c
> >>>  create mode 100644 drivers/android/sync.h
> >>>  create mode 100644 drivers/android/sync_debug.c
> >>>  create mode 100644 drivers/android/trace/sync.h
> >>>  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/uapi/sync/Kbuild
> >>>  create mode 100644 include/uapi/sync/sw_sync.h
> >>>  create mode 100644 include/uapi/sync/sync.h
> >>>
> >>>diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
> >>>index bdfc6c6..9edcd8f 100644
> >>>--- a/drivers/android/Kconfig
> >>>+++ b/drivers/android/Kconfig
> >>>@@ -32,6 +32,34 @@ config ANDROID_BINDER_IPC_32BIT
> >>> Note that enabling this will break newer Android user-space.
> >>>+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
> >>>+  ---help---
> >>>+A sync object driver that uses a 32bit counter to coordinate
> >>>+synchronization.  Useful when there is no hardware primitive backing
> >>>+the synchronization.
> >>>+
> >>>+config SW_SYNC_USER
> >>>+  bool "Userspace API for SW_SYNC"
> >>>+  default n
> >>>+  depends on SW_SYNC
> >>>+  ---help---
> >>>+Provides a user space API to the sw sync object.
> >>>+*WARNING* improper use of this can result in deadlocking kernel
> >>>+drivers from userspace.
> >>>+
> >>>  endif # if ANDROID
> >>IIRC we wanted to drop the user ABI altogether?  I think we can de-stage
> >>this even before we push the new ABI on the i915 side to expose the sync
> >>points (since we'll need an open source userspace for that), and any
> >>changes/cleanups can happen outside of staging.
> >Just a head-up: Gustavo Padovan from Collabora is working to de-stage all
> >the syncpt stuff. Greg KH merged the TODO update for that work for 4.5,
> >which covers consensus (including ack from Google's Greg Hackmann on the
> >plan). Given that I think it'd be best to freeload on that effort. But
> >that means we need to push all the 

Re: [Intel-gfx] [PATCH 03/13] staging/android/sync: Move sync framework out of staging

2015-12-17 Thread Jesse Barnes
On 12/11/2015 05:11 AM, john.c.harri...@intel.com wrote:
> From: John Harrison 
> 
> The sync framework is now used by the i915 driver. Therefore it can be
> moved out of staging and into the regular tree. Also, the public
> interfaces can actually be made public and exported.
> 
> v3: New patch for series.
> 
> Signed-off-by: John Harrison 
> Signed-off-by: Geoff Miller 
> ---
>  drivers/android/Kconfig|  28 ++
>  drivers/android/Makefile   |   2 +
>  drivers/android/sw_sync.c  | 260 
>  drivers/android/sw_sync.h  |  59 +++
>  drivers/android/sync.c | 734 
> +
>  drivers/android/sync.h | 366 
>  drivers/android/sync_debug.c   | 256 
>  drivers/android/trace/sync.h   |  82 
>  drivers/staging/android/Kconfig|  28 --
>  drivers/staging/android/Makefile   |   2 -
>  drivers/staging/android/sw_sync.c  | 260 
>  drivers/staging/android/sw_sync.h  |  59 ---
>  drivers/staging/android/sync.c | 734 
> -
>  drivers/staging/android/sync.h | 366 
>  drivers/staging/android/sync_debug.c   | 256 
>  drivers/staging/android/trace/sync.h   |  82 
>  drivers/staging/android/uapi/sw_sync.h |  32 --
>  drivers/staging/android/uapi/sync.h|  97 -
>  include/uapi/Kbuild|   1 +
>  include/uapi/sync/Kbuild   |   3 +
>  include/uapi/sync/sw_sync.h|  32 ++
>  include/uapi/sync/sync.h   |  97 +
>  22 files changed, 1920 insertions(+), 1916 deletions(-)
>  create mode 100644 drivers/android/sw_sync.c
>  create mode 100644 drivers/android/sw_sync.h
>  create mode 100644 drivers/android/sync.c
>  create mode 100644 drivers/android/sync.h
>  create mode 100644 drivers/android/sync_debug.c
>  create mode 100644 drivers/android/trace/sync.h
>  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/uapi/sync/Kbuild
>  create mode 100644 include/uapi/sync/sw_sync.h
>  create mode 100644 include/uapi/sync/sync.h
> 
> diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
> index bdfc6c6..9edcd8f 100644
> --- a/drivers/android/Kconfig
> +++ b/drivers/android/Kconfig
> @@ -32,6 +32,34 @@ config ANDROID_BINDER_IPC_32BIT
>  
> Note that enabling this will break newer Android user-space.
>  
> +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
> + ---help---
> +   A sync object driver that uses a 32bit counter to coordinate
> +   synchronization.  Useful when there is no hardware primitive backing
> +   the synchronization.
> +
> +config SW_SYNC_USER
> + bool "Userspace API for SW_SYNC"
> + default n
> + depends on SW_SYNC
> + ---help---
> +   Provides a user space API to the sw sync object.
> +   *WARNING* improper use of this can result in deadlocking kernel
> +   drivers from userspace.
> +
>  endif # if ANDROID

IIRC we wanted to drop the user ABI altogether?  I think we can de-stage this 
even before we push the new ABI on the i915 side to expose the sync points 
(since we'll need an open source userspace for that), and any changes/cleanups 
can happen outside of staging.

Thanks,
Jesse

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 03/13] staging/android/sync: Move sync framework out of staging

2015-12-11 Thread John . C . Harrison
From: John Harrison 

The sync framework is now used by the i915 driver. Therefore it can be
moved out of staging and into the regular tree. Also, the public
interfaces can actually be made public and exported.

v3: New patch for series.

Signed-off-by: John Harrison 
Signed-off-by: Geoff Miller 
---
 drivers/android/Kconfig|  28 ++
 drivers/android/Makefile   |   2 +
 drivers/android/sw_sync.c  | 260 
 drivers/android/sw_sync.h  |  59 +++
 drivers/android/sync.c | 734 +
 drivers/android/sync.h | 366 
 drivers/android/sync_debug.c   | 256 
 drivers/android/trace/sync.h   |  82 
 drivers/staging/android/Kconfig|  28 --
 drivers/staging/android/Makefile   |   2 -
 drivers/staging/android/sw_sync.c  | 260 
 drivers/staging/android/sw_sync.h  |  59 ---
 drivers/staging/android/sync.c | 734 -
 drivers/staging/android/sync.h | 366 
 drivers/staging/android/sync_debug.c   | 256 
 drivers/staging/android/trace/sync.h   |  82 
 drivers/staging/android/uapi/sw_sync.h |  32 --
 drivers/staging/android/uapi/sync.h|  97 -
 include/uapi/Kbuild|   1 +
 include/uapi/sync/Kbuild   |   3 +
 include/uapi/sync/sw_sync.h|  32 ++
 include/uapi/sync/sync.h   |  97 +
 22 files changed, 1920 insertions(+), 1916 deletions(-)
 create mode 100644 drivers/android/sw_sync.c
 create mode 100644 drivers/android/sw_sync.h
 create mode 100644 drivers/android/sync.c
 create mode 100644 drivers/android/sync.h
 create mode 100644 drivers/android/sync_debug.c
 create mode 100644 drivers/android/trace/sync.h
 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/uapi/sync/Kbuild
 create mode 100644 include/uapi/sync/sw_sync.h
 create mode 100644 include/uapi/sync/sync.h

diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
index bdfc6c6..9edcd8f 100644
--- a/drivers/android/Kconfig
+++ b/drivers/android/Kconfig
@@ -32,6 +32,34 @@ config ANDROID_BINDER_IPC_32BIT
 
  Note that enabling this will break newer Android user-space.
 
+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
+   ---help---
+ A sync object driver that uses a 32bit counter to coordinate
+ synchronization.  Useful when there is no hardware primitive backing
+ the synchronization.
+
+config SW_SYNC_USER
+   bool "Userspace API for SW_SYNC"
+   default n
+   depends on SW_SYNC
+   ---help---
+ Provides a user space API to the sw sync object.
+ *WARNING* improper use of this can result in deadlocking kernel
+ drivers from userspace.
+
 endif # if ANDROID
 
 endmenu
diff --git a/drivers/android/Makefile b/drivers/android/Makefile
index 3b7e4b0..a1465dd 100644
--- a/drivers/android/Makefile
+++ b/drivers/android/Makefile
@@ -1,3 +1,5 @@
 ccflags-y += -I$(src)  # needed for trace events
 
 obj-$(CONFIG_ANDROID_BINDER_IPC)   += binder.o
+obj-$(CONFIG_SYNC) += sync.o sync_debug.o
+obj-$(CONFIG_SW_SYNC)  += sw_sync.o
diff --git a/drivers/android/sw_sync.c b/drivers/android/sw_sync.c
new file mode 100644
index 000..c4ff167
--- /dev/null
+++ b/drivers/android/sw_sync.c
@@ -0,0 +1,260 @@
+/*
+ * drivers/base/sw_sync.c
+ *
+ * Copyright (C) 2012 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include