<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Mar 26, 2025 at 11:26 AM Maxime Ripard <<a href="mailto:mripard@kernel.org">mripard@kernel.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Mar 26, 2025 at 10:22:59AM +0100, Luca Ceresoli wrote:<br>
> Hello Anusha,<br>
> <br>
> On Tue, 25 Mar 2025 13:24:08 -0400<br>
> Anusha Srivatsa <<a href="mailto:asrivats@redhat.com" target="_blank">asrivats@redhat.com</a>> wrote:<br>
> <br>
> > Introduce reference counted allocations for panels to avoid<br>
> > use-after-free. The patch adds the macro devm_drm_bridge_alloc()<br>
> > to allocate a new refcounted panel. Followed the documentation for<br>
> > drmm_encoder_alloc() and devm_drm_dev_alloc and other similar<br>
> > implementations for this purpose.<br>
> > <br>
> > Signed-off-by: Anusha Srivatsa <<a href="mailto:asrivats@redhat.com" target="_blank">asrivats@redhat.com</a>><br>
> <br>
> [...]<br>
> <br>
> > +void *__devm_drm_panel_alloc(struct device *dev, size_t size, size_t offset,<br>
> > +                        const struct drm_panel_funcs *funcs,<br>
> > +                        int connector_type);<br>
> > +<br>
> > +/**<br>
> > + * devm_drm_panel_alloc - Allocate and initialize an refcounted panel<br>
>                                                      ^^<br>
> "a refcounted panel"<br>
> <br>
> > + * @dev: struct device of the panel device<br>
> > + * @type: the type of the struct which contains struct &drm_panel<br>
> > + * @member: the name of the &drm_panel within @type<br>
> > + * @funcs: callbacks for this panel<br>
> > + * @connector_type: connector type of the driver<br>
> <br>
> I'd say it's the connector type in the hardware, rather than of the<br>
> driver (the driver follows what is in the hardware. Maybe you can just<br>
> copy the description present in the drm_panel_init kdoc:<br>
> <br>
>  * @connector_type: the connector type (DRM_MODE_CONNECTOR_*) corresponding to<br>
>  *      the panel interface (must NOT be DRM_MODE_CONNECTOR_Unknown)<br>
> <br>
> Other than that it looks good!<br>
<br>
Heh, Unknown is fine, but you're right for the rest. I'd use the<br>
drm_panel_init doc for that field actually.<br>
<br></blockquote><div>Will make this change in the next iteration,</div><div>Thanks Luca and Maxime</div><div><br></div><div>Anusha <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Maxime<br>
</blockquote></div></div>