Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941469AbcKOIms (ORCPT ); Tue, 15 Nov 2016 03:42:48 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33986 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941376AbcKOImn (ORCPT ); Tue, 15 Nov 2016 03:42:43 -0500 Date: Tue, 15 Nov 2016 17:42:35 +0900 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 v11 2/3] drm/fence: add fence timeline to drm_crtc Message-ID: <20161115084235.GA20601@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: <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.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2009 Lines: 71 2016-11-15 Chris Wilson : > On Tue, Nov 15, 2016 at 10:57:35AM +0900, Gustavo Padovan wrote: > > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > > index 11780a9..0870de1 100644 > > --- a/include/drm/drm_crtc.h > > +++ b/include/drm/drm_crtc.h > > @@ -32,6 +32,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > #include > > #include > > #include > > @@ -739,9 +741,52 @@ struct drm_crtc { > > */ > > struct drm_crtc_crc crc; > > #endif > > + > > + /** > > + * @fence_context: > > + * > > + * timeline context used for fence operations. > > + */ > > + unsigned int fence_context; > > + > > + /** > > + * @fence_lock: > > + * > > + * spinlock to protect the fences in the fence_context. > > + */ > > + > > + spinlock_t fence_lock; > > + /** > > + * @fence_seqno: > > + * > > + * Seqno variable used as monotonic counter for the fences > > + * created on the CRTC's timeline. > > + */ > > + unsigned long fence_seqno; > > + > > + /** > > + * @timeline_name: > > + * > > + * The name of the CRTC's fence timeline. > > + */ > > + char timeline_name[32]; > > }; > > > > /** > > + * 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). Drivers should not be using this, at least for now. Gustavo