[PATCH 6/9] drm/ast: Add primary plane

Daniel Vetter daniel at ffwll.ch
Tue Nov 5 09:54:48 UTC 2019


On Tue, Nov 05, 2019 at 10:51:02AM +0100, Gerd Hoffmann wrote:
> > +static const struct drm_plane_funcs ast_primary_plane_funcs = {
> > +	.update_plane = drm_atomic_helper_update_plane,
> > +	.disable_plane = drm_atomic_helper_disable_plane,
> > +	.destroy = drm_plane_cleanup,
> > +	.reset = drm_atomic_helper_plane_reset,
> > +	.set_property = NULL,
> > +	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
> > +	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
> > +	.atomic_set_property = NULL,
> > +	.atomic_get_property = NULL,
> 
> It's not needed to explicitly set optional function pointers to NULL.

Yeah leaving them out completely helps a lot with grepping over all the
drivers to find users of stuff.
-Daniel

> 
> >  static const struct drm_encoder_helper_funcs ast_enc_helper_funcs = {
> >  	.dpms = ast_encoder_dpms,
> >  	.prepare = ast_encoder_prepare,
> > @@ -976,10 +1045,33 @@ static void ast_cursor_fini(struct drm_device *dev)
> >  
> >  int ast_mode_init(struct drm_device *dev)
> >  {
> > +	static const uint32_t primary_plane_formats[] = {
> > +		DRM_FORMAT_XRGB8888,
> > +		DRM_FORMAT_RGB565,
> > +		DRM_FORMAT_C8,
> > +	};
> 
> I'd suggest to move this out of the function.
> 
> cheers,
>   Gerd
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list