From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752826AbcD1OrH (ORCPT ); Thu, 28 Apr 2016 10:47:07 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:33368 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809AbcD1OrF (ORCPT ); Thu, 28 Apr 2016 10:47:05 -0400 Date: Thu, 28 Apr 2016 11:47:00 -0300 From: Gustavo Padovan To: Chris Wilson , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Gustavo Padovan , John Harrison Subject: Re: [RFC v2 1/8] dma-buf/fence: add fence_collection fences Message-ID: <20160428144700.GB3496@joana> Mail-Followup-To: Gustavo Padovan , Chris Wilson , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Gustavo Padovan , John Harrison References: <1461623608-29538-1-git-send-email-gustavo@padovan.org> <1461623608-29538-2-git-send-email-gustavo@padovan.org> <20160426150939.GQ27856@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160426150939.GQ27856@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-04-26 Chris Wilson : > On Mon, Apr 25, 2016 at 07:33:21PM -0300, Gustavo Padovan wrote: > > +static const char *fence_collection_get_timeline_name(struct fence *fence) > > +{ > > + return "no context"; > > "unbound" to distinguish from fence contexts within a timeline? > > > +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); > > + return false; > > Don't stop, we need to enable all the others! > > > + } > > + } > > + > > + return !!atomic_read(&collection->num_pending_fences); > > Redundant !! > > > +} > > + > > +static bool fence_collection_signaled(struct fence *fence) > > +{ > > + struct fence_collection *collection = to_fence_collection(fence); > > + > > + return (atomic_read(&collection->num_pending_fences) == 0); > > Redundant () > > > +static signed long fence_collection_wait(struct fence *fence, bool intr, > > + signed long timeout) > > +{ > > What advantage does this have over fence_default_wait? You enable > signaling on all, then wait sequentially. The code looks redundant and > could just use fence_default_wait instead. None actually, I'll just replace it with fence_default_wait(). Gustavo