lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 25/36] drm/connector: hdmi: Add Infoframes generation
On Sun, Feb 25, 2024 at 05:02:51PM +0200, Dmitry Baryshkov wrote:
> > @@ -476,6 +478,7 @@ EXPORT_SYMBOL(drmm_connector_init);
> > */
> > int drmm_connector_hdmi_init(struct drm_device *dev,
> > struct drm_connector *connector,
> > + const char *vendor, const char *product,
> > const struct drm_connector_funcs *funcs,
> > const struct drm_connector_hdmi_funcs *hdmi_funcs,
> > int connector_type,
> > @@ -485,6 +488,13 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
> > {
> > int ret;
> >
> > + if (!vendor || !product)
> > + return -EINVAL;
> > +
> > + if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) ||
> > + (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN))
> > + return -EINVAL;
> > +
> > if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> > connector_type == DRM_MODE_CONNECTOR_HDMIB))
> > return -EINVAL;
> > @@ -500,6 +510,12 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
> > return ret;
> >
> > connector->hdmi.supported_formats = supported_formats;
> > + strtomem_pad(connector->hdmi.vendor, vendor, 0);
> > + strtomem_pad(connector->hdmi.product, product, 0);
> > +
> > + ret = drmm_mutex_init(dev, &connector->hdmi.infoframes.lock);
>
> I'd suggest moving this call to the generic __drm_connector_init().
> This way no matter how the rest of the drm code (mis)uses the
> connector, the lock is always present and valid.

Yeah, that makes sense, I'll change it.

Thanks!
Maxime
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2024-05-27 15:24    [W:1.208 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site