From 5e54a1092febc71beb4787d6ec901c66b3eac626 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Mon, 24 Apr 2023 15:08:53 +0800 Subject: [PATCH] drm/rockchip: dw_hdmi: Fix hdmi2.0 mode no signal when plug out before hdmi bind When the hdmi is plugged in and out after uboot but before kernel initialization, the TV will enter hdmi 1.4 mode, hdmi 2.0 resolution can't be display. In this case, we need to disable/enable hdmi again to make TV into hdmi 2.0 mode again. Signed-off-by: Algea Cao Change-Id: I39fbe519d54329ae7db57904013bfdef6f5a068e --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 72d94cb3eeda..e3cce739bb65 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3263,6 +3263,8 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, * drm_display_mode and set phy status to enabled. */ if (!vmode->mpixelclock) { + u8 val; + hdmi->curr_conn = connector; if (hdmi->plat_data->get_enc_in_encoding) @@ -3288,6 +3290,11 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, vmode->mtmdsclock /= 2; dw_hdmi_force_output_pattern(hdmi, mode); + drm_scdc_readb(hdmi->ddc, SCDC_TMDS_CONFIG, &val); + + /* if plug out before hdmi bind, reset hdmi */ + if (vmode->mtmdsclock >= 340000000 && !(val & SCDC_TMDS_BIT_CLOCK_RATIO_BY_40)) + hdmi->logo_plug_out = true; } if (check_hdr_color_change(old_state, new_state, hdmi) || hdmi->logo_plug_out ||