From 9b1fbae3960d62b1dfbb4e31a20bb4775ffcc60c Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Wed, 30 Apr 2025 15:37:20 +0800 Subject: [PATCH] drm/bridge: synopsys: dw-hdmi-qp: Fix hdmi is enabled twice during boot If hdmi uboot logo is disabled and hdmi resolution is HDMI 2.0 resolution(such as 4k60), hdmi->logo_plug_out will be set to true and won't be clear before hdmi is enabled. After hdmi is enabled, hdmi->disabled is set to false, and then mode_changed is set to true. hdmi will be disabled and enabled again. hdmi->logo_plug_out is mainly used to determine whether hdmi has been plugged from the end of uboot to the completion of kernel driver initialization when the uboot logo is enabled. So when setting it to true, it is necessary to determine whether the uboot logo is enabled. Change-Id: I1256f7d5e531dcb3e3ed8209a7839019aadef32e Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index b0e295235ee5..88b11021aede 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -3408,7 +3408,8 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, drm_scdc_readb(hdmi->ddc, SCDC_TMDS_CONFIG, &val); /* if plug out before hdmi bind, reset hdmi */ if (vmode->mtmdsclock >= 340000000 && vmode->mpixelclock <= 600000000 && - !(val & SCDC_TMDS_BIT_CLOCK_RATIO_BY_40) && !hdmi->force_kernel_output) + !(val & SCDC_TMDS_BIT_CLOCK_RATIO_BY_40) && !hdmi->force_kernel_output && + hdmi->initialized) hdmi->logo_plug_out = true; }