From 4e961b2be66ff9bd6ef2d9d44937d905a2017e1b Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Tue, 26 Dec 2017 18:14:19 +0800 Subject: [PATCH] drm/rockchip: dw-hdmi: fix 3328/3228 phy bus width If HDMI output corlor mode is YCbCr422, the tmds clock is same to YCbCr444 8bit, phy bus width should be set to 8. Change-Id: I6e844e676a6315ae0cb88b0bd8456f0e27fa5e0c Signed-off-by: Zheng Yang --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 09a99046fddb..a1768ddeaecc 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -591,7 +591,7 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder, { struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state); struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder); - unsigned int colordepth, colorformat; + unsigned int colordepth, colorformat, bus_width; dw_hdmi_rockchip_select_output(conn_state, crtc_state, hdmi, &colorformat, &colordepth); @@ -602,8 +602,7 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder, s->bus_format = MEDIA_BUS_FMT_UYYVYY10_0_5X30; else s->bus_format = MEDIA_BUS_FMT_UYYVYY8_0_5X24; - if (hdmi->phy) - phy_set_bus_width(hdmi->phy, colordepth / 2); + bus_width = colordepth / 2; } else { s->output_mode = ROCKCHIP_OUT_MODE_AAAA; if (colordepth > 8) { @@ -619,9 +618,15 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder, else s->bus_format = MEDIA_BUS_FMT_RGB888_1X24; } - if (hdmi->phy) - phy_set_bus_width(hdmi->phy, colordepth); + if (colorformat == DRM_HDMI_OUTPUT_YCBCR422) + bus_width = 8; + else + bus_width = colordepth; } + + if (hdmi->phy) + phy_set_bus_width(hdmi->phy, bus_width); + s->output_type = DRM_MODE_CONNECTOR_HDMIA; s->output_if = VOP_OUTPUT_IF_HDMI0;