drm/bridge: dw-hdmi-qp: Handle platform supported formats and color depth
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tue, 21 Oct 2025 10:19:15 +0000 (13:19 +0300)
committerHeiko Stuebner <heiko@sntech.de>
Fri, 14 Nov 2025 22:10:34 +0000 (23:10 +0100)
Extend struct dw_hdmi_qp_plat_data to include the supported display
output formats and maximum bits per color channel.  When provided by the
platform driver, use them to setup the HDMI bridge accordingly.

Additionally, improve debug logging in dw_hdmi_qp_bridge_atomic_enable()
to also show the current HDMI output format and bpc.

Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20251021-rk3588-10bpc-v3-2-3d3eed00a6db@collabora.com
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
include/drm/bridge/dw_hdmi_qp.h

index 4ba7b33..fe4c026 100644 (file)
@@ -868,8 +868,9 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge,
                return;
 
        if (connector->display_info.is_hdmi) {
-               dev_dbg(hdmi->dev, "%s mode=HDMI rate=%llu\n",
-                       __func__, conn_state->hdmi.tmds_char_rate);
+               dev_dbg(hdmi->dev, "%s mode=HDMI %s rate=%llu bpc=%u\n", __func__,
+                       drm_hdmi_connector_get_output_format_name(conn_state->hdmi.output_format),
+                       conn_state->hdmi.tmds_char_rate, conn_state->hdmi.output_bpc);
                op_mode = 0;
                hdmi->tmds_char_rate = conn_state->hdmi.tmds_char_rate;
        } else {
@@ -1287,6 +1288,12 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
        hdmi->bridge.vendor = "Synopsys";
        hdmi->bridge.product = "DW HDMI QP TX";
 
+       if (plat_data->supported_formats)
+               hdmi->bridge.supported_formats = plat_data->supported_formats;
+
+       if (plat_data->max_bpc)
+               hdmi->bridge.max_bpc = plat_data->max_bpc;
+
        hdmi->bridge.ddc = dw_hdmi_qp_i2c_adapter(hdmi);
        if (IS_ERR(hdmi->bridge.ddc))
                return ERR_CAST(hdmi->bridge.ddc);
index 76ecf31..3f461f6 100644 (file)
@@ -25,6 +25,10 @@ struct dw_hdmi_qp_plat_data {
        int main_irq;
        int cec_irq;
        unsigned long ref_clk_rate;
+       /* Supported output formats: bitmask of @hdmi_colorspace */
+       unsigned int supported_formats;
+       /* Maximum bits per color channel: 8, 10 or 12 */
+       unsigned int max_bpc;
 };
 
 struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,