Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: dw-hdmi: change YUV420 selection logic at clock setup

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

authored by

Adrián Larumbe and committed by
Neil Armstrong
7ed40ff1 71a7974a

+10 -2
+6
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 3346 3346 return 0; 3347 3347 } 3348 3348 3349 + bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi) 3350 + { 3351 + return hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format); 3352 + } 3353 + EXPORT_SYMBOL_GPL(dw_hdmi_bus_fmt_is_420); 3354 + 3349 3355 struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, 3350 3356 const struct dw_hdmi_plat_data *plat_data) 3351 3357 {
+2 -2
drivers/gpu/drm/meson/meson_dw_hdmi.c
··· 379 379 mode->clock > 340000 ? 40 : 10); 380 380 381 381 if (drm_mode_is_420_only(display, mode) || 382 - (!is_hdmi2_sink && 383 - drm_mode_is_420_also(display, mode))) 382 + (!is_hdmi2_sink && drm_mode_is_420_also(display, mode)) || 383 + dw_hdmi_bus_fmt_is_420(hdmi)) 384 384 mode_is_420 = true; 385 385 386 386 /* Enable clocks */
+2
include/drm/bridge/dw_hdmi.h
··· 206 206 bool force, bool disabled, bool rxsense); 207 207 void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); 208 208 209 + bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi); 210 + 209 211 #endif /* __IMX_HDMI_H__ */