From 3f6d16ab3dc9af1e6e05efcd36f4697be8b5548c Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Tue, 9 Jul 2019 08:36:13 +0800 Subject: [PATCH] drm/rockchip: 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: If09f53fb2a5aa20359efb548b1a8b7da2c79310d Signed-off-by: Algea Cao --- drivers/video/drm/dw_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/drm/dw_hdmi.c b/drivers/video/drm/dw_hdmi.c index 00a0ba4331..6f1b333df3 100644 --- a/drivers/video/drm/dw_hdmi.c +++ b/drivers/video/drm/dw_hdmi.c @@ -1170,7 +1170,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) {