On Fri, May 15, 2026 at 11:02:11AM +0200, Javier Martinez Canillas wrote:
> The driver unconditionally sets the transmission mode to HDMI, which leads
> to display output not working with DVI monitors. Check connector's display
> information sink type to identify the correct mode to configure the bridge.
> 
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
> 
> Changes in v4:
> - Convert the driver to use the HDMI helpers (Maxime Ripard).
> - Move .mode_set logic to .atomic_enable (Maxime Ripard).
> 
> Changes in v3:
> - Move the HDMI/DVI mode set to the .atomic_enable handler (Maxime Ripard).
> 
> Changes in v2:
> - Don't store the sink type in a per-commit bridge state (Maxime Ripard).
> 
>  drivers/gpu/drm/bridge/ite-it66121.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c 
> b/drivers/gpu/drm/bridge/ite-it66121.c
> index c8795247cfa8..95ee98a4a8df 100644
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -184,6 +184,7 @@
>  
>  #define IT66121_HDMI_MODE_REG                        0xC0
>  #define IT66121_HDMI_MODE_HDMI                       BIT(0)
> +#define IT66121_HDMI_MODE_DVI                        0
>  
>  #define IT66121_SYS_STATUS_REG                       0x0E
>  #define IT66121_SYS_STATUS_ACTIVE_IRQ                BIT(7)
> @@ -658,6 +659,7 @@ static void it66121_set_mode(struct it66121_ctx *ctx,
>                            struct drm_atomic_commit *state)
>  {
>       struct drm_connector *connector = ctx->connector;
> +     unsigned int tx_mode = IT66121_HDMI_MODE_HDMI;
>       const struct drm_crtc_state *crtc_state;
>       const struct drm_display_mode *mode;
>       struct drm_crtc *crtc;
> @@ -666,10 +668,13 @@ static void it66121_set_mode(struct it66121_ctx *ctx,
>       crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>       mode = &crtc_state->adjusted_mode;
>  
> +     if (!connector->display_info.is_hdmi)
> +             tx_mode = IT66121_HDMI_MODE_DVI;
> +
>       mutex_lock(&ctx->lock);
>  
> -     /* Set TX mode to HDMI */
> -     if (regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, 
> IT66121_HDMI_MODE_HDMI))
> +     /* Set TX mode to HDMI or DVI */
> +     if (regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, tx_mode))

A ternary operator would probably be better here?

Maxime

Attachment: signature.asc
Description: PGP signature

Reply via email to