From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966392AbcHDVTC (ORCPT ); Thu, 4 Aug 2016 17:19:02 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:36475 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965712AbcHDVS7 (ORCPT ); Thu, 4 Aug 2016 17:18:59 -0400 Date: Thu, 4 Aug 2016 18:18:53 -0300 From: Gustavo Padovan To: Chris Wilson , dri-devel@lists.freedesktop.org, marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.com Subject: Re: [PATCH v4 5/5] dma-buf/sync_file: only enable fence signalling on poll() Message-ID: <20160804211853.GA2478@joana> Mail-Followup-To: Gustavo Padovan , Chris Wilson , dri-devel@lists.freedesktop.org, marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.com References: <1468346925-12774-1-git-send-email-gustavo@padovan.org> <1468346925-12774-5-git-send-email-gustavo@padovan.org> <20160803114328.GI20686@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160803114328.GI20686@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-08-03 Chris Wilson : > On Tue, Jul 12, 2016 at 03:08:45PM -0300, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > Signalling doesn't need to be enabled at sync_file creation, it is only > > required if userspace waiting the fence to signal through poll(). > > > > Thus we delay fence_add_callback() until poll is called. It only adds the > > callback the first time poll() is called. This avoid re-adding the same > > callback multiple times. > > > > v2: rebase and update to work with new fence support for sync_file > > > > v3: use atomic operation to set enabled and protect fence_add_callback() > > There's actually a spare bit in fence->flags you can use for this. > > #define POLL_ENABLED FENCE_FLAG_USER_BITS Wouldn't it be better to add a new bit to fence_flags_bit? Gustavo