Re: [PATCH v6 5/8] drm: bridge: Cadence: Add MHDP8501 HDMI driver

From: Alexander Stein
Date: Fri Jun 16 2023 - 05:30:37 EST


Hi Sandor,

thanks for sending a new version.

Am Donnerstag, 15. Juni 2023, 03:38:15 CEST schrieb Sandor Yu:
> Add a new DRM HDMI bridge driver for Cadence MHDP8501
> that used in Freescale i.MX8MQ SoC.
> MHDP8501 could support HDMI or DisplayPort standards according
> embedded Firmware running in the uCPU.
>
> For iMX8MQ SoC, the HDMI FW was loaded and activated by SOC ROM code.
> Bootload binary included HDMI FW was required for the driver.
>
> Signed-off-by: Sandor Yu <Sandor.yu@xxxxxxx>
> ---
> drivers/gpu/drm/bridge/cadence/Kconfig | 12 +
> drivers/gpu/drm/bridge/cadence/Makefile | 1 +
> .../drm/bridge/cadence/cdns-mhdp8501-hdmi.c | 1024 +++++++++++++++++
> 3 files changed, 1037 insertions(+)
> create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c
>
> diff --git a/drivers/gpu/drm/bridge/cadence/Kconfig
> b/drivers/gpu/drm/bridge/cadence/Kconfig index 5b7ec4e49aa1..bee05e834055
> 100644
> --- a/drivers/gpu/drm/bridge/cadence/Kconfig
> +++ b/drivers/gpu/drm/bridge/cadence/Kconfig
> @@ -59,3 +59,15 @@ config DRM_CDNS_MHDP8501_DP
> Support Cadence MHDP8501 DisplayPort driver.
> Cadence MHDP8501 Controller support one or more protocols,
> DisplayPort firmware is required for this driver.
> +
> +config DRM_CDNS_MHDP8501_HDMI
> + tristate "Cadence MHDP8501 HDMI DRM driver"
> + select DRM_KMS_HELPER
> + select DRM_PANEL_BRIDGE
> + select DRM_DISPLAY_HELPER
> + select DRM_CDNS_AUDIO
> + depends on OF
> + help
> + Support Cadence MHDP8501 HDMI driver.
> + Cadence MHDP8501 Controller support one or more protocols,
> + HDMI firmware is required for this driver.
> diff --git a/drivers/gpu/drm/bridge/cadence/Makefile
> b/drivers/gpu/drm/bridge/cadence/Makefile index 5842e4540c62..8a129c14ac14
> 100644
> --- a/drivers/gpu/drm/bridge/cadence/Makefile
> +++ b/drivers/gpu/drm/bridge/cadence/Makefile
> @@ -7,3 +7,4 @@ cdns-mhdp8546-y := cdns-mhdp8546-core.o cdns-mhdp8546-hdcp.o
> cdns-mhdp8546-$(CONFIG_DRM_CDNS_MHDP8546_J721E) += cdns-mhdp8546-j721e.o
>
> obj-$(CONFIG_DRM_CDNS_MHDP8501_DP) += cdns-mhdp8501-dp.o
> +obj-$(CONFIG_DRM_CDNS_MHDP8501_HDMI) += cdns-mhdp8501-hdmi.o
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c
> b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c new file mode 100644
> index 000000000000..43673f1b50f6
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c
[...]
> +static int cdns_hdmi_bridge_attach(struct drm_bridge *bridge,
> + enum drm_bridge_attach_flags flags)
> +{
> + struct cdns_mhdp_device *mhdp = bridge->driver_private;
> + struct drm_mode_config *config = &bridge->dev->mode_config;
> + struct drm_encoder *encoder = bridge->encoder;
> + struct drm_connector *connector = &mhdp->connector;
> +
> + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
> + connector->interlace_allowed = 0;
> + connector->polled = DRM_CONNECTOR_POLL_HPD;
> +
> + drm_connector_helper_add(connector,
&cdns_hdmi_connector_helper_funcs);
> +
> + drm_connector_init(bridge->dev, connector,
&cdns_hdmi_connector_funcs,
> + DRM_MODE_CONNECTOR_HDMIA);
> +
> + drm_object_attach_property(&connector->base,
> + config-
>hdr_output_metadata_property, 0);
> +
> + if (!drm_mode_create_hdmi_colorspace_property(connector))

This is missing a 2nd parameter.

> + drm_object_attach_property(&connector->base,
> + connector-
>colorspace_property, 0);
> +
> + drm_connector_attach_encoder(connector, encoder);
> + }
> +
> + return 0;
> +}
[...]

Best regards,
Alexander
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/