From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966675AbcA1JXy (ORCPT ); Thu, 28 Jan 2016 04:23:54 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33495 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964994AbcA1JXs (ORCPT ); Thu, 28 Jan 2016 04:23:48 -0500 Date: Thu, 28 Jan 2016 10:23:55 +0100 From: Daniel Vetter To: Greg Hackmann Cc: Gustavo Padovan , Emil Velikov , Maarten Lankhorst , Greg Kroah-Hartman , "Linux-Kernel@Vger. Kernel. Org" , devel@driverdev.osuosl.org, ML dri-devel , Daniel Stone , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Riley Andrews , Daniel Vetter , Rob Clark , John Harrison , Gustavo Padovan Subject: Re: [PATCH v2 01/11] dma-buf/sync_file: de-stage sync_file Message-ID: <20160128092355.GS11240@phenom.ffwll.local> Mail-Followup-To: Greg Hackmann , Gustavo Padovan , Emil Velikov , Maarten Lankhorst , Greg Kroah-Hartman , "Linux-Kernel@Vger. Kernel. Org" , devel@driverdev.osuosl.org, ML dri-devel , Daniel Stone , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Riley Andrews , Rob Clark , John Harrison , Gustavo Padovan References: <1453901439-19467-1-git-send-email-gustavo@padovan.org> <1453901439-19467-2-git-send-email-gustavo@padovan.org> <56A8D4A7.1070409@linux.intel.com> <20160127170313.GC3773@joana> <20160127202540.GD3773@joana> <56A9396F.8010803@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A9396F.8010803@google.com> X-Operating-System: Linux phenom 4.3.0-1-amd64 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 On Wed, Jan 27, 2016 at 01:41:03PM -0800, Greg Hackmann wrote: > On 01/27/2016 12:25 PM, Gustavo Padovan wrote: > >>>>Is there a value in keeping the abi unchanged? > >>>>If not, then Documentation/ioctl/botching-up-ioctls.txt is worth a read. > >>> > >>>None from me. I'll look where we can improve the ABI. > > Android has existing clients of the current ABI. Thankfully they're all > contained in system services like SurfaceFlinger, since end-user apps don't > get direct access to fence fds. > > As long the ABI breaks don't remove functionality we depend on, we can wrap > around them in our userspace libsync. I'd rather not have to do that, but > it's a price I'm willing to pay to get this moved out of staging. > > >> - struct sync_file_info_data::fence_info is of type __u8 yet it is "a > >>fence_info struct for every fence in the sync_file". Thus shouldn't > >>one use "struct fence_info" as the type ? > > > >Agreed. But I'm currently thinking if we really should keep this ioctl. > > > > Gustavo > > > > I'm not seeing any consumers of driver_data in our tree. OTOH completely > getting rid of the ioctl would be a problem, since SurfaceFlinger depends on > the timestamp information for its own bookkeeping. If we remove driver_data (and len is superflous too), then I think we should also make the master struct use common ioctl pattern: - Add a num_fences field or similar that the kernel fills out. - Make pt_info an __u64 pointer instead of a variable-length array (and length) - ioctl payload sizes are somewhat limited. This way the interface is future-proofed for truly patalogical number of fences (which surface flinger won't do, but could happen in server/opencl/media workloads I'd imagine). And I think driver_data really shouldn't be there, it makes things complicated with the array of variable-sized objects, and generic userspace can't really use it - for debug output we already have obj/driver_name per fence point, which I think is good enough. Would that be ok for you from the Android side if Gustavo also provides a patch to update libsync? I don't think the ABI is fundamentally broken, but this light cleanup would be nice. Wrt keeping SYNC_WAIT: I think that's totally fine. Redundant since polling is supported, but not really an issue imo either. If we're totally lazy we could implement SYNC_WAIT internally using poll and shave off a few lines of the implementation. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch