]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/bridge: dw-hdmi: change YUV420 selection logic at clock setup
authorAdrián Larumbe <adrian.larumbe@collabora.com>
Sun, 25 Jun 2023 14:17:15 +0000 (15:17 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 27 Jun 2023 07:51:31 +0000 (09:51 +0200)
Right now clocking value selection code is prioritising RGB, YUV444 modes
over YUV420 for HDMI2 sinks. However, because of the bus format selection
procedure in dw-hdmi, for HDMI2 sinks YUV420 is the format that will always
be picked during the drm bridge chain check stage.

Later on dw_hdmi_setup will configure a colour space based on the bus
format that doesn't match the pixel value we had calculated as described
above.

Fix it by bringing back dw-hdmi bus format check when picking the right
pixel clock.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/6230bfae2cd97cf6527fc62ba5c850464919ccf8.1687702042.git.adrian.larumbe@collabora.com
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
drivers/gpu/drm/meson/meson_dw_hdmi.c
include/drm/bridge/dw_hdmi.h

index 9d6dcaf317a1791c384b68f8ad11d36f9293f417..8e1a9854ebc01f6547cdc8d3da92a9a9fe63719b 100644 (file)
@@ -3346,6 +3346,12 @@ static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi)
        return 0;
 }
 
+bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi)
+{
+       return hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format);
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_bus_fmt_is_420);
+
 struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
                              const struct dw_hdmi_plat_data *plat_data)
 {
index 411219d53b14cdc2972d1fb64b3911fdaabcc4f4..18a0f4f4638cb97ac09c2dea67a56cbf86bd88a2 100644 (file)
@@ -379,8 +379,8 @@ static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
                         mode->clock > 340000 ? 40 : 10);
 
        if (drm_mode_is_420_only(display, mode) ||
-           (!is_hdmi2_sink &&
-            drm_mode_is_420_also(display, mode)))
+           (!is_hdmi2_sink && drm_mode_is_420_also(display, mode)) ||
+           dw_hdmi_bus_fmt_is_420(hdmi))
                mode_is_420 = true;
 
        /* Enable clocks */
index f668e75fbabe6191e7fb33dd032df6321b5b8679..6a46baa0737cd082927bb85afe9cf3434969a24b 100644 (file)
@@ -206,4 +206,6 @@ void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data,
                            bool force, bool disabled, bool rxsense);
 void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
 
+bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi);
+
 #endif /* __IMX_HDMI_H__ */