From: Luca Ceresoli Date: Tue, 7 Apr 2026 12:24:20 +0000 (+0200) Subject: drm/bridge: dw-hdmi: warn on unsupported attach combination X-Git-Tag: v7.2-rc1~141^2~26^2~92 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=5316b7464c998357c468fcfe3717be6258330708;p=thirdparty%2Flinux.git drm/bridge: dw-hdmi: warn on unsupported attach combination dw-hdmi can operate in two different modes, depending on the platform data as set by the driver: A. hdmi->plat_data->output_port = 0: the HDMI output (port@1) in device tree is not used B. hdmi->plat_data->output_port = 1: the HDMI output (port@1) is parsed to find the next bridge Only case B is supported when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is passed to the attach callback. Emit a warning when this is violated. Also return -EINVAL which would be returned by drm_bridge_attach() right after anyway. Reviewed-by: Liu Ying Tested-by: Martyn Welch Tested-by: Alexander Stein # TQMa8MPxL/MBa8MPxL Tested-by: Damon Ding # rk3399 Link: https://patch.msgid.link/20260407-drm-lcdif-dbanc-v4-6-247a16e61ef9@bootlin.com Signed-off-by: Luca Ceresoli --- diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 0296e110ce65f..ab1a6a8783cd7 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2910,6 +2910,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, { struct dw_hdmi *hdmi = bridge->driver_private; + /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */ + if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port)) + return -EINVAL; + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return drm_bridge_attach(encoder, hdmi->bridge.next_bridge, bridge, flags);