[PATCH v9 03/61] drm/connector: Add drmm_connector_hdmi_init() with new signature

Dmitry Baryshkov dmitry.baryshkov at oss.qualcomm.com
Thu Jul 30 07:19:30 PDT 2026


On Thu, Jul 23, 2026 at 04:34:52AM +0300, Cristian Ciocaltea wrote:
> In preparation for providing HDMI 2.x source capabilities, move the
> vendor, product, supported_formats and max_bpc parameters out of the
> init function into struct drm_connector_hdmi_funcs, and add new
> supported_hdmi_ver and supported_tmds_char_rate fields there as well.

I really don't like the idea of putting data into the functions. The
data might be mutable, it might depend on the particular platform, etc.
while funcs are typically static. Even for the drm_bridge case we have
two separate structures: static funcs and changeable drm_bridge
instance.

I'd suggest populating that data in the drm_connector before calling
drmm_connector_hdmi_init(). The only exception would be vendor / product
since they use strtomem_pad() to ensure them being properly initialized.
I'd suggest leaving those two as is.

> Appending more HDMI-specific arguments to that function would not scale
> well, hence introduce drmm_connector_hdmi_init() with the reduced
> signature.
> 
> Additionally, add the max_tmds_char_rate field to struct
> drm_connector_hdmi and use the supported HDMI version to determinate the
> maximum TMDS character rate allowed by the specification.  Some
> controllers, however, may support a lower rate than that version would
> imply.  A non-zero supported_tmds_char_rate lets drivers override this
> default with the actual controller capability.  A value of zero keeps
> the limit inferred from supported_hdmi_ver.
> 
> Callers are converted in the following patches, while the old and now
> renamed *_ini2() helper is removed at the end of the series.
> 
> No functional changes expected for existing callers.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea at collabora.com>
> ---
>  drivers/gpu/drm/drm_connector.c | 134 ++++++++++++++++++++++++++++++++++++++++
>  include/drm/drm_connector.h     |  62 ++++++++++++++++++-
>  2 files changed, 195 insertions(+), 1 deletion(-)
> 

-- 
With best wishes
Dmitry



More information about the Linux-rockchip mailing list