Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941364AbcKOIkN (ORCPT ); Tue, 15 Nov 2016 03:40:13 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:61636 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752242AbcKOIkM (ORCPT ); Tue, 15 Nov 2016 03:40:12 -0500 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Tue, 15 Nov 2016 08:39:56 +0000 From: Chris Wilson To: Gustavo Padovan , 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 v11 2/3] drm/fence: add fence timeline to drm_crtc Message-ID: <20161115083956.GC30410@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Gustavo Padovan , 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: <1479175056-28803-1-git-send-email-gustavo@padovan.org> <1479175056-28803-3-git-send-email-gustavo@padovan.org> <20161115082555.GB30410@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161115082555.GB30410@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1098 Lines: 28 On Tue, Nov 15, 2016 at 08:25:55AM +0000, Chris Wilson wrote: > On Tue, Nov 15, 2016 at 10:57:35AM +0900, Gustavo Padovan wrote: > > /** > > + * dma_crtc_fence_ops - fence ops for the drm_crtc timeline > > + * > > + * It contains the dma_fence_ops that should be called by the dma_fence > > + * code. CRTC core should use this ops when initializing fences. > > + */ > > +extern const struct dma_fence_ops drm_crtc_fence_ops; > > + > > +static inline struct drm_crtc *fence_to_crtc(struct dma_fence *fence) > > +{ > > + BUG_ON(fence->ops != &drm_crtc_fence_ops); > > + return container_of(fence->lock, struct drm_crtc, fence_lock); > > +} > > If you are planning to export this for use by drivers, you are missing > the EXPORT_SYMBOL(drm_crtc_fence_ops). My suggestion would not to have the BUG_ON() here (saves one checkpatch.pl complaint in exchange for a slightly more mysterious GPF). Also please consider calling this dma_fence_to_crtc() as otherwise it conflicts with those with plans to use struct fences on their crtc/states. -Chris -- Chris Wilson, Intel Open Source Technology Centre