[PATCH 14/20] drm: add convenience function to create an enum property

David Airlie airlied at redhat.com
Wed Feb 1 04:55:40 PST 2012



----- Original Message -----
> From: "Chris Wilson" <chris at chris-wilson.co.uk>
> To: "Sascha Hauer" <s.hauer at pengutronix.de>, dri-devel at lists.freedesktop.org
> Cc: kernel at pengutronix.de
> Sent: Wednesday, 1 February, 2012 11:48:53 AM
> Subject: Re: [PATCH 14/20] drm: add convenience function to create an enum	property
> 
> On Wed,  1 Feb 2012 11:38:32 +0100, Sascha Hauer
> <s.hauer at pengutronix.de> wrote:
> > Creating an enum property is a common pattern, so create
> > a convenience function for this and use it where appropriate.
> 
> Similar naming comments apply as for drm_property_create_range.
> However,
> I did spot something anomalous...
> 
> > 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.

Dave.


More information about the dri-devel mailing list