Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753035AbcD0Ggu (ORCPT ); Wed, 27 Apr 2016 02:36:50 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37273 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752505AbcD0Ggs (ORCPT ); Wed, 27 Apr 2016 02:36:48 -0400 Date: Wed, 27 Apr 2016 08:36:43 +0200 From: Daniel Vetter To: Gustavo Padovan Cc: Gustavo Padovan , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Stone , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Riley Andrews , Rob Clark , Greg Hackmann , John Harrison , Maarten Lankhorst , Sumit Semwal Subject: Re: [RFC v2 1/8] dma-buf/fence: add fence_collection fences Message-ID: <20160427063643.GG2558@phenom.ffwll.local> Mail-Followup-To: Gustavo Padovan , Gustavo Padovan , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Stone , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Riley Andrews , Rob Clark , Greg Hackmann , John Harrison , Maarten Lankhorst , Sumit Semwal References: <1461623608-29538-1-git-send-email-gustavo@padovan.org> <1461623608-29538-2-git-send-email-gustavo@padovan.org> <20160426144102.GX8291@phenom.ffwll.local> <20160426150208.GJ7857@joana> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160426150208.GJ7857@joana> X-Operating-System: Linux phenom 4.6.0-rc5+ 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 Content-Length: 2118 Lines: 48 On Tue, Apr 26, 2016 at 12:02:08PM -0300, Gustavo Padovan wrote: > 2016-04-26 Daniel Vetter : > > > On Mon, Apr 25, 2016 at 07:33:21PM -0300, Gustavo Padovan wrote: > > > From: Gustavo Padovan > > > > > > struct fence_collection inherits from struct fence and carries a > > > collection of fences that needs to be waited together. > > > > > > It is useful to translate a sync_file to a fence to remove the complexity > > > of dealing with sync_files on DRM drivers. So even if there are many > > > fences in the sync_file that needs to waited for a commit to happen, > > > they all get added to the fence_collection and passed for DRM use as > > > a standard struct fence. > > > > > > That means that no changes needed to any driver besides supporting fences. > > > > > > fence_collection's fence doesn't belong to any timeline context, so > > > fence_is_later() and fence_later() are not meant to be called with > > > fence_collections fences. > > > > > > v2: Comments by Daniel Vetter: > > > - merge fence_collection_init() and fence_collection_add() > > > - only add callbacks at ->enable_signalling() > > > - remove fence_collection_put() > > > - check for type on to_fence_collection() > > > - adjust fence_is_later() and fence_later() to WARN_ON() if they > > > are used with collection fences. > > > > > > Signed-off-by: Gustavo Padovan > > > > FENCE_NO_CONTEXT semantics needs an ack from amdgpu maintainers. I'm not > > entirely sure they might not hit the new WARN_ON by accident now. Please > > cc Alex Deucher & Christian K?nig. > > Sure, I'll Cc then in the revision. But if they use > fence_context_alloc() to get the context they should never hit any > WARN_ON as context numbers now starts at 1. 0 is reserved for > FENCE_NO_CONTEXT. I was more concerned whether the codepaths could accidentally walk over non-amdgpu fences (through prime buffer sharing for example). Otoh that would be a preexisting bug I think ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch