Re: [PATCH] dma-fence: Make ->enable_signaling optional

2018-05-07 Thread Maarten Lankhorst
ABLE_SIGNAL_BIT > unconditionally, it results in an expensive spinlock take for > everyone. Instead just check if the callback is present. Suggested by > Maarten. > > Also move misplaced kerneldoc hunk to the right patch. > > Cc: Maarten Lankhorst > Reviewed-by: Christian König

Re: [PATCH] dma-fence: fix dma_fence_get_rcu_safe

2017-09-21 Thread Maarten Lankhorst
Op 21-09-17 om 09:00 schreef Christian König: > Am 20.09.2017 um 20:20 schrieb Daniel Vetter: >> On Mon, Sep 11, 2017 at 01:06:32PM +0200, Christian König wrote: >>> Am 11.09.2017 um 12:01 schrieb Chris Wilson: [SNIP] > Yeah, but that is illegal with a fence objects. > > When anybo

Re: [PATCH] dma-fence: fix dma_fence_get_rcu_safe v2

2017-09-21 Thread Maarten Lankhorst
success (such as now). >* This is paired with the write barrier from assigning Should be safe from an infinite loop since the old fence is only unreffed after the new pointer is written, so we'll always make progress. :) Reviewed-by: Maarten Lankhorst

Re: [PATCH] android: fix warning when releasing active sync point

2015-12-16 Thread Maarten Lankhorst
Op 15-12-15 om 18:19 schreef Dmitry Torokhov: > On Tue, Dec 15, 2015 at 2:01 AM, Maarten Lankhorst > wrote: >> Op 15-12-15 om 02:29 schreef Dmitry Torokhov: >>> Userspace can close the sync device while there are still active fence >>> points, in which case kernel

Re: [PATCH] android: fix warning when releasing active sync point

2015-12-15 Thread Maarten Lankhorst
Op 15-12-15 om 02:29 schreef Dmitry Torokhov: > Userspace can close the sync device while there are still active fence > points, in which case kernel produces the following warning: > > [ 43.853176] [ cut here ] > [ 43.857834] WARNING: CPU: 0 PID: 892 at > /mnt/host/sou

Re: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-01-29 Thread Maarten Lankhorst
max_segment_count = (unsigned int)-1; > + cons->max_segment_size = (unsigned int)-1; > + cons->segment_boundary_mask = (unsigned long)-1; > +} Use DMA_SEGMENTS_MAX_SEG_COUNT or UINT/ULONG_MAX here instead? Patches look sane, Reviewed-By: Maarten Lankhorst > +/* > + * calc_cons

Re: [PATCH v3] dma-buf: cleanup dma_buf_export() to make it easily extensible

2015-01-28 Thread Maarten Lankhorst
Op 28-01-15 om 13:54 schreef Sumit Semwal: > At present, dma_buf_export() takes a series of parameters, which > makes it difficult to add any new parameters for exporters, if required. > > Make it simpler by moving all these parameters into a struct, and pass > the struct * as parameter to dma_buf_

Re: [PATCH v2 0/9] Updated fence patch series

2014-07-02 Thread Maarten Lankhorst
op 02-07-14 07:37, Greg KH schreef: > On Tue, Jul 01, 2014 at 12:57:02PM +0200, Maarten Lankhorst wrote: >> So after some more hacking I've moved dma-buf to its own subdirectory, >> drivers/dma-buf and applied the fence patches to its new place. I believe >> that th

Re: [PATCH v2 1/9] dma-buf: move to drivers/dma-buf

2014-07-01 Thread Maarten Lankhorst
op 01-07-14 13:06, Arend van Spriel schreef: > On 01-07-14 12:57, Maarten Lankhorst wrote: >> Signed-off-by: Maarten Lankhorst > It would help to use '-M' option with format-patch for this kind of rework. > > Regards, > Arend > Thanks, was looking for some

[PATCH v2 2/9] fence: dma-buf cross-device synchronization (v18)

2014-07-01 Thread Maarten Lankhorst
r discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problematic. v5: [ Maarten Lankhorst ] Updated for dma-bikeshed-fence and dma-buf-manager. v6: [ Maarten Lankhorst ] I remov

[PATCH v2 3/9] seqno-fence: Hardware dma-buf implementation of fencing (v6)

2014-07-01 Thread Maarten Lankhorst
nce.h v4: Add spinlock pointer to seqno_fence_init v5: Add condition member to allow wait for != 0. Fix small style errors pointed out by checkpatch. v6: Move to a separate file. Fix up api changes in fences. Signed-off-by: Maarten Lankhorst Reviewed-by: Rob Clark #v4 --- Documentation/D

[PATCH v2 1/9] dma-buf: move to drivers/dma-buf

2014-07-01 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- Documentation/DocBook/device-drivers.tmpl |3 MAINTAINERS |4 drivers/Makefile |1 drivers/base/Makefile |1 drivers/base/dma-buf.c| 743

[PATCH v2 0/9] Updated fence patch series

2014-07-01 Thread Maarten Lankhorst
at it yet I feel it should stay in staging, for now. --- Maarten Lankhorst (9): dma-buf: move to drivers/dma-buf fence: dma-buf cross-device synchronization (v18) seqno-fence: Hardware dma-buf implementation of fencing (v6) dma-buf: use reservation objects android: co

[PATCH v2 4/9] dma-buf: use reservation objects

2014-07-01 Thread Maarten Lankhorst
This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst Acked-by: Mauro Carvalho Chehab #drivers/media/v4l2-core/ Acked-by: Thomas Hellstrom #drivers/gpu/drm/ttm Signed-o

[PATCH v2 8/9] reservation: update api and add some helpers

2014-07-01 Thread Maarten Lankhorst
. reservation_object_add_shared_fence() and reservation_object_add_excl_fence() are used to assign a new fence to a reservation_object pointer, to complete a reservation. Signed-off-by: Maarten Lankhorst Changes since v1: - Add reservation_object_get_excl, reorder code a bit. --- Documentation/DocBook/device-drivers.tmpl |1

[PATCH v2 5/9] android: convert sync to fence api, v6

2014-07-01 Thread Maarten Lankhorst
allback in sync_fence_free if not all fences have fired. v3: - Merge Colin Cross' bugfixes, and the android fence merge optimization. v4: - Merge with the upstream fixes. v5: - Fix small style issues pointed out by Thomas Hellstrom. v6: - Fix for updates to fence api. Signed-off-by: Maarten Lank

[PATCH v2 7/9] dma-buf: add poll support, v3

2014-07-01 Thread Maarten Lankhorst
Thanks to Fengguang Wu for spotting a missing static cast. v2: - Kill unused variable need_shared. v3: - Clarify the BUG() in dma_buf_release some more. (Rob Clark) Signed-off-by: Maarten Lankhorst --- drivers/dma-buf/dma-buf.c | 108 + include

[PATCH v2 6/9] reservation: add support for fences to enable cross-device synchronisation

2014-07-01 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst Reviewed-by: Rob Clark --- include/linux/reservation.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/linux/reservation.h b/include/linux/reservation.h index 813dae960ebd..f3f57460a205 100644 --- a/include

[PATCH v2 9/9] reservation: add suppport for read-only access using rcu

2014-07-01 Thread Maarten Lankhorst
is needed, rcu_dereference followed by fence_get_rcu can be used, if the shared fences are needed it's recommended to use the supplied functions. Signed-off-by: Maarten Lankhorst Reviewed-By: Thomas Hellstrom --- drivers/dma-buf/dma-buf.c | 47 -- drivers/dma-buf/fence.c |

Re: [REPOST PATCH 4/8] android: convert sync to fence api, v5

2014-06-23 Thread Maarten Lankhorst
Hey, op 20-06-14 22:52, Thierry Reding schreef: > On Thu, Jun 19, 2014 at 02:28:14PM +0200, Daniel Vetter wrote: >> On Thu, Jun 19, 2014 at 1:48 PM, Thierry Reding >> wrote: > With these changes, can we pull the android sync logic out of > drivers/staging/ now? Afaik the google guys

Re: [REPOST PATCH 4/8] android: convert sync to fence api, v5

2014-06-19 Thread Maarten Lankhorst
op 19-06-14 17:22, Colin Cross schreef: > On Wed, Jun 18, 2014 at 11:37 PM, Daniel Vetter wrote: >> On Wed, Jun 18, 2014 at 06:15:56PM -0700, Greg KH wrote: >>> On Wed, Jun 18, 2014 at 12:37:11PM +0200, Maarten Lankhorst wrote: >>>> Just to show it's easy.

[REPOST PATCH 8/8] reservation: add suppport for read-only access using rcu

2014-06-18 Thread Maarten Lankhorst
. reservation_object_test_signaled_rcu() will test if all fences of the reservation_object are signaled without using the ww_mutex. reservation_object_get_excl() is added because touching the fence_excl member directly will trigger a sparse warning. Signed-off-by: Maarten Lankhorst Reviewed-By: Thomas

[REPOST PATCH 1/8] fence: dma-buf cross-device synchronization (v17)

2014-06-18 Thread Maarten Lankhorst
r discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problematic. v5: [ Maarten Lankhorst ] Updated for dma-bikeshed-fence and dma-buf-manager. v6: [ Maarten Lankhorst ] I remov

[REPOST PATCH 3/8] dma-buf: use reservation objects

2014-06-18 Thread Maarten Lankhorst
This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst Acked-by: Mauro Carvalho Chehab #drivers/media/v4l2-core/ Acked-by: Thomas Hellstrom #drivers/gpu/drm/ttm Signed-o

[REPOST PATCH 7/8] reservation: update api and add some helpers

2014-06-18 Thread Maarten Lankhorst
. reservation_object_add_shared_fence() and reservation_object_add_excl_fence() are used to assign a new fence to a reservation_object pointer, to complete a reservation. Signed-off-by: Maarten Lankhorst Changes since v1: - Add reservation_object_get_excl, reorder code a bit. --- drivers/base/dma-buf.c | 35

[REPOST PATCH 0/8] fence synchronization patches

2014-06-18 Thread Maarten Lankhorst
ttm, and make dealing with rcu less painful. Patches slightly updated to fix compilation with armada and new atomic primitives, but otherwise identical. --- Maarten Lankhorst (8): fence: dma-buf cross-device synchronization (v17) seqno-fence: Hardware dma-buf implementation of fencing

[REPOST PATCH 6/8] dma-buf: add poll support, v3

2014-06-18 Thread Maarten Lankhorst
Thanks to Fengguang Wu for spotting a missing static cast. v2: - Kill unused variable need_shared. v3: - Clarify the BUG() in dma_buf_release some more. (Rob Clark) Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 108 +++ include

[REPOST PATCH 4/8] android: convert sync to fence api, v5

2014-06-18 Thread Maarten Lankhorst
allback in sync_fence_free if not all fences have fired. v3: - Merge Colin Cross' bugfixes, and the android fence merge optimization. v4: - Merge with the upstream fixes. v5: - Fix small style issues pointed out by Thomas Hellstrom. Signed-off-by: Maarten Lankhorst Acked-by: John Stultz ---

[REPOST PATCH 5/8] reservation: add support for fences to enable cross-device synchronisation

2014-06-18 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst Reviewed-by: Rob Clark --- include/linux/reservation.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/linux/reservation.h b/include/linux/reservation.h index 813dae960ebd..f3f57460a205 100644 --- a/include

[REPOST PATCH 2/8] seqno-fence: Hardware dma-buf implementation of fencing (v5)

2014-06-18 Thread Maarten Lankhorst
nce.h v4: Add spinlock pointer to seqno_fence_init v5: Add condition member to allow wait for != 0. Fix small style errors pointed out by checkpatch. Signed-off-by: Maarten Lankhorst Reviewed-by: Rob Clark #v4 --- Documentation/DocBook/device-drivers.tmpl |1 drivers

Re: [RFC PATCH 2/2 with seqcount v3] reservation: add suppport for read-only access using rcu

2014-05-20 Thread Maarten Lankhorst
op 20-05-14 17:13, Thomas Hellstrom schreef: On 05/19/2014 03:13 PM, Maarten Lankhorst wrote: op 19-05-14 15:42, Thomas Hellstrom schreef: Hi, Maarten! Some nitpicks, and that krealloc within rcu lock still worries me. Otherwise looks good. /Thomas On 04/23/2014 12:15 PM, Maarten

Re: [RFC PATCH 2/2 with seqcount v3] reservation: add suppport for read-only access using rcu

2014-05-19 Thread Maarten Lankhorst
op 19-05-14 15:42, Thomas Hellstrom schreef: Hi, Maarten! Some nitpicks, and that krealloc within rcu lock still worries me. Otherwise looks good. /Thomas On 04/23/2014 12:15 PM, Maarten Lankhorst wrote: @@ -55,8 +60,8 @@ int reservation_object_reserve_shared(struct reservation_object *obj

Re: [RFC PATCH 2/2 with seqcount v3] reservation: add suppport for read-only access using rcu

2014-04-29 Thread Maarten Lankhorst
op 23-04-14 13:15, Maarten Lankhorst schreef: This adds 4 more functions to deal with rcu. reservation_object_get_fences_rcu() will obtain the list of shared and exclusive fences without obtaining the ww_mutex. reservation_object_wait_timeout_rcu() will wait on all fences of the

[RFC PATCH 2/2 with seqcount v3] reservation: add suppport for read-only access using rcu

2014-04-23 Thread Maarten Lankhorst
. reservation_object_test_signaled_rcu() will test if all fences of the reservation_object are signaled without using the ww_mutex. reservation_object_get_excl() is added because touching the fence_excl member directly will trigger a sparse warning. Signed-off-by: Maarten Lankhorst --- Using seqcount and

Re: [PATCH 2/2] [RFC v2 with seqcount] reservation: add suppport for read-only access using rcu

2014-04-14 Thread Maarten Lankhorst
op 11-04-14 21:35, Thomas Hellstrom schreef: On 04/11/2014 08:09 PM, Maarten Lankhorst wrote: op 11-04-14 12:11, Thomas Hellstrom schreef: On 04/11/2014 11:24 AM, Maarten Lankhorst wrote: op 11-04-14 10:38, Thomas Hellstrom schreef: Hi, Maarten. Here I believe we encounter a lot of locking

Re: [PATCH 2/2] [RFC v2 with seqcount] reservation: add suppport for read-only access using rcu

2014-04-14 Thread Maarten Lankhorst
op 11-04-14 21:30, Thomas Hellstrom schreef: Hi! On 04/11/2014 08:09 PM, Maarten Lankhorst wrote: op 11-04-14 12:11, Thomas Hellstrom schreef: On 04/11/2014 11:24 AM, Maarten Lankhorst wrote: op 11-04-14 10:38, Thomas Hellstrom schreef: Hi, Maarten. Here I believe we encounter a lot of

Re: [PATCH 2/2] [RFC v2 with seqcount] reservation: add suppport for read-only access using rcu

2014-04-11 Thread Maarten Lankhorst
op 11-04-14 12:11, Thomas Hellstrom schreef: On 04/11/2014 11:24 AM, Maarten Lankhorst wrote: op 11-04-14 10:38, Thomas Hellstrom schreef: Hi, Maarten. Here I believe we encounter a lot of locking inconsistencies. First, it seems you're use a number of pointers as RCU pointers wi

Re: [PATCH 2/2] [RFC v2 with seqcount] reservation: add suppport for read-only access using rcu

2014-04-11 Thread Maarten Lankhorst
op 11-04-14 10:38, Thomas Hellstrom schreef: Hi, Maarten. Here I believe we encounter a lot of locking inconsistencies. First, it seems you're use a number of pointers as RCU pointers without annotating them as such and use the correct rcu macros when assigning those pointers. Some pointers (l

[PATCH 2/2] [RFC v2 with seqcount] reservation: add suppport for read-only access using rcu

2014-04-10 Thread Maarten Lankhorst
op 10-04-14 13:08, Thomas Hellstrom schreef: On 04/10/2014 12:07 PM, Maarten Lankhorst wrote: Hey, op 10-04-14 10:46, Thomas Hellstrom schreef: Hi! Ugh. This became more complicated than I thought, but I'm OK with moving TTM over to fence while we sort out how / if we're going t

Re: [PATCH 2/2] [RFC] reservation: add suppport for read-only access using rcu

2014-04-10 Thread Maarten Lankhorst
Hey, op 10-04-14 10:46, Thomas Hellstrom schreef: Hi! Ugh. This became more complicated than I thought, but I'm OK with moving TTM over to fence while we sort out how / if we're going to use this. While reviewing, it struck me that this is kind of error-prone, and hard to follow since we're op

[PATCH 1/2] reservation: update api and add some helpers

2014-04-09 Thread Maarten Lankhorst
assign a new fence to a reservation_object pointer, to complete a reservation. Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 35 +++--- drivers/base/fence.c|4 + drivers/base/reservation.c | 154 +++ include/linux

[PATCH 0/2] Updates to fence api

2014-04-09 Thread Maarten Lankhorst
M to fence, so I had to keep it in. If nobody objects I'll probably merge that patch through drm, because some care is needed in ttm before it can flip the switch on rcu. --- Maarten Lankhorst (2): reservation: update api and add some helpers [RFC] reservation: add suppport for r

[PATCH 2/2] [RFC] reservation: add suppport for read-only access using rcu

2014-04-09 Thread Maarten Lankhorst
. reservation_object_get_excl() is added because touching the fence_excl member directly will trigger a sparse warning. Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 46 +++-- drivers/base/reservation.c | 147 +-- include

Re: [PATCH 4/6] android: convert sync to fence api, v4

2014-03-04 Thread Maarten Lankhorst
op 04-03-14 11:00, Daniel Vetter schreef: On Tue, Mar 04, 2014 at 09:20:58AM +0100, Maarten Lankhorst wrote: op 04-03-14 09:14, Daniel Vetter schreef: On Tue, Mar 04, 2014 at 08:50:38AM +0100, Maarten Lankhorst wrote: op 03-03-14 22:11, Daniel Vetter schreef: On Mon, Feb 17, 2014 at 04:57

Re: [PATCH 4/6] android: convert sync to fence api, v4

2014-03-04 Thread Maarten Lankhorst
op 04-03-14 09:14, Daniel Vetter schreef: On Tue, Mar 04, 2014 at 08:50:38AM +0100, Maarten Lankhorst wrote: op 03-03-14 22:11, Daniel Vetter schreef: On Mon, Feb 17, 2014 at 04:57:19PM +0100, Maarten Lankhorst wrote: Android syncpoints can be mapped to a timeline. This removes the need to

Re: [PATCH 4/6] android: convert sync to fence api, v4

2014-03-03 Thread Maarten Lankhorst
op 03-03-14 22:11, Daniel Vetter schreef: On Mon, Feb 17, 2014 at 04:57:19PM +0100, Maarten Lankhorst wrote: Android syncpoints can be mapped to a timeline. This removes the need to maintain a separate api for synchronization. I've left the android trace events in place, but the core

[PATCH 3/6] dma-buf: use reservation objects

2014-02-24 Thread Maarten Lankhorst
This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst Acked-by: Mauro Carvalho Chehab #drivers/media/v4l2-core/ Acked-by: Thomas Hellstrom #drivers/gpu/drm/ttm --- dr

[PATCH 1/6] fence: dma-buf cross-device synchronization (v17)

2014-02-24 Thread Maarten Lankhorst
r discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problematic. v5: [ Maarten Lankhorst ] Updated for dma-bikeshed-fence and dma-buf-manager. v6: [ Maarten Lankhorst ] I remov

[PATCH 4/6] android: convert sync to fence api, v5

2014-02-24 Thread Maarten Lankhorst
allback in sync_fence_free if not all fences have fired. v3: - Merge Colin Cross' bugfixes, and the android fence merge optimization. v4: - Merge with the upstream fixes. v5: - Fix small style issues pointed out by Thomas Hellstrom. Signed-off-by: Maarten Lankhorst --- drivers/staging/

[PATCH 5/6] reservation: add support for fences to enable cross-device synchronisation

2014-02-24 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst Reviewed-by: Rob Clark --- include/linux/reservation.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/linux/reservation.h b/include/linux/reservation.h index 813dae960ebd..f3f57460a205 100644 --- a/include

[PATCH 6/6] dma-buf: add poll support, v3

2014-02-24 Thread Maarten Lankhorst
Thanks to Fengguang Wu for spotting a missing static cast. v2: - Kill unused variable need_shared. v3: - Clarify the BUG() in dma_buf_release some more. (Rob Clark) Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 108 +++ include

[PATCH 2/6] seqno-fence: Hardware dma-buf implementation of fencing (v5)

2014-02-24 Thread Maarten Lankhorst
nce.h v4: Add spinlock pointer to seqno_fence_init v5: Add condition member to allow wait for != 0. Fix small style errors pointed out by checkpatch. Signed-off-by: Maarten Lankhorst Reviewed-by: Rob Clark #v4 --- Documentation/DocBook/device-drivers.tmpl |1 drivers

[PATCH 0/6] dma-buf synchronization patches (updated)

2014-02-24 Thread Maarten Lankhorst
a comment removed) - add poll support to dma-buf (added comment) --- Maarten Lankhorst (6): fence: dma-buf cross-device synchronization (v17) seqno-fence: Hardware dma-buf implementation of fencing (v5) dma-buf: use reservation objects android: convert sync to fence api, v5

Re: [PATCH 4/6] android: convert sync to fence api, v4

2014-02-24 Thread Maarten Lankhorst
op 19-02-14 14:56, Thomas Hellstrom schreef: >+static void fence_check_cb_func(struct fence *f, struct fence_cb *cb) >+{ >+ struct sync_fence_cb *check = container_of(cb, struct sync_fence_cb, cb); >+ struct sync_fence *fence = check->fence; >+ >+ // TODO: Add a fence->status member and che

Re: [PATCH 2/6] seqno-fence: Hardware dma-buf implementation of fencing (v4)

2014-02-19 Thread Maarten Lankhorst
op 17-02-14 19:41, Christian König schreef: Am 17.02.2014 19:24, schrieb Rob Clark: On Mon, Feb 17, 2014 at 12:36 PM, Christian König wrote: Am 17.02.2014 18:27, schrieb Rob Clark: On Mon, Feb 17, 2014 at 11:56 AM, Christian König wrote: Am 17.02.2014 16:56, schrieb Maarten Lankhorst

[PATCH 0/6] dma-buf synchronization patches

2014-02-17 Thread Maarten Lankhorst
had to fix some fallout from the rebase, hopefully everything's clean now, and ready for -next. --- Maarten Lankhorst (6): fence: dma-buf cross-device synchronization (v17) seqno-fence: Hardware dma-buf implementation of fencing (v4) dma-buf: use reservation objects a

[PATCH 5/6] reservation: add support for fences to enable cross-device synchronisation

2014-02-17 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- include/linux/reservation.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/linux/reservation.h b/include/linux/reservation.h index 813dae960ebd..92c4851b5a39 100644 --- a/include/linux/reservation.h +++ b

[PATCH 6/6] dma-buf: add poll support, v2

2014-02-17 Thread Maarten Lankhorst
Thanks to Fengguang Wu for spotting a missing static cast. v2: - Kill unused variable need_shared. Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 101 +++ include/linux/dma-buf.h | 12 ++ 2 files changed, 113 insertions

[PATCH 4/6] android: convert sync to fence api, v4

2014-02-17 Thread Maarten Lankhorst
t all fences have fired. v3: - Merge Colin Cross' bugfixes, and the android fence merge optimization. v4: - Merge with the upstream fixes. Signed-off-by: Maarten Lankhorst --- drivers/staging/android/Kconfig |1 drivers/staging/android/Makefile |2 drivers/staging/android

[PATCH 2/6] seqno-fence: Hardware dma-buf implementation of fencing (v4)

2014-02-17 Thread Maarten Lankhorst
oved into dma-fence.c since not much was left of the file. Lots of documentation added. v3: Use fence_ops instead of custom callbacks. Moved to own file to avoid circular dependency between dma-buf.h and fence.h v4: Add spinlock pointer to seqno_fence_init Signed-off-by: Maarten Lankhorst ---

[PATCH 3/6] dma-buf: use reservation objects

2014-02-17 Thread Maarten Lankhorst
This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst Acked-by: Mauro Carvalho Chehab #drivers/media/v4l2-core/ --- drivers/base/dma-buf.c |

[PATCH 1/6] fence: dma-buf cross-device synchronization (v17)

2014-02-17 Thread Maarten Lankhorst
r discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problematic. v5: [ Maarten Lankhorst ] Updated for dma-bikeshed-fence and dma-buf-manager. v6: [ Maarten Lankhorst ] I remov

Re: [PATCH 1/7] sched: allow try_to_wake_up to be used internally outside of core.c

2014-01-14 Thread Maarten Lankhorst
op 13-01-14 19:50, Colin Cross schreef: > On Mon, Jan 13, 2014 at 4:31 AM, Maarten Lankhorst > wrote: >> The kernel fence implementation doesn't use event queues, but needs >> to perform the same wake up. The symbol is not exported, since the >> fence implementa

[PATCH 7/7] dma-buf: add poll support

2014-01-13 Thread Maarten Lankhorst
Thanks to Fengguang Wu for spotting a missing static cast. Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 102 +++ include/linux/dma-buf.h | 12 ++ 2 files changed, 114 insertions(+) diff --git a/drivers/base/dma-buf.c b

[PATCH 6/7] reservation: add support for fences to enable cross-device synchronisation

2014-01-13 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- include/linux/reservation.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/linux/reservation.h b/include/linux/reservation.h index 813dae960ebd..92c4851b5a39 100644 --- a/include/linux/reservation.h +++ b

[PATCH 5/7] android: convert sync to fence api, v3

2014-01-13 Thread Maarten Lankhorst
t all fences have fired. v3: - Merge Colin Cross' bugfixes, and the android fence merge optimization. Signed-off-by: Maarten Lankhorst --- drivers/staging/android/Kconfig |1 drivers/staging/android/Makefile |2 drivers/staging/android/sw_sync.c|4 drivers/stagi

[PATCH 4/7] dma-buf: use reservation objects

2014-01-13 Thread Maarten Lankhorst
This allows reservation objects to be used in dma-buf. it's required for implementing polling support on the fences that belong to a dma-buf. Signed-off-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 22 -- drivers/gpu/drm/drm_pr

[PATCH 1/7] sched: allow try_to_wake_up to be used internally outside of core.c

2014-01-13 Thread Maarten Lankhorst
The kernel fence implementation doesn't use event queues, but needs to perform the same wake up. The symbol is not exported, since the fence implementation is not built as a module. Signed-off-by: Maarten Lankhorst --- include/linux/wait.h |1 + kernel/sched/core.c |2 +- 2

[PATCH 2/7] fence: dma-buf cross-device synchronization (v16)

2014-01-13 Thread Maarten Lankhorst
danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problematic. v5: [ Maarten Lankhorst ] Updated for dma-bikeshed-fence and dma-buf-manager. v6: [ Maarten Lankhorst ] I removed dma_fence_cance

[PATCH 0/7] dma-buf synchronization patches

2014-01-13 Thread Maarten Lankhorst
The following series implements fence and converts dma-buf and android sync to use it. Patch 6 and 7 add support for polling to dma-buf, blocking until all fences are signaled. --- Maarten Lankhorst (7): sched: allow try_to_wake_up to be used internally outside of core.c fence: dma

[PATCH 3/7] seqno-fence: Hardware dma-buf implementation of fencing (v4)

2014-01-13 Thread Maarten Lankhorst
oved into dma-fence.c since not much was left of the file. Lots of documentation added. v3: Use fence_ops instead of custom callbacks. Moved to own file to avoid circular dependency between dma-buf.h and fence.h v4: Add spinlock pointer to seqno_fence_init Signed-off-by: Maarten Lankhorst ---

Re: [RFC PATCH] drm/radeon: rework to new fence interface

2013-08-20 Thread Maarten Lankhorst
Op 20-08-13 11:51, Christian König schreef: > Am 20.08.2013 11:36, schrieb Maarten Lankhorst: > [SNIP] > >>>>>> [SNIP] >>>>>> +/** >>>>>> + * radeon_fence_enable_signaling - enable signalling on fence >>>>>> + * @fenc

Re: [RFC PATCH] drm/radeon: rework to new fence interface

2013-08-20 Thread Maarten Lankhorst
Op 20-08-13 10:37, Christian König schreef: > Am 19.08.2013 21:37, schrieb Maarten Lankhorst: >> Op 19-08-13 14:35, Christian König schreef: >>> Am 19.08.2013 12:17, schrieb Maarten Lankhorst: >>>> [SNIP] >>>> @@ -190,25 +225,24 @@ void radeon_fence_pro

Re: [RFC PATCH] drm/radeon: rework to new fence interface

2013-08-19 Thread Maarten Lankhorst
Op 19-08-13 14:35, Christian König schreef: > Am 19.08.2013 12:17, schrieb Maarten Lankhorst: >> [SNIP] >> @@ -190,25 +225,24 @@ void radeon_fence_process(struct radeon_device *rdev, >> int ring) >> } >> } while (atomic64_xchg(&rdev-

[RFC PATCH] drm/radeon: rework to new fence interface

2013-08-19 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 9f19259..971284e 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -64,6 +64,7 @@ #include #include #include +#include #include

[RFC PATCH] drm/nouveau: rework to new fence interface

2013-08-19 Thread Maarten Lankhorst
nouveau was a bit tricky, it has no support for interrupts on --- diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index be31499..78714e4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -35,88 +35

Re: [RFC PATCH] fence: dma-buf cross-device synchronization (v12)

2013-08-15 Thread Maarten Lankhorst
Op 15-08-13 15:14, Rob Clark schreef: > On Thu, Aug 15, 2013 at 7:16 AM, Maarten Lankhorst > wrote: >> Op 12-08-13 17:43, Rob Clark schreef: >>> On Mon, Jul 29, 2013 at 10:05 AM, Maarten Lankhorst >>> wrote: >>>> + > [snip] >>>> +/** >&

Re: [PATCH] fence: dma-buf cross-device synchronization (v13)

2013-08-15 Thread Maarten Lankhorst
Op 15-08-13 14:45, Marcin Ślusarz schreef: > 2013/8/15 Maarten Lankhorst : >> A fence can be attached to a buffer which is being filled or consumed >> by hw, to allow userspace to pass the buffer without waiting to another >> device. For example, userspace can call page_flip

[PATCH] fence: dma-buf cross-device synchronization (v14)

2013-08-15 Thread Maarten Lankhorst
n the fence is passed). v3: Fix locking fail in attach_fence() and get_fence() v4: Remove tie-in w/ dma-buf.. after discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problem

[PATCH] fence: dma-buf cross-device synchronization (v13)

2013-08-15 Thread Maarten Lankhorst
n the fence is passed). v3: Fix locking fail in attach_fence() and get_fence() v4: Remove tie-in w/ dma-buf.. after discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problem

Re: [RFC PATCH] fence: dma-buf cross-device synchronization (v12)

2013-08-15 Thread Maarten Lankhorst
Op 12-08-13 17:43, Rob Clark schreef: > On Mon, Jul 29, 2013 at 10:05 AM, Maarten Lankhorst > wrote: >> A fence can be attached to a buffer which is being filled or consumed >> by hw, to allow userspace to pass the buffer without waiting to another >> device. For exa

[RFC PATCH] fence: dma-buf cross-device synchronization (v12)

2013-07-29 Thread Maarten Lankhorst
n the fence is passed). v3: Fix locking fail in attach_fence() and get_fence() v4: Remove tie-in w/ dma-buf.. after discussion w/ danvet and mlankorst we decided that we need to be able to attach one fence to N dma-buf's, so using the list_head in dma-fence struct would be problem

[PATCH v6 2/7] mutex: add support for wound/wait style locks

2013-06-24 Thread Maarten Lankhorst
Op 20-06-13 14:23, Ingo Molnar schreef: > * Maarten Lankhorst wrote: > >> Well they've helped me with some of the changes and contributed some >> code and/or fixes, but if acked-by is preferred I'll use that.. > Such contributions can be credited in the changel

Re: [PATCH v5 2/7] mutex: add support for wound/wait style locks, v5

2013-06-20 Thread Maarten Lankhorst
Op 20-06-13 13:55, Ingo Molnar schreef: > * Maarten Lankhorst wrote: > >> Changes since RFC patch v1: >> - Updated to use atomic_long instead of atomic, since the reservation_id >> was a long. >> - added mutex_reserve_lock_slow and mutex_reserv

[PATCH v5 0/7] add mutex wait/wound/style style locks

2013-06-20 Thread Maarten Lankhorst
Vetter (1): mutex: w/w mutex slowpath debugging Maarten Lankhorst (6): arch: make __mutex_fastpath_lock_retval return whether fastpath succeeded or not. mutex: add support for wound/wait style locks, v5 mutex: Add ww tests to lib/locking-selftest.c. v5 mutex: add more

[PATCH v5 4/7] mutex: Add ww tests to lib/locking-selftest.c. v5

2013-06-20 Thread Maarten Lankhorst
locking after ww_acquire_done has been called. - Added a test for unbalance for ctx->acquired dropping below zero. - Added a test for unlocked ww_mutex with ctx != NULL. Signed-off-by: Maarten Lankhorst --- lib/locking-selftest.c | 400 ++-- 1 f

[PATCH v5 1/7] arch: make __mutex_fastpath_lock_retval return whether fastpath succeeded or not.

2013-06-20 Thread Maarten Lankhorst
was previously used. Changes since v1, pointed out by Francesco Lavra: - fix a small comment issue in mutex_32.h - fix the __mutex_fastpath_lock_retval macro for mutex-null.h Signed-off-by: Maarten Lankhorst --- arch/ia64/include/asm/mutex.h| 10 -- arch/powerpc/include/asm/mutex.h

[PATCH v5 2/7] mutex: add support for wound/wait style locks, v5

2013-06-20 Thread Maarten Lankhorst
*, normal functions can be used. Inline versions still exist for extra debugging. - Cleanup unneeded memory barriers, add comment to the remaining smp_mb(). Signed-off-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Signed-off-by: Rob Clark --- Documentation/ww-mutex-design.txt | 343

[PATCH v5 3/7] mutex: w/w mutex slowpath debugging

2013-06-20 Thread Maarten Lankhorst
.debug definition to work correctly. (mlankhorst) v6: Do not inject -EDEADLK when ctx->acquired == 0, because the _slow paths are merged now. (mlankhorst) Cc: Steven Rostedt Signed-off-by: Daniel Vetter Signed-off-by: Maarten Lankhorst --- include/linux/mutex.h |8

[PATCH v5 7/7] locking-selftests: handle unexpected failures more strictly

2013-06-20 Thread Maarten Lankhorst
When CONFIG_PROVE_LOCKING is not enabled, more tests are expected to pass unexpectedly, but there no tests that should start to fail that pass with CONFIG_PROVE_LOCKING enabled. Signed-off-by: Maarten Lankhorst --- lib/locking-selftest.c |8 +--- 1 file changed, 5 insertions(+), 3

[PATCH v5 5/7] mutex: add more tests to lib/locking-selftest.c

2013-06-20 Thread Maarten Lankhorst
None of the ww_mutex codepaths should be taken in the 'normal' mutex calls. The easiest way to verify this is by using the normal mutex calls, and making sure o.ctx is unmodified. Signed-off-by: Maarten Lankhorst --- lib/locking-selftes

[PATCH v5 6/7] mutex: add more ww tests to test EDEADLK path handling

2013-06-20 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- lib/locking-selftest.c | 264 +++- 1 file changed, 261 insertions(+), 3 deletions(-) diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c index 37faefd..d554f3f 100644 --- a/lib/locking-selftest.c +++ b

Re: [RFC PATCH v2] dmabuf-sync: Introduce buffer synchronization framework

2013-06-17 Thread Maarten Lankhorst
Op 17-06-13 15:04, Inki Dae schreef: > >> -Original Message- >> From: Maarten Lankhorst [mailto:maarten.lankho...@canonical.com] >> Sent: Monday, June 17, 2013 8:35 PM >> To: Inki Dae >> Cc: dri-de...@lists.freedesktop.org; linux-fb...@v

Re: [RFC PATCH v2] dmabuf-sync: Introduce buffer synchronization framework

2013-06-17 Thread Maarten Lankhorst
Op 17-06-13 13:15, Inki Dae schreef: > This patch adds a buffer synchronization framework based on DMA BUF[1] > and reservation[2] to use dma-buf resource, and based on ww-mutexes[3] > for lock mechanism. > > The purpose of this framework is not only to couple cache operations, > and buffer access

Re: [PATCH v4 0/4] add mutex wait/wound/style style locks

2013-06-12 Thread Maarten Lankhorst
Op 28-05-13 16:48, Maarten Lankhorst schreef: > Version 4 already? > > Small api changes since v3: > - Remove ww_mutex_unlock_single and ww_mutex_lock_single. > - Rename ww_mutex_trylock_single to ww_mutex_trylock. > - Remove separate implementations of ww_mutex_lock_slow*, no

Re: [RFC][PATCH 1/2] dma-buf: add importer private data to attachment

2013-06-07 Thread Maarten Lankhorst
Op 07-06-13 04:32, 김승우 schreef: > Hello Maarten, > > On 2013년 06월 05일 22:23, Maarten Lankhorst wrote: >> Op 31-05-13 10:54, Seung-Woo Kim schreef: >>> dma-buf attachment has only exporter private data, but importer private data >>> can be useful for importer esp

Re: [RFC][PATCH 1/2] dma-buf: add importer private data to attachment

2013-06-05 Thread Maarten Lankhorst
Op 31-05-13 10:54, Seung-Woo Kim schreef: > dma-buf attachment has only exporter private data, but importer private data > can be useful for importer especially to re-import the same dma-buf. > To use importer private data in attachment of the device, the function to > search attachment in the atta

Re: [PATCH v4 2/4] mutex: add support for wound/wait style locks, v5

2013-05-30 Thread Maarten Lankhorst
Op 29-05-13 12:33, Inki Dae schreef: > Hi, > > Just minor comments > > +Usage >> +- >> + >> +Three different ways to acquire locks within the same w/w class. Common >> +definitions for methods #1 and #2: >> + >> +static DEFINE_WW_CLASS(ww_class); >> + >> +struct obj { >> + struct ww_mutex

Re: [PATCH v4 3/4] mutex: Add ww tests to lib/locking-selftest.c. v4

2013-05-28 Thread Maarten Lankhorst
Op 28-05-13 21:18, Daniel Vetter schreef: > On Tue, May 28, 2013 at 04:48:45PM +0200, Maarten Lankhorst wrote: >> This stresses the lockdep code in some ways specifically useful to >> ww_mutexes. It adds checks for most of the common locking errors. >> >> Changes s

[PATCH v4 0/4] add mutex wait/wound/style style locks

2013-05-28 Thread Maarten Lankhorst
debugging, and to annotate. - Cleanup unneeded memory barriers, add comment to the remaining smp_mb(). Thanks to Daniel Vetter, Rob Clark and Peter Zijlstra for their feedback. --- Daniel Vetter (1): mutex: w/w mutex slowpath debugging Maarten Lankhorst (3): arch: make

  1   2   >