[PATCH v2 01/25] drm/drm_panel: no error when no callback

Sam Ravnborg sam at ravnborg.org
Sun Dec 8 08:41:12 UTC 2019


Hi Michał

> > diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
> > index ce8da64022b4..d71655b2634c 100644
> > --- a/include/drm/drm_panel.h
> > +++ b/include/drm/drm_panel.ha
> [...]
> >  	/**
> >  	 * @get_modes:
> >  	 *
> > -	 * Add modes to the connector that the panel is attached to and
> > -	 * return the number of modes added.
> > +	 * Add modes to the connector that the panel is attached to.
> > +	 *
> > +	 * This function is mandatory.
> > +	 *
> > +	 * Returns the number of modes added, -EOPNOTSUPP if callback
> > +	 * is missing, -EINVAL if panel is NULL.
> >  	 */
> >  	int (*get_modes)(struct drm_panel *panel);
> >  
> 
> Hi!
> 
> If .get_modes is mandatory, then panel->func != NULL checks can be removed
> if panel->func and .get_modes presence gets checked at panel probe time.

drivers are supposed to use drm_panel_init() to set up panel-func,
so that would be a good time to verify that preconditions are met.
But as we have no control if any drivers does wrong things later
the checks for consistency still makes sense.
I have a few other small changes pending and will include checks
in drm_panel_init().

Thanks,
	Sam


More information about the dri-devel mailing list