Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1403743
| From | Gustavo Padovan <gustavo.padovan@collabora.co.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] dma-buf/fence: add fence_collection fences |
| Date | 2016-05-19 15:30 +0200 |
| Message-ID | <rAwbx-kQ-43@gated-at.bofh.it> (permalink) |
| References | <rAgT8-7if-21@gated-at.bofh.it> <rAiBA-8gC-15@gated-at.bofh.it> <rAr2a-5i8-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Christian,
2016-05-19 Christian König <christian.koenig@amd.com>:
> Am 19.05.2016 um 00:57 schrieb Chris Wilson:
> > On Wed, May 18, 2016 at 05:59:52PM -0300, Gustavo Padovan wrote:
> > > +static void collection_check_cb_func(struct fence *fence, struct fence_cb *cb)
> > > +{
> > > + struct fence_collection_cb *f_cb;
> > > + struct fence_collection *collection;
> > > +
> > > + f_cb = container_of(cb, struct fence_collection_cb, cb);
> > > + collection = f_cb->collection;
> > > +
> > > + if (atomic_dec_and_test(&collection->num_pending_fences))
> > > + fence_signal(&collection->base);
> > > +}
> > > +
> > > +static bool fence_collection_enable_signaling(struct fence *fence)
> > > +{
> > > + struct fence_collection *collection = to_fence_collection(fence);
> > > + int i;
> > > +
> > > + for (i = 0 ; i < collection->num_fences ; i++) {
> > > + if (fence_add_callback(collection->fences[i].fence,
> > > + &collection->fences[i].cb,
> > > + collection_check_cb_func)) {
> > > + atomic_dec(&collection->num_pending_fences);
> > > + }
> > > + }
> > We don't always have a convenient means to preallocate an array of
> > fences to use. Keeping a list of fences in addition to the array would
> > be easier to user in many circumstances.
>
> I agree that there is use for such an implementation as well, but as
> mentioned in the last review cycle we intentionally chose an array instead
> of a more complex implementation here.
>
> This way the array can be passed to function like fence_wait_any_timeout()
> as well.
>
> I also suggested to rename it to fence_array to make that difference clear
> and allow for another implementation to live side by side with this.
>
> My crux at the moment is that I need both for the amdgpu driver, an array
> based implementation and a collection like one.
>
> Gustavo would you mind if I take your patches and work a bit on this?
Please go ahead with this and let me know if you need anything from me.
Gustavo
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/2] dma-buf/fence: add fence_collection fences Gustavo Padovan <gustavo@padovan.org> - 2016-05-18 23:10 +0200
Re: [PATCH 1/2] dma-buf/fence: add fence_collection fences Chris Wilson <chris@chris-wilson.co.uk> - 2016-05-19 01:00 +0200
Re: [PATCH 1/2] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-05-19 10:00 +0200
Re: [PATCH 1/2] dma-buf/fence: add fence_collection fences Gustavo Padovan <gustavo.padovan@collabora.co.uk> - 2016-05-19 15:30 +0200
csiph-web