Deploying new iterator interface for dma-buf
Subsystems (12)
Christian König
reviewerNext round for that one here, maybe the CI systems are now more gracefully with me :)
I'm pretty sure that a couple of those dma_resv_for_each_fence_unlocked should actually be replaced with lock+dma_resv_for_each_fence, but that needs more auditing.
Please review and comment.
Thanks,
Christian.
Christian König
reviewerPATCH 1/26 dma-buf: add dma_resv_for_each_fence_unlocked v2
Abstract the complexity of iterating over all the fences in a dma_resv object.
The new loop handles the whole RCU and retry dance and returns only fences where we can be sure we grabbed the right one.
v2: fix accessing the shared fences while they might be freed,
improve kerneldoc, rename _cursor to _iter, add dma_resv_iter_is_exclusive
--- drivers/dma-buf/dma-resv.c | 62 ++++++++++++++++++++++++++++++++++++++ include/linux/dma-resv.h | 50 ++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+)
drivers/dma-buf/dma-resv.c +62 -0
@@ -323,6 +323,68 @@ void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence) }EXPORT_SYMBOL (dma_resv_add_excl_fence); +/** +* dma_resv_walk_unlocked - walk over fences in a dma_resv obj +* @obj: the dma_resv object +* @cursor: cursor to record the current position +* @all_fences: true returns also the shared fences +* @first: if we should start over +* +* Return all the fences in the dma_resv object which are not yet signaled. +* The returned fence has an extra local reference so will stay alive. +* If a concurrent modify is detected the whole iterator is started over again. +*/ +struct dma_fence *dma_resv_walk_unlocked (struct dma_resv *obj, +struct dma_resv_iter *cursor, +bool all_fences,bool first) +{ +struct dma_fence *fence =NULL ; + + first |=read_seqcount_retry (&obj->seq, cursor->seq); +do { +/* Drop the reference from the previous round */ +dma_fence_put (fence); + + cursor->is_first = first; +if (first) { + cursor->seq =read_seqcount_begin (&obj->seq); + cursor->index =-1 ; + cursor->fences =dma_resv_shared_list (obj); + + fence =dma_resv_excl_fence (obj); +if (fence &&test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , + &fence->flags)) + fence =NULL ; + }else { + fence =NULL ; + } + +if (fence) { + fence =dma_fence_get_rcu (fence); + }else if (all_fences && cursor->fences) { +struct dma_resv_list *fences = cursor->fences; + +while (++cursor->index < fences->shared_count) { + fence =rcu_dereference ( + fences->shared[cursor->index]); +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , + &fence->flags)) +break ; + } +if (cursor->index < fences->shared_count) + fence =dma_fence_get_rcu (fence); +else + fence =NULL ; + } + +/* For the eventually next round */ + first = true; + }while (read_seqcount_retry (&obj->seq, cursor->seq)); + +return fence; +} +EXPORT_SYMBOL_GPL (dma_resv_walk_unlocked); +/** * dma_resv_copy_fences - Copy all fences from src to dst. * @dst: the destination reservation object
include/linux/dma-resv.h +50 -0
62 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH 01/26] dma-buf: add dma_resv_for_each_fence_unlocked v2
Quoted 7 lines · Christian König
Abstract the complexity of iterating over all the fences in a
dma_resvobject.The new loop handles the whole RCU and retry dance and returns only fences where we can be sure we grabbed the right one.
Quoted 5 lines
v2: fix accessing the shared fences while they might be freed,
improve kerneldoc, rename_cursorto_iter, adddma_resv_iter_is_exclusiveSigned-off-by Christian König <[email protected]>
Replied in the other thread with the fully typed out example, this really needs iter_init/next/end here. Or it's just way too fragile and tricky for a generic helper that we roll out everywhere.
-Daniel
Quoted 149 lines
--- drivers/dma-buf/dma-resv.c | 62 ++++++++++++++++++++++++++++++++++++++ include/linux/dma-resv.h | 50 ++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+)drivers/dma-buf/dma-resv.c +62
-0@@ -323,6 +323,68 @@ void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence) }EXPORT_SYMBOL (dma_resv_add_excl_fence); +/** +* dma_resv_walk_unlocked - walk over fences in a dma_resv obj +* @obj: the dma_resv object +* @cursor: cursor to record the current position +* @all_fences: true returns also the shared fences +* @first: if we should start over +* +* Return all the fences in the dma_resv object which are not yet signaled. +* The returned fence has an extra local reference so will stay alive. +* If a concurrent modify is detected the whole iterator is started over again. +*/ +struct dma_fence *dma_resv_walk_unlocked (struct dma_resv *obj, +struct dma_resv_iter *cursor, +bool all_fences,bool first) +{ +struct dma_fence *fence =NULL ; + + first |=read_seqcount_retry (&obj->seq, cursor->seq); +do { +/* Drop the reference from the previous round */ +dma_fence_put (fence); + + cursor->is_first = first; +if (first) { + cursor->seq =read_seqcount_begin (&obj->seq); + cursor->index =-1 ; + cursor->fences =dma_resv_shared_list (obj); + + fence =dma_resv_excl_fence (obj); +if (fence &&test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , + &fence->flags)) + fence =NULL ; + }else { + fence =NULL ; + } + +if (fence) { + fence =dma_fence_get_rcu (fence); + }else if (all_fences && cursor->fences) { +struct dma_resv_list *fences = cursor->fences; + +while (++cursor->index < fences->shared_count) { + fence =rcu_dereference ( + fences->shared[cursor->index]); +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , + &fence->flags)) +break ; + } +if (cursor->index < fences->shared_count) + fence =dma_fence_get_rcu (fence); +else + fence =NULL ; + } + +/* For the eventually next round */ + first = true; + }while (read_seqcount_retry (&obj->seq, cursor->seq)); + +return fence; +} +EXPORT_SYMBOL_GPL (dma_resv_walk_unlocked); +/** * dma_resv_copy_fences - Copy all fences from src to dst. * @dst: the destination reservation object include/linux/dma-resv.h +50
-0@@ -149,6 +149,53 @@ struct dma_resv {struct dma_resv_list __rcu *fence; }; +/** +* struct dma_resv_iter - current position into the dma_resv fences +* +* Don't touch this directly in the driver, use the accessor function instead. +*/ +struct dma_resv_iter { +/** @seq: sequence number to check for modifications */ +unsigned int seq; + +/** @index: index into the shared fences */ +unsigned int index; + +/** @fences: the shared fences */ +struct dma_resv_list *fences; + +/** @is_first: true if this is the first returned fence */ +bool is_first; +}; + +/** +* dma_resv_for_each_fence_unlocked - fence iterator +* @obj: a dma_resv object pointer +* @cursor: a struct dma_resv_iter pointer +* @all_fences: true if all fences should be returned +* @fence: the current fence +* +* Iterate over the fences in a struct dma_resv object without holding the +* dma_resv::lock. The RCU read side lock must be hold when using this, but can +* be dropped and re-taken as necessary inside the loop. @all_fences controls +* if the shared fences are returned as well. +*/ +#define dma_resv_for_each_fence_unlocked (obj, cursor, all_fences, fence) \ + for (fence = dma_resv_walk_unlocked(obj, cursor, all_fences, true); \ + fence; dma_fence_put(fence), \ + fence = dma_resv_walk_unlocked(obj, cursor, all_fences, false)) + +/** +* dma_resv_iter_is_exclusive - test if the current fence is the exclusive one +* @cursor: the cursor of the current position +* +* Returns true if the currently returned fence is the exclusive one. +*/ +static inline bool dma_resv_iter_is_exclusive (struct dma_resv_iter *cursor) +{ +return cursor->index ==-1 ; +} +#define dma_resv_held (obj) lockdep_is_held(&(obj)->lock.base)#define dma_resv_assert_held (obj) lockdep_assert_held(&(obj)->lock.base)@@ -366,6 +413,9 @@ void dma_resv_fini(struct dma_resv *obj);int dma_resv_reserve_shared (struct dma_resv *obj,unsigned int num_fences);void dma_resv_add_shared_fence (struct dma_resv *obj,struct dma_fence *fence);void dma_resv_add_excl_fence (struct dma_resv *obj,struct dma_fence *fence); +struct dma_fence *dma_resv_walk_unlocked (struct dma_resv *obj, +struct dma_resv_iter *cursor, +bool first,bool all_fences);int dma_resv_get_fences (struct dma_resv *obj,struct dma_fence **pfence_excl,unsigned *pshared_count,struct dma_fence ***pshared);int dma_resv_copy_fences (struct dma_resv *dst,struct dma_resv *src);Signature · 1 line
2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Christian König
reviewerPATCH 2/26 dma-buf: add dma_resv_for_each_fence
In reply to Christian KönigA simpler version of the iterator to be used when the dma_resv object is locked.
--- drivers/dma-buf/dma-resv.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/dma-resv.h | 18 ++++++++++++++++++ 2 files changed, 55 insertions(+)
drivers/dma-buf/dma-resv.c +37 -0
@@ -323,6 +323,43 @@ void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence) }EXPORT_SYMBOL (dma_resv_add_excl_fence); +/** +* dma_resv_walk - walk over fences in a dma_resv obj +* @obj: the dma_resv object +* @cursor: cursor to record the current position +* @all_fences: true returns also the shared fences +* @first: if we should start over +* +* Return all the fences in the dma_resv object while holding the +* dma_resv::lock. +*/ +struct dma_fence *dma_resv_walk (struct dma_resv *obj, +struct dma_resv_iter *cursor, +bool all_fences,bool first) +{ +dma_resv_assert_held (obj); + + cursor->is_first = first; +if (first) { +struct dma_fence *fence; + + cursor->index =-1 ; + cursor->fences =dma_resv_shared_list (obj); + + fence =dma_resv_excl_fence (obj); +if (fence) +return fence; + } + +if (!all_fences || !cursor->fences || + ++cursor->index >= cursor->fences->shared_count) +return NULL ; + +return rcu_dereference_protected (cursor->fences->shared[cursor->index], +dma_resv_held (obj)); +} +EXPORT_SYMBOL_GPL (dma_resv_walk); +/** * dma_resv_walk_unlocked - walk over fences in a dma_resv obj * @obj: the dma_resv object
include/linux/dma-resv.h +18 -0
@@ -168,6 +168,21 @@ struct dma_resv_iter {bool is_first; }; +/** +* dma_resv_for_each_fence - fence iterator +* @obj: a dma_resv object pointer +* @cursor: a struct dma_resv_iter pointer +* @all_fences: true if all fences should be returned +* @fence: the current fence +* +* Iterate over the fences in a struct dma_resv object while holding the +* dma_resv::lock. @all_fences controls if the shared fences are returned as +* well. +*/ +#define dma_resv_for_each_fence (obj, cursor, all_fences, fence) \ + for (fence = dma_resv_walk(obj, cursor, all_fences, true); fence; \ + fence = dma_resv_walk(obj, cursor, all_fences, false)) +/** * dma_resv_for_each_fence_unlocked - fence iterator * @obj: a dma_resv object pointer
@@ -413,6 +428,9 @@ void dma_resv_fini(struct dma_resv *obj);int dma_resv_reserve_shared (struct dma_resv *obj,unsigned int num_fences);void dma_resv_add_shared_fence (struct dma_resv *obj,struct dma_fence *fence);void dma_resv_add_excl_fence (struct dma_resv *obj,struct dma_fence *fence); +struct dma_fence *dma_resv_walk (struct dma_resv *obj, +struct dma_resv_iter *cursor, +bool first,bool all_fences);struct dma_fence *dma_resv_walk_unlocked (struct dma_resv *obj,struct dma_resv_iter *cursor,bool first,bool all_fences);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 3/26 dma-buf: use new iterator in dma_resv_copy_fences
In reply to Christian KönigThis makes the function much simpler since the complex retry logic is now handled else where.
--- drivers/dma-buf/dma-resv.c | 81 +++++++++++++++----------------------- 1 file changed, 32 insertions(+), 49 deletions(-)
drivers/dma-buf/dma-resv.c +32 -49
@@ -431,74 +431,57 @@ EXPORT_SYMBOL_GPL(dma_resv_walk_unlocked);*/ int dma_resv_copy_fences (struct dma_resv *dst,struct dma_resv *src) { -struct dma_resv_list *src_list, *dst_list; -struct dma_fence *old, *new; -unsigned int i; +struct dma_resv_iter cursor; +struct dma_resv_list *list; +struct dma_fence *f, *excl;dma_resv_assert_held (dst); -rcu_read_lock (); - src_list =dma_resv_shared_list (src); + list =NULL ; + excl =NULL ; -retry: -if (src_list) { -unsigned int shared_count = src_list->shared_count; +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (dst, &cursor, true, f) { -rcu_read_unlock (); +if (cursor.is_first) { +dma_resv_list_free (list); +dma_fence_put (excl); - dst_list =dma_resv_list_alloc (shared_count); -if (!dst_list) -return -ENOMEM ; +if (cursor.fences) { +unsigned int cnt = cursor.fences->shared_count; -rcu_read_lock (); - src_list =dma_resv_shared_list (src); -if (!src_list || src_list->shared_count > shared_count) { -kfree (dst_list); - goto retry; - } +rcu_read_unlock (); + list =dma_resv_list_alloc (cnt); +if (!list) +return -ENOMEM ; - dst_list->shared_count =0 ; -for (i =0 ; i < src_list->shared_count; ++i) { -struct dma_fence __rcu **dst; -struct dma_fence *fence; + list->shared_count =0 ; +rcu_read_lock (); - fence =rcu_dereference (src_list->shared[i]); -if (test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , - &fence->flags)) -continue ; - -if (!dma_fence_get_rcu (fence)) { -dma_resv_list_free (dst_list); - src_list =dma_resv_shared_list (src); - goto retry; + }else { + list =NULL ; } + excl =NULL ; + } -if (dma_fence_is_signaled (fence)) { -dma_fence_put (fence); -continue ; - } +if (dma_resv_iter_is_exclusive (&cursor)) + excl = f; +else +RCU_INIT_POINTER (list->shared[list->shared_count++], f); - dst = &dst_list->shared[dst_list->shared_count++]; -rcu_assign_pointer (*dst, fence); - } - }else { - dst_list =NULL ; +/* Don't drop the reference */ + f =NULL ; } - new =dma_fence_get_rcu_safe (&src->fence_excl);rcu_read_unlock (); - src_list =dma_resv_shared_list (dst); - old =dma_resv_excl_fence (dst); -write_seqcount_begin (&dst->seq); -/* write_seqcount_begin provides the necessary memory barrier */ -RCU_INIT_POINTER (dst->fence_excl, new); -RCU_INIT_POINTER (dst->fence, dst_list); + excl =rcu_replace_pointer (dst->fence_excl, excl,dma_resv_held (dst)); + list =rcu_replace_pointer (dst->fence, list,dma_resv_held (dst));write_seqcount_end (&dst->seq); -dma_resv_list_free (src_list); -dma_fence_put (old); +dma_resv_list_free (list); +dma_fence_put (excl);return 0 ; }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 4/26 dma-buf: use new iterator in dma_resv_get_fences v2
In reply to Christian KönigThis makes the function much simpler since the complex retry logic is now handled elsewhere.
v2: use sizeof(void*) instead
--- drivers/dma-buf/dma-resv.c | 110 +++++++++++++------------------------ 1 file changed, 37 insertions(+), 73 deletions(-)
drivers/dma-buf/dma-resv.c +37 -73
@@ -491,99 +491,63 @@ EXPORT_SYMBOL(dma_resv_copy_fences);* dma_resv_get_fences - Get an object's shared and exclusive * fences without update side lock held * @obj: the reservation object -* @pfence_excl: the returned exclusive fence (or NULL) -* @pshared_count: the number of shared fences returned -* @pshared: the array of shared fence ptrs returned (array is krealloc'd to +* @fence_excl: the returned exclusive fence (or NULL) +* @shared_count: the number of shared fences returned +* @shared: the array of shared fence ptrs returned (array is krealloc'd to * the required size, and must be freed by caller) * * Retrieve all fences from the reservation object. If the pointer for the * exclusive fence is not specified the fence is put into the array of the * shared fences as well. Returns either zero or -ENOMEM. */ -int dma_resv_get_fences (struct dma_resv *obj,struct dma_fence **pfence_excl, -unsigned int *pshared_count, -struct dma_fence ***pshared) +int dma_resv_get_fences (struct dma_resv *obj,struct dma_fence **fence_excl, +unsigned int *shared_count,struct dma_fence ***shared) { -struct dma_fence **shared =NULL ; -struct dma_fence *fence_excl; -unsigned int shared_count; -int ret =1 ; - -do { -struct dma_resv_list *fobj; -unsigned int i, seq; -size_t sz =0 ; - - shared_count = i =0 ; - -rcu_read_lock (); - seq =read_seqcount_begin (&obj->seq); - - fence_excl =dma_resv_excl_fence (obj); -if (fence_excl && !dma_fence_get_rcu (fence_excl)) - goto unlock; +struct dma_resv_iter cursor; +struct dma_fence *fence; - fobj =dma_resv_shared_list (obj); -if (fobj) - sz +=sizeof (*shared) * fobj->shared_max; + *shared_count =0 ; + *shared =NULL ; -if (!pfence_excl && fence_excl) - sz +=sizeof (*shared); +if (fence_excl) + *fence_excl =NULL ; -if (sz) { -struct dma_fence **nshared; +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (obj, &cursor, true, fence) { - nshared =krealloc (shared, sz, -GFP_NOWAIT | __GFP_NOWARN); -if (!nshared) { -rcu_read_unlock (); +if (cursor.is_first) { +unsigned int count; -dma_fence_put (fence_excl); - fence_excl =NULL ; +while (*shared_count) +dma_fence_put ((*shared)[--(*shared_count)]); - nshared =krealloc (shared, sz,GFP_KERNEL ); -if (nshared) { - shared = nshared; -continue ; - } +if (fence_excl) +dma_fence_put (*fence_excl); - ret = -ENOMEM ; -break ; - } - shared = nshared; - shared_count = fobj ? fobj->shared_count :0 ; -for (i =0 ; i < shared_count; ++i) { - shared[i] =rcu_dereference (fobj->shared[i]); -if (!dma_fence_get_rcu (shared[i])) -break ; - } - } + count = cursor.fences ? cursor.fences->shared_count :0 ; + count += fence_excl ?0 :1 ; +rcu_read_unlock (); -if (i != shared_count ||read_seqcount_retry (&obj->seq, seq)) { -while (i--) -dma_fence_put (shared[i]); -dma_fence_put (fence_excl); - goto unlock; +/* Eventually re-allocate the array */ + *shared =krealloc_array (*shared, count, +sizeof (void *), +GFP_KERNEL ); +if (count && !*shared) +return -ENOMEM ; +rcu_read_lock (); } - ret =0 ; -unlock: -rcu_read_unlock (); - }while (ret); - -if (pfence_excl) - *pfence_excl = fence_excl; -else if (fence_excl) - shared[shared_count++] = fence_excl; +if (dma_resv_iter_is_exclusive (&cursor) && fence_excl) + *fence_excl = fence; +else + (*shared)[(*shared_count)++] = fence; -if (!shared_count) { -kfree (shared); - shared =NULL ; +/* Don't drop the reference */ + fence =NULL ; } +rcu_read_unlock (); - *pshared_count = shared_count; - *pshared = shared; -return ret; +return 0 ; }EXPORT_SYMBOL_GPL (dma_resv_get_fences);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 5/26 dma-buf: use new iterator in dma_resv_wait_timeout
In reply to Christian KönigThis makes the function much simpler since the complex retry logic is now handled elsewhere.
--- drivers/dma-buf/dma-resv.c | 64 +++++--------------------------------- 1 file changed, 7 insertions(+), 57 deletions(-)
drivers/dma-buf/dma-resv.c +7 -57
@@ -569,74 +569,24 @@ long dma_resv_wait_timeout(struct dma_resv *obj, bool wait_all, bool intr, unsigned long timeout) {long ret = timeout ? timeout :1 ; -unsigned int seq, shared_count; +struct dma_resv_iter cursor;struct dma_fence *fence; -int i; -retry: - shared_count =0 ; - seq =read_seqcount_begin (&obj->seq);rcu_read_lock (); - i =-1 ; - - fence =dma_resv_excl_fence (obj); -if (fence && !test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) { -if (!dma_fence_get_rcu (fence)) - goto unlock_retry; +dma_resv_for_each_fence_unlocked (obj, &cursor, wait_all, fence) { +rcu_read_unlock (); -if (dma_fence_is_signaled (fence)) { + ret =dma_fence_wait_timeout (fence, intr, ret); +if (ret <=0 ) {dma_fence_put (fence); - fence =NULL ; +return ret; } - }else { - fence =NULL ; - } - -if (wait_all) { -struct dma_resv_list *fobj =dma_resv_shared_list (obj); - -if (fobj) - shared_count = fobj->shared_count; - -for (i =0 ; !fence && i < shared_count; ++i) { -struct dma_fence *lfence; - - lfence =rcu_dereference (fobj->shared[i]); -if (test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , - &lfence->flags)) -continue ; - -if (!dma_fence_get_rcu (lfence)) - goto unlock_retry; - -if (dma_fence_is_signaled (lfence)) { -dma_fence_put (lfence); -continue ; - } - - fence = lfence; -break ; - } +rcu_read_lock (); } -rcu_read_unlock (); -if (fence) { -if (read_seqcount_retry (&obj->seq, seq)) { -dma_fence_put (fence); - goto retry; - } - ret =dma_fence_wait_timeout (fence, intr, ret); -dma_fence_put (fence); -if (ret >0 && wait_all && (i +1 < shared_count)) - goto retry; - }return ret; - -unlock_retry: -rcu_read_unlock (); - goto retry; }EXPORT_SYMBOL_GPL (dma_resv_wait_timeout);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 6/26 dma-buf: use new iterator in dma_resv_test_signaled
In reply to Christian KönigThis makes the function much simpler since the complex retry logic is now handled elsewhere.
--- drivers/dma-buf/dma-resv.c | 54 +++++--------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-)
drivers/dma-buf/dma-resv.c +7 -47
@@ -591,22 +591,6 @@ long dma_resv_wait_timeout(struct dma_resv *obj, bool wait_all, bool intr,EXPORT_SYMBOL_GPL (dma_resv_wait_timeout); -static inline int dma_resv_test_signaled_single (struct dma_fence *passed_fence) -{ -struct dma_fence *fence, *lfence = passed_fence; -int ret =1 ; - -if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &lfence->flags)) { - fence =dma_fence_get_rcu (lfence); -if (!fence) -return -1 ; - - ret = !!dma_fence_is_signaled (fence); -dma_fence_put (fence); - } -return ret; -} -/** * dma_resv_test_signaled - Test if a reservation object's fences have been * signaled.
@@ -623,43 +607,19 @@ static inline int dma_resv_test_signaled_single(struct dma_fence *passed_fence)*/ bool dma_resv_test_signaled (struct dma_resv *obj,bool test_all) { +struct dma_resv_iter cursor;struct dma_fence *fence; -unsigned int seq; -int ret;rcu_read_lock (); -retry: - ret = true; - seq =read_seqcount_begin (&obj->seq); - -if (test_all) { -struct dma_resv_list *fobj =dma_resv_shared_list (obj); -unsigned int i, shared_count; - - shared_count = fobj ? fobj->shared_count :0 ; -for (i =0 ; i < shared_count; ++i) { - fence =rcu_dereference (fobj->shared[i]); - ret =dma_resv_test_signaled_single (fence); -if (ret <0 ) - goto retry; -else if (!ret) -break ; +dma_resv_for_each_fence_unlocked (obj, &cursor, test_all, fence) { +if (!dma_fence_is_signaled (fence)) { +rcu_read_unlock (); +dma_fence_put (fence); +return false; } } - - fence =dma_resv_excl_fence (obj); -if (ret && fence) { - ret =dma_resv_test_signaled_single (fence); -if (ret <0 ) - goto retry; - - } - -if (read_seqcount_retry (&obj->seq, seq)) - goto retry; -rcu_read_unlock (); -return ret; +return true; }EXPORT_SYMBOL_GPL (dma_resv_test_signaled);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 7/26 drm/ttm: use the new iterator in ttm_bo_flush_all_fences
In reply to Christian KönigThis is probably a fix since we didn't even grabed a reference to the fences.
--- drivers/gpu/drm/ttm/ttm_bo.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -10
@@ -269,19 +269,11 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo)static void ttm_bo_flush_all_fences (struct ttm_buffer_object *bo) {struct dma_resv *resv = &bo->base._resv; -struct dma_resv_list *fobj; +struct dma_resv_iter cursor;struct dma_fence *fence; -int i;rcu_read_lock (); - fobj =dma_resv_shared_list (resv); - fence =dma_resv_excl_fence (resv); -if (fence && !fence->ops->signaled) -dma_fence_enable_sw_signaling (fence); - -for (i =0 ; fobj && i < fobj->shared_count; ++i) { - fence =rcu_dereference (fobj->shared[i]); - +dma_resv_for_each_fence_unlocked (resv, &cursor, true, fence) {if (!fence->ops->signaled)dma_fence_enable_sw_signaling (fence); }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 8/26 drm/amdgpu: use the new iterator in amdgpu_sync_resv
In reply to Christian KönigSimplifying the code a bit.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 44 ++++++++---------------- 1 file changed, 14 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +14 -30
@@ -252,41 +252,25 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync, struct dma_resv *resv, enum amdgpu_sync_mode mode, void *owner) { - struct dma_resv_list *flist; + struct dma_resv_iter cursor;struct dma_fence *f; -unsigned i; -int r =0 ; +int r;if (resv ==NULL )return -EINVAL ; -/* always sync to the exclusive fence */ - f =dma_resv_excl_fence (resv); -dma_fence_chain_for_each (f, f) { -struct dma_fence_chain *chain =to_dma_fence_chain (f); - -if (amdgpu_sync_test_fence (adev, mode, owner, chain ? - chain->fence : f)) { - r =amdgpu_sync_fence (sync, f); -dma_fence_put (f); -if (r) -return r; -break ; - } - } - - flist =dma_resv_shared_list (resv); -if (!flist) -return 0 ; - -for (i =0 ; i < flist->shared_count; ++i) { - f =rcu_dereference_protected (flist->shared[i], -dma_resv_held (resv)); - -if (amdgpu_sync_test_fence (adev, mode, owner, f)) { - r =amdgpu_sync_fence (sync, f); -if (r) -return r; +dma_resv_for_each_fence (resv, &cursor, true, f) { +dma_fence_chain_for_each (f, f) { +struct dma_fence_chain *chain =to_dma_fence_chain (f); + +if (amdgpu_sync_test_fence (adev, mode, owner, chain ? + chain->fence : f)) { + r =amdgpu_sync_fence (sync, f); +dma_fence_put (f); +if (r) +return r; +break ; + } } }return 0 ;
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 9/26 drm/amdgpu: use new iterator in amdgpu_ttm_bo_eviction_valuable
In reply to Christian KönigSimplifying the code a bit.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +4 -10
@@ -1332,10 +1332,9 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo, const struct ttm_place *place) {unsigned long num_pages = bo->resource->num_pages; +struct dma_resv_iter resv_cursor;struct amdgpu_res_cursor cursor; -struct dma_resv_list *flist;struct dma_fence *f; -int i;/* Swapout? */ if (bo->resource->mem_type ==TTM_PL_SYSTEM )
@@ -1349,14 +1348,9 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,* If true, then return false as any KFD process needs all its BOs to * be resident to run successfully */ - flist =dma_resv_shared_list (bo->base.resv); -if (flist) { -for (i =0 ; i < flist->shared_count; ++i) { - f =rcu_dereference_protected (flist->shared[i], -dma_resv_held (bo->base.resv)); -if (amdkfd_fence_check_mm (f, current->mm)) -return false; - } +dma_resv_for_each_fence (bo->base.resv, &resv_cursor, true, f) { +if (amdkfd_fence_check_mm (f, current->mm)) +return false; }switch (bo->resource->mem_type) {
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 10/26 drm/msm: use new iterator in msm_gem_describe
In reply to Christian KönigSimplifying the code a bit. Also drop the RCU read side lock since the object is locked anyway.
Untested since I can't get the driver to compile on !ARM.
--- drivers/gpu/drm/msm/msm_gem.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
drivers/gpu/drm/msm/msm_gem.c +5 -14
@@ -880,7 +880,7 @@ void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m, {struct msm_gem_object *msm_obj =to_msm_bo (obj);struct dma_resv *robj = obj->resv; -struct dma_resv_list *fobj; +struct dma_resv_iter cursor;struct dma_fence *fence;struct msm_gem_vma *vma;uint64_t off =drm_vma_node_start (&obj->vma_node);
@@ -955,22 +955,13 @@ void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m,seq_puts (m,"\n" ); } -rcu_read_lock (); - fobj =dma_resv_shared_list (robj); -if (fobj) { -unsigned int i, shared_count = fobj->shared_count; - -for (i =0 ; i < shared_count; i++) { - fence =rcu_dereference (fobj->shared[i]); +dma_resv_for_each_fence (robj, &cursor, true, fence) { +if (dma_resv_iter_is_exclusive (&cursor)) +describe_fence (fence,"Exclusive" , m); +else describe_fence (fence,"Shared" , m); - } } - fence =dma_resv_excl_fence (robj); -if (fence) -describe_fence (fence,"Exclusive" , m); -rcu_read_unlock (); -msm_gem_unlock (obj); }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 11/26 drm/radeon: use new iterator in radeon_sync_resv
In reply to Christian KönigSimplifying the code a bit.
--- drivers/gpu/drm/radeon/radeon_sync.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-)
drivers/gpu/drm/radeon/radeon_sync.c +3 -19
@@ -91,33 +91,17 @@ int radeon_sync_resv(struct radeon_device *rdev, struct dma_resv *resv, bool shared) { -struct dma_resv_list *flist; -struct dma_fence *f; +struct dma_resv_iter cursor;struct radeon_fence *fence; -unsigned i; +struct dma_fence *f;int r =0 ; -/* always sync to the exclusive fence */ - f =dma_resv_excl_fence (resv); - fence = f ?to_radeon_fence (f) :NULL ; -if (fence && fence->rdev == rdev) -radeon_sync_fence (sync, fence); -else if (f) - r =dma_fence_wait (f, true); - - flist =dma_resv_shared_list (resv); -if (shared || !flist || r) -return r; - -for (i =0 ; i < flist->shared_count; ++i) { - f =rcu_dereference_protected (flist->shared[i], -dma_resv_held (resv)); +dma_resv_for_each_fence (resv, &cursor, shared, f) { fence =to_radeon_fence (f);if (fence && fence->rdev == rdev)radeon_sync_fence (sync, fence);else r =dma_fence_wait (f, true); -if (r)break ; }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 12/26 drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2
In reply to Christian KönigSimplifying the code a bit.
v2: use dma_resv_for_each_fence
--- drivers/gpu/drm/scheduler/sched_main.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +6 -20
@@ -699,30 +699,16 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job, struct drm_gem_object *obj, bool write) { +struct dma_resv_iter cursor; +struct dma_fence *fence;int ret; -struct dma_fence **fences; -unsigned int i, fence_count; - -if (!write) { -struct dma_fence *fence =dma_resv_get_excl_unlocked (obj->resv); - -return drm_sched_job_add_dependency (job, fence); - } - - ret =dma_resv_get_fences (obj->resv,NULL , &fence_count, &fences); -if (ret || !fence_count) -return ret; -for (i =0 ; i < fence_count; i++) { - ret =drm_sched_job_add_dependency (job, fences[i]); +dma_resv_for_each_fence (obj->resv, &cursor, write, fence) { + ret =drm_sched_job_add_dependency (job, fence);if (ret) -break ; +return ret; } - -for (; i < fence_count; i++) -dma_fence_put (fences[i]); -kfree (fences); -return ret; +return 0 ; }EXPORT_SYMBOL (drm_sched_job_add_implicit_dependencies);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 13/26 drm/i915: use the new iterator in i915_gem_busy_ioctl
In reply to Christian KönigThis makes the function much simpler since the complex retry logic is now handled else where.
--- drivers/gpu/drm/i915/gem/i915_gem_busy.c | 30 +++++++----------------- 1 file changed, 9 insertions(+), 21 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_busy.c +9 -21
@@ -82,8 +82,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, {struct drm_i915_gem_busy *args = data;struct drm_i915_gem_object *obj; -struct dma_resv_list *list; -unsigned int seq; +struct dma_resv_iter cursor; +struct dma_fence *fence;int err; err = -ENOENT ;
@@ -109,28 +109,16 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,* to report the overall busyness. This is what the wait-ioctl does. * */ -retry: - seq =raw_read_seqcount (&obj->base.resv->seq); - -/* Translate the exclusive fence to the READ *and* WRITE engine */ - args->busy =busy_check_writer (dma_resv_excl_fence (obj->base.resv)); - -/* Translate shared fences to READ set of engines */ - list =dma_resv_shared_list (obj->base.resv); -if (list) { -unsigned int shared_count = list->shared_count, i; - -for (i =0 ; i < shared_count; ++i) { -struct dma_fence *fence = -rcu_dereference (list->shared[i]); - + args->busy = false; +dma_resv_for_each_fence_unlocked (obj->base.resv, &cursor, true, fence) { +if (dma_resv_iter_is_exclusive (&cursor)) +/* Translate the exclusive fence to the READ *and* WRITE engine */ + args->busy =busy_check_writer (fence); +else +/* Translate shared fences to READ set of engines */ args->busy |=busy_check_reader (fence); - } } -if (args->busy &&read_seqcount_retry (&obj->base.resv->seq, seq)) - goto retry; - err =0 ; out:rcu_read_unlock ();
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 14/26 drm/i915: use the new iterator in i915_sw_fence_await_reservation v2
In reply to Christian KönigSimplifying the code a bit.
v2: use dma_resv_for_each_fence instead, according to Tvrtko the lock is
held here anyway.
--- drivers/gpu/drm/i915/i915_sw_fence.c | 51 +++++----------------------- 1 file changed, 9 insertions(+), 42 deletions(-)
drivers/gpu/drm/i915/i915_sw_fence.c +9 -42
@@ -572,56 +572,23 @@ int i915_sw_fence_await_reservation(struct i915_sw_fence *fence, unsigned long timeout, gfp_t gfp) { -struct dma_fence *excl; +struct dma_resv_iter cursor; +struct dma_fence *f;int ret =0 , pending;debug_fence_assert (fence);might_sleep_if (gfpflags_allow_blocking (gfp)); -if (write) { -struct dma_fence **shared; -unsigned int count, i; - - ret =dma_resv_get_fences (resv, &excl, &count, &shared); -if (ret) -return ret; - -for (i =0 ; i < count; i++) { -if (shared[i]->ops == exclude) -continue ; - - pending =i915_sw_fence_await_dma_fence (fence, - shared[i], - timeout, - gfp); -if (pending <0 ) { - ret = pending; -break ; - } - - ret |= pending; - } - -for (i =0 ; i < count; i++) -dma_fence_put (shared[i]); -kfree (shared); - }else { - excl =dma_resv_get_excl_unlocked (resv); - } - -if (ret >=0 && excl && excl->ops != exclude) { - pending =i915_sw_fence_await_dma_fence (fence, - excl, - timeout, +dma_resv_for_each_fence (resv, &cursor, write, f) { + pending =i915_sw_fence_await_dma_fence (fence, f, timeout, gfp); -if (pending <0 ) +if (pending <0 ) { ret = pending; -else - ret |= pending; - } - -dma_fence_put (excl); +break ; + } + ret |= pending; + }return ret; }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 15/26 drm/i915: use the new iterator in i915_request_await_object v2
In reply to Christian KönigSimplifying the code a bit.
v2: add missing rcu_read_lock()/rcu_read_unlock()
--- drivers/gpu/drm/i915/i915_request.c | 40 ++++++++--------------------- 1 file changed, 11 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/i915_request.c +11 -29
@@ -1509,39 +1509,21 @@ i915_request_await_object(struct i915_request *to, struct drm_i915_gem_object *obj, bool write) { -struct dma_fence *excl; +struct dma_resv_iter cursor; +struct dma_fence *fence;int ret =0 ; -if (write) { -struct dma_fence **shared; -unsigned int count, i; - - ret =dma_resv_get_fences (obj->base.resv, &excl, &count, - &shared); -if (ret) -return ret; - -for (i =0 ; i < count; i++) { - ret =i915_request_await_dma_fence (to, shared[i]); -if (ret) -break ; - -dma_fence_put (shared[i]); +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (obj->base.resv, &cursor, write, fence) { +rcu_read_unlock (); + ret =i915_request_await_dma_fence (to, fence); +rcu_read_lock (); +if (ret) { +dma_fence_put (fence); +break ; } - -for (; i < count; i++) -dma_fence_put (shared[i]); -kfree (shared); - }else { - excl =dma_resv_get_excl_unlocked (obj->base.resv); - } - -if (excl) { -if (ret ==0 ) - ret =i915_request_await_dma_fence (to, excl); - -dma_fence_put (excl); } +rcu_read_unlock ();return ret; }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 16/26 drm/i915: use new iterator in i915_gem_object_wait_reservation v2
In reply to Christian KönigSimplifying the code a bit.
v2: add missing rcu read unlock.
--- drivers/gpu/drm/i915/gem/i915_gem_wait.c | 57 +++++++----------------- 1 file changed, 15 insertions(+), 42 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_wait.c +15 -42
@@ -37,55 +37,28 @@ i915_gem_object_wait_reservation(struct dma_resv *resv, unsigned int flags, long timeout) { -struct dma_fence *excl; -bool prune_fences = false; - -if (flags &I915_WAIT_ALL ) { -struct dma_fence **shared; -unsigned int count, i; -int ret; - - ret =dma_resv_get_fences (resv, &excl, &count, &shared); -if (ret) -return ret; - -for (i =0 ; i < count; i++) { - timeout =i915_gem_object_wait_fence (shared[i], - flags, timeout); -if (timeout <0 ) -break ; - -dma_fence_put (shared[i]); +struct dma_resv_iter cursor; +struct dma_fence *fence; + +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (resv, &cursor, flags &I915_WAIT_ALL , + fence) { + +rcu_read_unlock (); + timeout =i915_gem_object_wait_fence (fence, flags, timeout); +rcu_read_lock (); +if (timeout <0 ) { +dma_fence_put (fence); +break ; } - -for (; i < count; i++) -dma_fence_put (shared[i]); -kfree (shared); - -/* -* If both shared fences and an exclusive fence exist, -* then by construction the shared fences must be later -* than the exclusive fence. If we successfully wait for -* all the shared fences, we know that the exclusive fence -* must all be signaled. If all the shared fences are -* signaled, we can prune the array and recover the -* floating references on the fences/requests. -*/ - prune_fences = count && timeout >=0 ; - }else { - excl =dma_resv_get_excl_unlocked (resv); } - -if (excl && timeout >=0 ) - timeout =i915_gem_object_wait_fence (excl, flags, timeout); - -dma_fence_put (excl); +rcu_read_unlock ();/* * Opportunistically prune the fences iff we know they have *all* been * signaled. */ -if (prune_fences) +if (timeout >0 )dma_resv_prune (resv);return timeout;
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 17/26 drm/i915: use new iterator in i915_gem_object_wait_priority v2
In reply to Christian KönigSimplifying the code a bit.
v2: add missing rcu_read_lock()/unlock()
--- drivers/gpu/drm/i915/gem/i915_gem_wait.c | 33 +++++++----------------- 1 file changed, 9 insertions(+), 24 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_wait.c +9 -24
@@ -124,32 +124,17 @@ i915_gem_object_wait_priority(struct drm_i915_gem_object *obj,unsigned int flags, const struct i915_sched_attr *attr) { - struct dma_fence *excl; - -if (flags &I915_WAIT_ALL ) { -struct dma_fence **shared; -unsigned int count, i; -int ret; - - ret =dma_resv_get_fences (obj->base.resv, &excl, &count, - &shared); -if (ret) -return ret; - -for (i =0 ; i < count; i++) { -i915_gem_fence_wait_priority (shared[i], attr); -dma_fence_put (shared[i]); - } - -kfree (shared); - }else { - excl =dma_resv_get_excl_unlocked (obj->base.resv); - } + struct dma_resv_iter cursor; +struct dma_fence *fence; -if (excl) { -i915_gem_fence_wait_priority (excl, attr); -dma_fence_put (excl); +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (obj->base.resv, &cursor, + flags &I915_WAIT_ALL , fence) { +rcu_read_unlock (); +i915_gem_fence_wait_priority (fence, attr); +rcu_read_lock (); } +rcu_read_unlock ();return 0 ; }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 18/26 drm/i915: use new iterator in i915_gem_object_last_write_engine v2
In reply to Christian KönigThis is maybe even a fix since the RCU usage here looks incorrect.
v2: add missing rcu_read_lock()/unlock()
--- drivers/gpu/drm/i915/gem/i915_gem_object.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.h +7 -6
@@ -507,16 +507,17 @@ static inline struct intel_engine_cs * i915_gem_object_last_write_engine(struct drm_i915_gem_object *obj) {struct intel_engine_cs *engine =NULL ; +struct dma_resv_iter cursor;struct dma_fence *fence;rcu_read_lock (); - fence =dma_resv_get_excl_unlocked (obj->base.resv); +dma_resv_for_each_fence_unlocked (obj->base.resv, &cursor, false, + fence) { +if (fence &&dma_fence_is_i915 (fence) && + !dma_fence_is_signaled (fence)) + engine =to_request (fence)->engine; + }rcu_read_unlock (); - -if (fence &&dma_fence_is_i915 (fence) && !dma_fence_is_signaled (fence)) - engine =to_request (fence)->engine; -dma_fence_put (fence); -return engine; }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 19/26 drm/i915: use new cursor in intel_prepare_plane_fb v2
In reply to Christian KönigSimplifying the code a bit.
v2: add rcu_read_lock()/unlock()
--- drivers/gpu/drm/i915/display/intel_display.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +7 -3
@@ -11290,6 +11290,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,i915_gem_object_flush_frontbuffer (obj,ORIGIN_DIRTYFB );if (!new_plane_state->uapi.fence) {/* implicit fencing */ +struct dma_resv_iter cursor;struct dma_fence *fence; ret = i915_sw_fence_await_reservation(&state->commit_ready,
@@ -11300,12 +11301,15 @@ intel_prepare_plane_fb(struct drm_plane *_plane,if (ret <0 ) goto unpin_fb; - fence =dma_resv_get_excl_unlocked (obj->base.resv); -if (fence) { +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (obj->base.resv, &cursor, false, + fence) { +rcu_read_unlock ();add_rps_boost_after_vblank (new_plane_state->hw.crtc, fence); -dma_fence_put (fence); +rcu_read_lock (); } +rcu_read_unlock (); }else {add_rps_boost_after_vblank (new_plane_state->hw.crtc, new_plane_state->uapi.fence);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 20/26 drm: use new iterator in drm_gem_fence_array_add_implicit v2
In reply to Christian KönigSimplifying the code a bit.
v2: add missing rcu_read_lock()/unlock()
--- drivers/gpu/drm/drm_gem.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-)
drivers/gpu/drm/drm_gem.c +13 -23
@@ -1340,31 +1340,21 @@ int drm_gem_fence_array_add_implicit(struct xarray *fence_array, struct drm_gem_object *obj, bool write) { - int ret; -struct dma_fence **fences; -unsigned int i, fence_count; - -if (!write) { -struct dma_fence *fence = -dma_resv_get_excl_unlocked (obj->resv); - -return drm_gem_fence_array_add (fence_array, fence); - } - - ret =dma_resv_get_fences (obj->resv,NULL , - &fence_count, &fences); -if (ret || !fence_count) -return ret; - -for (i =0 ; i < fence_count; i++) { - ret =drm_gem_fence_array_add (fence_array, fences[i]); -if (ret) +struct dma_resv_iter cursor; +struct dma_fence *fence; +int ret =0 ; + +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (obj->resv, &cursor, write, fence) { +rcu_read_unlock (); + ret =drm_gem_fence_array_add (fence_array, fence); +rcu_read_lock (); +if (ret) { +dma_fence_put (fence);break ; + } } - -for (; i < fence_count; i++) -dma_fence_put (fences[i]); -kfree (fences); +rcu_read_unlock ();return ret; }EXPORT_SYMBOL (drm_gem_fence_array_add_implicit);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 21/26 drm: use new iterator in drm_gem_plane_helper_prepare_fb v2
In reply to Christian KönigMakes the handling a bit more complex, but avoids the use of dma_resv_get_excl_unlocked().
v2: add missing rcu_read_lock()/unlock()
--- drivers/gpu/drm/drm_gem_atomic_helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +10 -2
@@ -143,6 +143,7 @@*/ int drm_gem_plane_helper_prepare_fb (struct drm_plane *plane,struct drm_plane_state *state) { +struct dma_resv_iter cursor;struct drm_gem_object *obj;struct dma_fence *fence;
@@ -150,9 +151,16 @@ int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_streturn 0 ; obj =drm_gem_fb_get_obj (state->fb,0 ); - fence =dma_resv_get_excl_unlocked (obj->resv); -drm_atomic_set_fence_for_plane (state, fence); +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (obj->resv, &cursor, false, fence) { +rcu_read_unlock (); +/* TODO: We only use the first write fence here */ +drm_atomic_set_fence_for_plane (state, fence); +return 0 ; + } +rcu_read_unlock (); +drm_atomic_set_fence_for_plane (state,NULL );return 0 ; }EXPORT_SYMBOL_GPL (drm_gem_plane_helper_prepare_fb);
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 22/26 drm/nouveau: use the new iterator in nouveau_fence_sync
In reply to Christian KönigSimplifying the code a bit.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 48 +++++++------------------ 1 file changed, 12 insertions(+), 36 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +12 -36
@@ -339,14 +339,15 @@ nouveau_fence_wait(struct nouveau_fence *fence, bool lazy, bool intr) }int -nouveau_fence_sync (struct nouveau_bo *nvbo,struct nouveau_channel *chan,bool exclusive,bool intr) +nouveau_fence_sync (struct nouveau_bo *nvbo,struct nouveau_channel *chan, +bool exclusive,bool intr) {struct nouveau_fence_chan *fctx = chan->fence; -struct dma_fence *fence;struct dma_resv *resv = nvbo->bo.base.resv; -struct dma_resv_list *fobj; +struct dma_resv_iter cursor; +struct dma_fence *fence;struct nouveau_fence *f; -int ret =0 , i; +int ret;if (!exclusive) { ret =dma_resv_reserve_shared (resv,1 );
@@ -355,10 +356,7 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool ereturn ret; } - fobj =dma_resv_shared_list (resv); - fence =dma_resv_excl_fence (resv); - -if (fence) { +dma_resv_for_each_fence (resv, &cursor, exclusive, fence) {struct nouveau_channel *prev =NULL ;bool must_wait = true;
@@ -366,41 +364,19 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool eif (f) {rcu_read_lock (); prev =rcu_dereference (f->channel); -if (prev && (prev == chan || fctx->sync (f, prev, chan) ==0 )) +if (prev && (prev == chan || + fctx->sync (f, prev, chan) ==0 )) must_wait = false;rcu_read_unlock (); } -if (must_wait) +if (must_wait) { ret =dma_fence_wait (fence, intr); - -return ret; - } - -if (!exclusive || !fobj) -return ret; - -for (i =0 ; i < fobj->shared_count && !ret; ++i) { -struct nouveau_channel *prev =NULL ; -bool must_wait = true; - - fence =rcu_dereference_protected (fobj->shared[i], -dma_resv_held (resv)); - - f =nouveau_local_fence (fence, chan->drm); -if (f) { -rcu_read_lock (); - prev =rcu_dereference (f->channel); -if (prev && (prev == chan || fctx->sync (f, prev, chan) ==0 )) - must_wait = false; -rcu_read_unlock (); +if (ret) +return ret; } - -if (must_wait) - ret =dma_fence_wait (fence, intr); } - -return ret; +return 0 ; }void
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 23/26 drm/nouveau: use the new interator in nv50_wndw_prepare_fb v2
In reply to Christian KönigMakes the handling a bit more complex, but avoids the use of dma_resv_get_excl_unlocked().
v2: add missing rcu_read_lock()/unlock()
--- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv50/wndw.c +10 -1
@@ -539,6 +539,8 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state)struct nouveau_bo *nvbo;struct nv50_head_atom *asyh;struct nv50_wndw_ctxdma *ctxdma; +struct dma_resv_iter cursor; +struct dma_fence *fence;int ret;NV_ATOMIC (drm,"%s prepare: %p\n" , plane->name, fb);
@@ -561,7 +563,14 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) asyw->image.handle[0 ] = ctxdma->object.handle; } - asyw->state.fence =dma_resv_get_excl_unlocked (nvbo->bo.base.resv); +rcu_read_lock (); +dma_resv_for_each_fence_unlocked (nvbo->bo.base.resv, &cursor, false, + fence) { +/* TODO: We only use the first writer here */ + asyw->state.fence = fence; +break ; + } +rcu_read_unlock (); asyw->image.offset[0 ] = nvbo->offset;if (wndw->func->prepare) {
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 24/26 drm/etnaviv: use new iterator in etnaviv_gem_describe
In reply to Christian KönigInstead of hand rolling the logic.
--- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gem.c +9 -18
@@ -428,19 +428,17 @@ int etnaviv_gem_wait_bo(struct etnaviv_gpu *gpu, struct drm_gem_object *obj,static void etnaviv_gem_describe_fence (struct dma_fence *fence,const char *type,struct seq_file *m) { -if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) -seq_printf (m,"\t%9s: %s %s seq %llu\n" , - type, - fence->ops->get_driver_name (fence), - fence->ops->get_timeline_name (fence), - fence->seqno); +seq_printf (m,"\t%9s: %s %s seq %llu\n" , type, + fence->ops->get_driver_name (fence), + fence->ops->get_timeline_name (fence), + fence->seqno); }static void etnaviv_gem_describe (struct drm_gem_object *obj,struct seq_file *m) {struct etnaviv_gem_object *etnaviv_obj =to_etnaviv_bo (obj);struct dma_resv *robj = obj->resv; -struct dma_resv_list *fobj; +struct dma_resv_iter cursor;struct dma_fence *fence;unsigned long off =drm_vma_node_start (&obj->vma_node);
@@ -450,19 +448,12 @@ static void etnaviv_gem_describe(struct drm_gem_object *obj, struct seq_file *m) off, etnaviv_obj->vaddr, obj->size);rcu_read_lock (); - fobj =dma_resv_shared_list (robj); -if (fobj) { -unsigned int i, shared_count = fobj->shared_count; - -for (i =0 ; i < shared_count; i++) { - fence =rcu_dereference (fobj->shared[i]); +dma_resv_for_each_fence_unlocked (robj, &cursor, true, fence) { +if (dma_resv_iter_is_exclusive (&cursor)) +etnaviv_gem_describe_fence (fence,"Exclusive" , m); +else etnaviv_gem_describe_fence (fence,"Shared" , m); - } } - - fence =dma_resv_excl_fence (robj); -if (fence) -etnaviv_gem_describe_fence (fence,"Exclusive" , m);rcu_read_unlock (); }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 25/26 drm/etnaviv: replace dma_resv_get_excl_unlocked
In reply to Christian KönigWe certainly hold the reservation lock here, no need for the RCU dance.
--- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +1 -1
@@ -195,7 +195,7 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)if (ret)return ret; }else { - bo->excl =dma_resv_get_excl_unlocked (robj); + bo->excl =dma_fence_get (dma_resv_excl_fence (robj)); } }
Signature · 1 line
2.25.1
Christian König
reviewerPATCH 26/26 dma-buf: nuke dma_resv_get_excl_unlocked
In reply to Christian KönigHeureka, that's finally not used any more.
--- include/linux/dma-resv.h | 26 -------------------------- 1 file changed, 26 deletions(-)
include/linux/dma-resv.h +0 -26
@@ -384,32 +384,6 @@ dma_resv_excl_fence(struct dma_resv *obj)return rcu_dereference_check (obj->fence_excl,dma_resv_held (obj)); } -/** -* dma_resv_get_excl_unlocked - get the reservation object's -* exclusive fence, without lock held. -* @obj: the reservation object -* -* If there is an exclusive fence, this atomically increments it's -* reference count and returns it. -* -* RETURNS -* The exclusive fence or NULL if none -*/ -static inline struct dma_fence * -dma_resv_get_excl_unlocked (struct dma_resv *obj) -{ -struct dma_fence *fence; - -if (!rcu_access_pointer (obj->fence_excl)) -return NULL ; - -rcu_read_lock (); - fence =dma_fence_get_rcu_safe (&obj->fence_excl); -rcu_read_unlock (); - -return fence; -} -/** * dma_resv_shared_list - get the reservation object's shared fence list * @obj: the reservation object
Signature · 1 line
2.25.1
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/26] dma-buf: add dma_resv_for_each_fence_unlocked v2
In reply to Christian König== Series Details ==
== Series Details ==
Series: series starting with [01/26] dma-buf: add dma_resv_for_each_fence_unlocked v2
URL : https://patchwork.freedesktop.org/series/94750/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
79becb99fccc dma-buf: add dma_resv_for_each_fence_unlocked v2
-:72: CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
#72: FILE: drivers/dma-buf/dma-resv.c:368:
+ fence = rcu_dereference(-:134: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'obj' - possible side-effects? #134: FILE: include/linux/dma-resv.h:183:
+#define dma_resv_for_each_fence_unlocked(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk_unlocked(obj, cursor, all_fences, true); \
+ fence; dma_fence_put(fence), \
+ fence = dma_resv_walk_unlocked(obj, cursor, all_fences, false))
-:134: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'cursor' - possible side-effects? #134: FILE: include/linux/dma-resv.h:183:
+#define dma_resv_for_each_fence_unlocked(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk_unlocked(obj, cursor, all_fences, true); \
+ fence; dma_fence_put(fence), \
+ fence = dma_resv_walk_unlocked(obj, cursor, all_fences, false))
-:134: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'all_fences' - possible side-effects? #134: FILE: include/linux/dma-resv.h:183:
+#define dma_resv_for_each_fence_unlocked(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk_unlocked(obj, cursor, all_fences, true); \
+ fence; dma_fence_put(fence), \
+ fence = dma_resv_walk_unlocked(obj, cursor, all_fences, false))
-:134: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fence' - possible side-effects? #134: FILE: include/linux/dma-resv.h:183:
+#define dma_resv_for_each_fence_unlocked(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk_unlocked(obj, cursor, all_fences, true); \
+ fence; dma_fence_put(fence), \
+ fence = dma_resv_walk_unlocked(obj, cursor, all_fences, false))
-:162: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 5 checks, 130 lines checked 43fd9d11fcd6 dma-buf: add dma_resv_for_each_fence
-:81: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'obj' - possible side-effects? #81: FILE: include/linux/dma-resv.h:182:
+#define dma_resv_for_each_fence(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk(obj, cursor, all_fences, true); fence; \
+ fence = dma_resv_walk(obj, cursor, all_fences, false))
-:81: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'cursor' - possible side-effects? #81: FILE: include/linux/dma-resv.h:182:
+#define dma_resv_for_each_fence(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk(obj, cursor, all_fences, true); fence; \
+ fence = dma_resv_walk(obj, cursor, all_fences, false))
-:81: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'all_fences' - possible side-effects? #81: FILE: include/linux/dma-resv.h:182:
+#define dma_resv_for_each_fence(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk(obj, cursor, all_fences, true); fence; \
+ fence = dma_resv_walk(obj, cursor, all_fences, false))
-:81: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fence' - possible side-effects? #81: FILE: include/linux/dma-resv.h:182:
+#define dma_resv_for_each_fence(obj, cursor, all_fences, fence) \
+ for (fence = dma_resv_walk(obj, cursor, all_fences, true); fence; \
+ fence = dma_resv_walk(obj, cursor, all_fences, false))
-:97: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 4 checks, 73 lines checkeda8b725463938 dma-buf: use new iterator in dma_resv_copy_fences
-:124: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 106 lines checked20181be832c0 dma-buf: use new iterator in dma_resv_get_fences v2
-:156: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 136 lines checkedd07cfed64ece dma-buf: use new iterator in dma_resv_wait_timeout
-:99: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 81 lines checkedf26d368dba9c dma-buf: use new iterator in dma_resv_test_signaled
-:91: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 72 lines checkedbd71df193561 drm/ttm: use the new iterator in ttm_bo_flush_all_fences
-:39: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 21 lines checked174500546b2b drm/amdgpu: use the new iterator in amdgpu_sync_resv
-:72: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 55 lines checkedf8f742ac41e1 drm/amdgpu: use new iterator in amdgpu_ttm_bo_eviction_valuable
-:47: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 28 lines checkedcc28ebf6dea3 drm/msm: use new iterator in msm_gem_describe
-:55: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 34 lines checked8fe08b573247 drm/radeon: use new iterator in radeon_sync_resv
-:53: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 36 lines checkedd5ec3add7f52 drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2
-:56: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 36 lines checkedf4e64617226b drm/i915: use the new iterator in i915_gem_busy_ioctl
-:64: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 45 lines checked77c552340892 drm/i915: use the new iterator in i915_sw_fence_await_reservation v2
-:86: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 65 lines checked3b3d6edc3ec1 drm/i915: use the new iterator in i915_request_await_object v2
-:70: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 50 lines checked fbe3139fe0d5 drm/i915: use new iterator in i915_gem_object_wait_reservation v2 -:49: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #49: FILE: drivers/gpu/drm/i915/gem/i915_gem_wait.c:46:
+ fence) {
+
-:90: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 1 checks, 70 lines checked01cb40f10c37 drm/i915: use new iterator in i915_gem_object_wait_priority v2
-:61: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 41 lines checkede4c67e16e633 drm/i915: use new iterator in i915_gem_object_last_write_engine v2
-:43: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 23 lines checked36237da723df drm/i915: use new cursor in intel_prepare_plane_fb v2
-:45: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 25 lines checked92c356444b7b drm: use new iterator in drm_gem_fence_array_add_implicit v2
-:63: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 44 lines checkedee7a40d3c32d drm: use new iterator in drm_gem_plane_helper_prepare_fb v2
-:46: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 25 lines checkedcf5d087e77ef drm/nouveau: use the new iterator in nouveau_fence_sync
-:96: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 77 lines checkedaa6d699f8f59 drm/nouveau: use the new interator in nv50_wndw_prepare_fb v2
-:44: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 23 lines checked10b96c40fe4f drm/etnaviv: use new iterator in etnaviv_gem_describe
-:65: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 47 lines checkedfc9b5ce671ec drm/etnaviv: replace dma_resv_get_excl_unlocked
-:25: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 8 lines checkeda648c89556c2 dma-buf: nuke dma_resv_get_excl_unlocked
-:49: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <[email protected]>' != 'Signed-off-by: Christian König <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 32 lines checked
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [01/26] dma-buf: add dma_resv_for_each_fence_unlocked v2
In reply to Christian König== Series Details ==
== Series Details ==
Series: series starting with [01/26] dma-buf: add dma_resv_for_each_fence_unlocked v2
URL : https://patchwork.freedesktop.org/series/94750/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_10596 -> Patchwork_21073
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_21073 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_21073, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_21073:
### IGT changes ###
#### Possible regressions ####
* igt@kms_force_connector_basic@force-connector-state:
- fi-kbl-7567u: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-kbl-7567u/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-7567u/igt@[email protected]
- fi-kbl-8809g: [PASS][3] -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-kbl-8809g/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-8809g/igt@[email protected]
- fi-kbl-guc: [PASS][5] -> [DMESG-WARN][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-kbl-guc/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-guc/igt@[email protected]
* igt@runner@aborted:
- fi-rkl-11600: NOTRUN -> [FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-rkl-11600/igt@[email protected]
- fi-bwr-2160: NOTRUN -> [FAIL][8]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-bwr-2160/igt@[email protected]
#### Warnings ####
* igt@runner@aborted:
- fi-rkl-guc: [FAIL][9] ([i915#2426]) -> [FAIL][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-rkl-guc/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-rkl-guc/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@runner@aborted:
- {fi-tgl-dsi}: [FAIL][11] ([i915#2932] / [i915#3690]) -> [FAIL][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-tgl-dsi/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-tgl-dsi/igt@[email protected]
- {fi-jsl-1}: NOTRUN -> [FAIL][13]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-jsl-1/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_21073 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@runner@aborted:
- fi-pnv-d510: NOTRUN -> [FAIL][14] ([i915#2403])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-pnv-d510/igt@[email protected]
- fi-cfl-8700k: NOTRUN -> [FAIL][15] ([i915#3363] / [k.org#202107] / [k.org#202109])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-cfl-8700k/igt@[email protected]
- fi-skl-6600u: NOTRUN -> [FAIL][16] ([i915#3363])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-skl-6600u/igt@[email protected]
- fi-cfl-8109u: NOTRUN -> [FAIL][17] ([i915#3363] / [k.org#202107] / [k.org#202109])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-cfl-8109u/igt@[email protected]
- fi-icl-u2: NOTRUN -> [FAIL][18] ([i915#1569] / [i915#3363])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-icl-u2/igt@[email protected]
- fi-kbl-8809g: NOTRUN -> [FAIL][19] ([i915#3363])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-8809g/igt@[email protected]
- fi-kbl-r: NOTRUN -> [FAIL][20] ([i915#1569] / [i915#192] / [i915#193] / [i915#194] / [i915#3363])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-r/igt@[email protected]
- fi-kbl-7500u: NOTRUN -> [FAIL][21] ([i915#1569] / [i915#192] / [i915#193] / [i915#194] / [i915#3363])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-7500u/igt@[email protected]
- fi-kbl-guc: NOTRUN -> [FAIL][22] ([i915#3363])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-guc/igt@[email protected]
- fi-cml-u2: NOTRUN -> [FAIL][23] ([i915#3363])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-cml-u2/igt@[email protected]
- fi-cfl-guc: NOTRUN -> [FAIL][24] ([i915#3363] / [k.org#202107] / [k.org#202109])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-cfl-guc/igt@[email protected]
- fi-icl-y: NOTRUN -> [FAIL][25] ([i915#1569])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-icl-y/igt@[email protected]
- fi-kbl-7567u: NOTRUN -> [FAIL][26] ([i915#3363])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-7567u/igt@[email protected]
#### Warnings ####
* igt@runner@aborted:
- fi-kbl-soraka: [FAIL][27] ([i915#2426] / [i915#3363]) -> [FAIL][28] ([i915#1569] / [i915#192] / [i915#193] / [i915#194] / [i915#3363])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-kbl-soraka/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-kbl-soraka/igt@[email protected]
- fi-skl-6700k2: [FAIL][29] ([i915#2426] / [i915#3363]) -> [FAIL][30] ([i915#3363])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10596/fi-skl-6700k2/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/fi-skl-6700k2/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#1569]: https://gitlab.freedesktop.org/drm/intel/issues/1569
[i915#192]: https://gitlab.freedesktop.org/drm/intel/issues/192
[i915#193]: https://gitlab.freedesktop.org/drm/intel/issues/193
[i915#194]: https://gitlab.freedesktop.org/drm/intel/issues/194
[i915#2403]: https://gitlab.freedesktop.org/drm/intel/issues/2403
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2932]: https://gitlab.freedesktop.org/drm/intel/issues/2932
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
[i915#3690]: https://gitlab.freedesktop.org/drm/intel/issues/3690
[k.org#202107]: https://bugzilla.kernel.org/show_bug.cgi?id=202107
[k.org#202109]: https://bugzilla.kernel.org/show_bug.cgi?id=202109
Participating hosts (37 -> 35)
------------------------------
Missing (2): fi-bsw-cyan fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_10596 -> Patchwork_21073
CI-20190529: 20190529
CI_DRM_10596: 3e450101ba783c61e51898a84b7758efbb505e8f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6209: 07d6594ed02f55b68d64fa6dd7f80cfbc1ce4ef8 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_21073: a648c89556c265b0c3c9882534c36c14c8982f39 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
a648c89556c2 dma-buf: nuke dma_resv_get_excl_unlockedfc9b5ce671ec drm/etnaviv: replace dma_resv_get_excl_unlocked10b96c40fe4f drm/etnaviv: use new iterator in etnaviv_gem_describe aa6d699f8f59 drm/nouveau: use the new interator in nv50_wndw_prepare_fb v2 cf5d087e77ef drm/nouveau: use the new iterator in nouveau_fence_sync ee7a40d3c32d drm: use new iterator in drm_gem_plane_helper_prepare_fb v2 92c356444b7b drm: use new iterator in drm_gem_fence_array_add_implicit v2 36237da723df drm/i915: use new cursor in intel_prepare_plane_fb v2 e4c67e16e633 drm/i915: use new iterator in i915_gem_object_last_write_engine v2 01cb40f10c37 drm/i915: use new iterator in i915_gem_object_wait_priority v2 fbe3139fe0d5 drm/i915: use new iterator in i915_gem_object_wait_reservation v2 3b3d6edc3ec1 drm/i915: use the new iterator in i915_request_await_object v2 77c552340892 drm/i915: use the new iterator in i915_sw_fence_await_reservation v2 f4e64617226b drm/i915: use the new iterator in i915_gem_busy_ioctl d5ec3add7f52 drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2 8fe08b573247 drm/radeon: use new iterator in radeon_sync_resvcc28ebf6dea3 drm/msm: use new iterator in msm_gem_describef8f742ac41e1 drm/amdgpu: use new iterator in amdgpu_ttm_bo_eviction_valuable 174500546b2b drm/amdgpu: use the new iterator in amdgpu_sync_resv bd71df193561 drm/ttm: use the new iterator in ttm_bo_flush_all_fences f26d368dba9c dma-buf: use new iterator in dma_resv_test_signaled d07cfed64ece dma-buf: use new iterator in dma_resv_wait_timeout 20181be832c0 dma-buf: use new iterator in dma_resv_get_fences v2 a8b725463938 dma-buf: use new iterator in dma_resv_copy_fences43fd9d11fcd6 dma-buf: add dma_resv_for_each_fence79becb99fccc dma-buf: add dma_resv_for_each_fence_unlocked v2
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21073/index.html