From: Daniel Vetter Subject: Re: [PATCH 14/20] drm: add convenience function to create an enum property Date: Wed, 1 Feb 2012 15:00:58 +0100 Message-ID: <20120201140058.GA8395@phenom.ffwll.local> References: <989b3fff-c66a-410f-9c3f-fdbc911b2e73@zmail16.collab.prod.int.phx2.redhat.com> <20120201130538.GS1990@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id E05CB9E775 for ; Wed, 1 Feb 2012 06:00:59 -0800 (PST) Received: by wico1 with SMTP id o1so1096547wic.36 for ; Wed, 01 Feb 2012 06:00:59 -0800 (PST) Content-Disposition: inline In-Reply-To: <20120201130538.GS1990@pengutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Sascha Hauer Cc: David Airlie , kernel@pengutronix.de, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Feb 01, 2012 at 02:05:38PM +0100, Sascha Hauer wrote: > On Wed, Feb 01, 2012 at 07:55:40AM -0500, David Airlie wrote: > > > > > > > > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > > > > index 8d593ad..cdbbb40 100644 > > > > --- a/include/drm/drm_crtc.h > > > > +++ b/include/drm/drm_crtc.h > > > > @@ -394,7 +394,7 @@ struct drm_crtc { > > > > s64 framedur_ns, linedur_ns, pixeldur_ns; > > > > > > > > /* if you are using the helper */ > > > > - void *helper_private; > > > > + struct drm_crtc_helper_funcs *helper_private; > > > > }; > > > > > > > > > > > > @@ -481,7 +481,7 @@ struct drm_encoder { > > > > > > > > struct drm_crtc *crtc; > > > > const struct drm_encoder_funcs *funcs; > > > > - void *helper_private; > > > > + struct drm_encoder_helper_funcs *helper_private; > > > > }; > > > > > > > > enum drm_connector_force { > > > > @@ -573,7 +573,7 @@ struct drm_connector { > > > > /* requested DPMS state */ > > > > int dpms; > > > > > > > > - void *helper_private; > > > > + struct drm_connector_helper_funcs *helper_private; > > > > > > > > /* forced on connector */ > > > > enum drm_connector_force force; > > > > > > This is a separate chunk. > > > > And totally wrong, using the helper should remain optional, and the > > helper includes should not be included into the main headers. > > The intention was to prevent people from thinking that they > should invent their own set of helper functions. As these > are only pointers we could also add a > > struct drm_crtc_helper_funcs; > struct drm_connector_helper_funcs; > struct drm_encoder_helper_funcs; > > to drm_crtc.h without having to include the helper includes. I like this, it makes it a notch more obvious what these are for. And we have precedence for slightly violating abstraction in this way: E.g. the vfs isn't splattered with void pointers just because you're free to ignore a lot of stuff (like the pagecache) when implementing an fs ... Cheers, Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48