[PATCH v2 1/4] drm/panel: Add new helpers for refcounted panel allocatons

Anusha Srivatsa asrivats at redhat.com
Fri Mar 28 14:11:20 UTC 2025


On Fri, Mar 28, 2025 at 4:34 AM Luca Ceresoli <luca.ceresoli at bootlin.com>
wrote:

> Hello Anusha,
>
> Thanks for your continued effort.
>
> I have a few minor comments. Nothing big, but since Maxime requested a
> change you'll have to send a new iteration, so find my comments below.
>
> On Thu, 27 Mar 2025 10:55:39 -0400
> Anusha Srivatsa <asrivats at redhat.com> wrote:
>
> [...]
>
> > diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
> > index
> a9c042c8dea1a82ef979c7a68204e0b55483fc28..53251c6b11d78149ede3dad41ffa6a88f3c3c58b
> 100644
> > --- a/include/drm/drm_panel.h
> > +++ b/include/drm/drm_panel.h
> > @@ -28,6 +28,7 @@
> >  #include <linux/errno.h>
> >  #include <linux/list.h>
> >  #include <linux/mutex.h>
> > +#include <linux/kref.h>
>
> Minor nit: you don't need this include in patch 1. You should move it
> to patch 2 where it is actually used.
>
> > @@ -268,6 +269,28 @@ struct drm_panel {
> >       bool enabled;
> >  };
> >
> > +void *__devm_drm_panel_alloc(struct device *dev, size_t size, size_t
> offset,
> > +                          const struct drm_panel_funcs *funcs,
> > +                          int connector_type);
> > +
> > +/**
> > + * devm_drm_panel_alloc - Allocate and initialize an refcounted panel
>                                                      ^^
> A typo here is certainly not a huge problem, but I think I had already
> reported this should be "a refcounted panel".
>
> Yeah you had and I thought I had taken care of it. WIll change this.

> + * @dev: struct device of the panel device
> > + * @type: the type of the struct which contains struct &drm_panel
> > + * @member: the name of the &drm_panel within @type
> > + * @funcs: callbacks for this panel
> > + * @connector_type: the connector type (DRM_MODE_CONNECTOR_*)
> corresponding to
> > + * the panel interface
> > + * Returns:
> > + * Pointer to container structure embedding the panel, ERR_PTR on
> failure.
> > + * The reference count is initialised to 1 and is automatically  given
> back
> > + * by devm action.
> > + */
>
> In addition to Maxime's comment: I think it's a common practice to have
> an empty line after the last @argument and also before the "Returns:"
> line, to improve readability
>
> On it!
Thanks,
Anusha

> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250328/3faa9544/attachment-0001.htm>


More information about the dri-devel mailing list