drm/rockchip: dw_hdmi: Update RK3588 color selection policy

1.If mode can't support yuv420, change color to rgb.
2.If mode is 10 bit color deep mode, tmds clk is greater than
tv's max tmds clk and mode can't support yuv420, change color
deep to 8bit.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I947f68b75c5dedaf9e8b4db2c87bb2381186a63a
This commit is contained in:
Algea Cao
2022-05-31 17:11:32 +08:00
parent e1cf1f3db7
commit 50f3fd6b3d

View File

@@ -1817,8 +1817,18 @@ dw_hdmi_rockchip_select_output(struct drm_connector_state *conn_state,
}
}
if (mode.clock >= 340000 && hdmi->is_hdmi_qp)
*color_format = RK_IF_FORMAT_YCBCR420;
if (hdmi->is_hdmi_qp) {
if (mode.clock >= 340000) {
if (drm_mode_is_420(info, &mode))
*color_format = RK_IF_FORMAT_YCBCR420;
else
*color_format = RK_IF_FORMAT_RGB;
} else if (tmdsclock > max_tmds_clock) {
color_depth = 8;
if (drm_mode_is_420(info, &mode))
*color_format = RK_IF_FORMAT_YCBCR420;
}
}
if (*color_format == RK_IF_FORMAT_YCBCR420) {
*output_mode = ROCKCHIP_OUT_MODE_YUV420;