From 1992cb696610b0499275aba3287a8ec28c92e274 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Tue, 9 Jul 2019 09:10:04 +0800 Subject: [PATCH] drm/bridge: synopsys: dw-hdmi: Fix yuv422 display err When switching from another color to yuv422, neither encoder input color nor encoder output color is rgb. CSC coeff will be incorrectly selected as csc_coeff_full_to_limited, which causes the display turn to green. To solve this problem, choose csc_coeff_full_to_limited only if the input and output colors are both RGB. Change-Id: I080e18eb8fcca975cd0e6c46d2ed9e7513a26609 Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 8fbc50cb3887..5195807f1f3d 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1088,7 +1088,7 @@ static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) enc_in_rgb = hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_in_bus_format); if (is_color_space_conversion(hdmi)) { - if (enc_out_rgb == enc_in_rgb) { + if (enc_out_rgb && enc_in_rgb) { csc_coeff = &csc_coeff_full_to_limited; csc_scale = 0; } else if (enc_out_rgb) {