Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.75.117 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796007328; b=GzlwA1VcEie+b2dyTlpa6PmtL5Pes4FswQkJnvp0mhodxqAS5azullzJnR6T7VjQDcyH AN5uA1kDs68p4uK6Yi8b5DZlMnRXclyEL7TEKOjBzq/qir7OwBnyE3A5y85W0tfJ8osZM uPcj6ketiSs1qcKxV7/YuOZVIB8T857KGliDOz757PllYCTfL6kzgnVXknpYfdc4Oibr0 Cs5Ka2YsA7+9bQ01FYNXNlJOLBqemcQAONf9AyTmDTjqWxbEGpE+TNzsJHtRHmGTxNS4k zRcTN099iqPe0k/6EjjMEXrWHUO4agp3KRjk8tjxtZ++i1mC3fI7P8TdMo5uX3PCUzQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796007328; h=DMARC-Filter:Received:Received:X-MS-Exchange-Authentication-Results: Received-SPF:Received:Received:From:To:Cc:Subject:Date:Message-Id: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic:Content-Type: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=wmB7VoFdAl0QjR4868ns1GKBruL0mUuepa80Oc+DGn4=; b=NnYO9M3uJf3TTaF1s4lXDSvP2NzMDuUU6d8y8uk1QhzApct2f1u0AB4pdbWZom41M94r S3/ROrgblu8UCjMq0LNP9MjXbgHZ7Mnalv8473gtvrfhc/XCLojnqtMBzhDxo27e6+Q99 8dgVf/aE0DNPLcFJnmGOhfIEVOR58sv8TiAHeFz9C1o6M7fvxzFGsg96Wf/K/H8Y0mqw6 Rm1MWG1qg+Cctucj9IT7MqxjgCxWMyEwmmP5ZIAfbTAf7+SMhDYE+O/JYC3Qjt+Cs1k+W yGBruVSu7Ma9FA3U8VDBvV2bNLH+lTjh1Fll+A4HDOiULOPDiZXosRV5q+Qb1OyaqWw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=cixtech.com; spf=pass smtp.mailfrom=cixtech.com; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.75.117 Received: from OS8PR02CU002.outbound.protection.outlook.com (mail-japanwestazon11022117.outbound.protection.outlook.com [40.107.75.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFB44606A681 for ; Mon, 30 Nov 2026 02:55:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DFB44606A681 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cixtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cixtech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kxqYowuJviAB15xTnEvitxL/ClKRDvI7F/KJzZCXQ8PWtheddfDKeUM/+bs3qKgG8ZY0vyTEHuECfsxu0AKx4Ghx+SWtmamVjeavQ5L1/do4TH3vp5hGpxJxlW2xTDL9QPjikb2TgSb/r5bW9gnPk/j3fSXYl2mTb+/B47qFTZpCBwVfw+joiusl1xaLE+m1yAzpr/OjHmDTgJM9M/v4YAaxyeMWsLBKYXz2e0DrU5sN1tie288JZ6B2Eo64BbX+B+GaGvxc1LTd/G55mToVhgQriWpVGcKZW2MOuxdZhbhXYbz5bHp2S97BpCcBUs0tgLle8MVHHLRudVaPc74f5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wmB7VoFdAl0QjR4868ns1GKBruL0mUuepa80Oc+DGn4=; b=PS4Oez03LY415piSlPTHv318KyPfznQN/0cJOHgAY6AKtzJ7IIcx1S+10ainOqu+fRLldu5v+/V1zJCwCzYBt1QfH9SaPF2b5nqQXdAc8EpE+A59pG10XTQ+MuqWpv5uzmSNUtNxdSrVXISXhRpl8NDiiKRCoAH35dJHre/5w+pnACpYg9HJ80HeaXz5yPdghsnEt/DHRC+Ag2crWxE+R/ihmJfiHZdbySx8eBc2YmK8BabDbRJrvKXzyJTjJeOTksNQz9hbFnlfZn94vccFvC4uA4n0O6eqYNovlAdqIGK5Vcf/ztNZeFQn2camqNTMuGfkr8nyZgI46eLPKpu8Sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 222.71.101.198) smtp.rcpttodomain=arm.com smtp.mailfrom=cixtech.com; dmarc=bestguesspass action=none header.from=cixtech.com; dkim=none (message not signed); arc=none (0) Received: from SI1PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:1f4::15) by TY0PR06MB5804.apcprd06.prod.outlook.com (2603:1096:400:265::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.8; Mon, 30 Nov 2026 02:55:22 +0000 Received: from SG2PEPF000B66C9.apcprd03.prod.outlook.com (2603:1096:4:1f4:cafe::8b) by SI1PR02CA0019.outlook.office365.com (2603:1096:4:1f4::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Mon, 30 Nov 2026 02:55:22 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 222.71.101.198) smtp.mailfrom=cixtech.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=cixtech.com; Received-SPF: Pass (protection.outlook.com: domain of cixtech.com designates 222.71.101.198 as permitted sender) receiver=protection.outlook.com; client-ip=222.71.101.198; helo=smtprelay.cixcomputing.com; pr=C Received: from smtprelay.cixcomputing.com (222.71.101.198) by SG2PEPF000B66C9.mail.protection.outlook.com (10.167.240.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 02:55:21 +0000 Received: from localhost.localdomain (unknown [172.16.66.33]) by smtprelay.cixcomputing.com (Postfix) with ESMTPSA id D27C440920E7; Mon, 30 Nov 2026 10:55:20 +0800 (CST) From: Luo Liu To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Russell King , dri-devel@lists.freedesktop.org Cc: Ayan Halder , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Kory Maincent , Luca Ceresoli , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, cix-kernel-upstream@cixtech.com, Wuyi.Shen@cixtech.com Subject: [PATCH v4 4/4] drm/bridge: tda998x: fix DRM_BRIDGE_ATTACH_NO_CONNECTOR support Date: Mon, 30 Nov 2026 10:55:20 +0800 Message-Id: <20261130025520.766762-4-Luo.Liu@cixtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20261130025520.766762-1-Luo.Liu@cixtech.com> References: <20261130025520.766762-1-Luo.Liu@cixtech.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PEPF000B66C9:EE_|TY0PR06MB5804:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3b01b32d-fa56-46ad-3a89-08df4e8d6039 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|42112799006|376014|7416014|36860700016|23010399003|1800799024|6133799003|22082099003|18002099003|10067099003|56012099006|261026121527099003|261026135527099003|261026140227099003|261026130827099003|261028144727099003|261021123027099003|261021121427099003|261022075727099003|261021133027099003|261021135927099003|261021130227099003|261009223027099003|261022105027099003|261022115727099003|261022113327099003|261102123227099003; X-Microsoft-Antispam-Message-Info: yvmlbQoZiLOKF0lonJeaEgqa93B13u6jqti/nuq2fugcPM86MXCE40texv3AGplda42spkYHngu9oZt0JMeoM/LYbLI1P+s96twsi95NjMy+nfowuOWRlRdirkWyHh+uJNHyLUJZ2hhl8spYjpO1gYYbNDi4oRLG7ZNlRR9q+i3A/8gCr4wop5R5v3VlvWS2daeBzKl5iedSSfSXaia0/tjKmaZ9tDV3Ao632IrmqFkwGlq+efmvfIazGqgePPD2+PxCuuoHN85BwDwClY3EPAh+NkPY+ptEeaoY9CE1ohSW7M2hWmyBRhM8UnvDAVBp7Qojb7XSY0jbd2wINw3DHo1nzTdj9LnCduiJJjgEXzp9htxjFOqnT9/EY4RRHUrtDMNcuuVhR24LjbKMpq+KAVn1d9EG9sKLCU0pzaHim6uB6jVlp/nHdN2SkJWSBRdyW9n+1CZQfibeX44LUiimjIVxa9KJTpPKCp0k2OAnNyAonwXR3TyOl9SpVQgyqNhBPzlomBkBbd/vIpp3GsB+MPU5q8ciF8n7jZLMVUcNcTp8g7DZ5CfHJvT+COrzGW2dEZCJf/f8OWmTI3sTY5DlhRH6eZsgyhGfe34tkN9hwRyie3sPhCIgbdNQBgkAsfbbx4f36zC7gtnIaKMbstdBCC7P50QNrZdDigAPQTAhqBnPW4/uyv90u+CpDYCn1N6lJAHAYq7WZ+kz6ec3cNUPsw== X-Forefront-Antispam-Report: CIP:222.71.101.198;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:smtprelay.cixcomputing.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(42112799006)(376014)(7416014)(36860700016)(23010399003)(1800799024)(6133799003)(22082099003)(18002099003)(10067099003)(56012099006)(261026121527099003)(261026135527099003)(261026140227099003)(261026130827099003)(261028144727099003)(261021123027099003)(261021121427099003)(261022075727099003)(261021133027099003)(261021135927099003)(261021130227099003)(261009223027099003)(261022105027099003)(261022115727099003)(261022113327099003)(261102123227099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8HP+OYqMb8fYd/S+xsqoiX4JhG6dh8urzzExQk2Kdn7ng5bRxbVElAK5T1dAnWESRYJYPnwEsVRv0CvwbpWE+XpMPdMhU9MFwWbyQee9rqrIq2fd51PTYvS4DcAgeNvPDn1G6KZLzSYCAF0Iugbx1kT0IP/AVN2bwcamokY0IRfSUZOQez3FT7IotLTsuKk4JHWNyKOj15DCbuDpnHQwbDsUhimlUgKblSMJYbT82sFzEaWh0Dr+1xXfoywDFKCbxeL/WekSGnrOG7dXfCzRBYGcSimGqeL/26kcwtvopBkTBtq2MTWyrAjeKxj81U5hiLEIbTXnBmKYtj19N8FsjtWAL+QY+HXqYCi310sBKQxPM/7l8cP9uWuIQ4cj7+wk075229BuwAhJFplMpM8CgxuW++GNi5UQ7kKWhGNckFUIomy30YVzxXnB70mngJFf X-OriginatorOrg: cixtech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 02:55:21.9785 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b01b32d-fa56-46ad-3a89-08df4e8d6039 X-MS-Exchange-CrossTenant-Id: 0409f77a-e53d-4d23-943e-ccade7cb4811 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0409f77a-e53d-4d23-943e-ccade7cb4811;Ip=[222.71.101.198];Helo=[smtprelay.cixcomputing.com] X-MS-Exchange-CrossTenant-AuthSource: SG2PEPF000B66C9.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5804 When attached with DRM_BRIDGE_ATTACH_NO_CONNECTOR, the connector is created by drm_bridge_connector_init() and the driver's own connector stays uninitialised. The mode set then reads an empty display_info and always runs in DVI mode, get_eld returns an empty ELD and hotplug events are never sent. The connector passed to the detect and EDID read operations cannot be cached: the bridge API forbids storing it, it is released with the DRM device, and those operations are not always called. Take the display information and ELD from the connector state in the bridge atomic check, resolve the connector and adjusted mode from the atomic state when enabling the bridge, which is where the infoframe and audio setup now runs, report hotplug through drm_bridge_hpd_notify() for a connector created outside the driver, and advertise interlaced mode support through the bridge. Since hotplug is now reported through the bridge, unregister the bridge after the interrupt and the detect work have been stopped, so a pending notification cannot take the HPD lock once drm_bridge_remove() has destroyed it. Fixes: c76a8be4feec ("drm/bridge: tda998x: Add support for DRM_BRIDGE_ATTACH_NO_CONNECTOR") Signed-off-by: Luo Liu --- drivers/gpu/drm/bridge/tda998x_drv.c | 146 ++++++++++++++++++--------- 1 file changed, 97 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/bridge/tda998x_drv.c b/drivers/gpu/drm/bridge/tda998x_drv.c index 0b966c9844e7..5a59302e09ec 100644 --- a/drivers/gpu/drm/bridge/tda998x_drv.c +++ b/drivers/gpu/drm/bridge/tda998x_drv.c @@ -57,9 +57,11 @@ struct tda998x_priv { u8 cec_addr; u8 current_page; bool is_on; + bool rgb_quant_range_selectable; bool supports_infoframes; bool sink_has_audio; enum hdmi_quantization_range rgb_quant_range; + u8 eld[MAX_ELD_BYTES]; u8 vip_cntrl_0; u8 vip_cntrl_1; u8 vip_cntrl_2; @@ -769,6 +771,14 @@ static int tda998x_edid_delay_wait(struct tda998x_priv *priv) return wait_event_killable(priv->edid_delay_waitq, !priv->edid_delay_active); } +static enum drm_connector_status tda998x_conn_detect(struct tda998x_priv *priv) +{ + u8 val = cec_read(priv, REG_CEC_RXSHPDLEV); + + return (val & CEC_RXSHPDLEV_HPD) ? connector_status_connected : + connector_status_disconnected; +} + /* * We need to run the KMS hotplug event helper outside of our threaded * interrupt routine as this can call back into our get_modes method, @@ -778,10 +788,11 @@ static void tda998x_detect_work(struct work_struct *work) { struct tda998x_priv *priv = container_of(work, struct tda998x_priv, detect_work); - struct drm_device *dev = priv->connector.dev; - if (dev) - drm_kms_helper_hotplug_event(dev); + if (priv->connector.dev) + drm_kms_helper_hotplug_event(priv->connector.dev); + else + drm_bridge_hpd_notify(&priv->bridge, tda998x_conn_detect(priv)); } /* @@ -857,26 +868,27 @@ static void tda998x_write_aif(struct tda998x_priv *priv, } static void -tda998x_write_avi(struct tda998x_priv *priv, const struct drm_display_mode *mode) +tda998x_write_avi(struct tda998x_priv *priv, struct drm_connector *connector, + const struct drm_display_mode *mode) { union hdmi_infoframe frame; - drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, - &priv->connector, mode); + drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, connector, mode); frame.avi.quantization_range = HDMI_QUANTIZATION_RANGE_FULL; - drm_hdmi_avi_infoframe_quant_range(&frame.avi, &priv->connector, mode, + drm_hdmi_avi_infoframe_quant_range(&frame.avi, connector, mode, priv->rgb_quant_range); tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, &frame); } static void tda998x_write_vsi(struct tda998x_priv *priv, + struct drm_connector *connector, const struct drm_display_mode *mode) { union hdmi_infoframe frame; if (drm_hdmi_vendor_infoframe_from_display_mode(&frame.vendor.hdmi, - &priv->connector, + connector, mode)) reg_clear(priv, REG_DIP_IF_FLAGS, DIP_IF_FLAGS_IF1); else @@ -1154,8 +1166,7 @@ static int tda998x_audio_get_eld(struct device *dev, void *data, struct tda998x_priv *priv = dev_get_drvdata(dev); mutex_lock(&priv->audio_mutex); - memcpy(buf, priv->connector.eld, - min(sizeof(priv->connector.eld), len)); + memcpy(buf, priv->eld, min(sizeof(priv->eld), len)); mutex_unlock(&priv->audio_mutex); return 0; @@ -1193,14 +1204,6 @@ static int tda998x_audio_codec_init(struct tda998x_priv *priv, /* DRM connector functions */ -static enum drm_connector_status tda998x_conn_detect(struct tda998x_priv *priv) -{ - u8 val = cec_read(priv, REG_CEC_RXSHPDLEV); - - return (val & CEC_RXSHPDLEV_HPD) ? connector_status_connected : - connector_status_disconnected; -} - static enum drm_connector_status tda998x_connector_detect(struct drm_connector *connector, bool force) { @@ -1394,6 +1397,26 @@ static void tda998x_bridge_detach(struct drm_bridge *bridge) drm_connector_cleanup(&priv->connector); } +static int tda998x_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct tda998x_priv *priv = bridge_to_tda998x_priv(bridge); + struct drm_connector *connector = conn_state->connector; + + priv->rgb_quant_range_selectable = + connector->display_info.rgb_quant_range_selectable; + + mutex_lock(&connector->eld_mutex); + mutex_lock(&priv->audio_mutex); + memcpy(priv->eld, connector->eld, sizeof(priv->eld)); + mutex_unlock(&priv->audio_mutex); + mutex_unlock(&connector->eld_mutex); + + return 0; +} + static enum drm_mode_status tda998x_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_info *info, const struct drm_display_mode *mode) @@ -1411,9 +1434,59 @@ static enum drm_mode_status tda998x_bridge_mode_valid(struct drm_bridge *bridge, } static void tda998x_bridge_enable(struct drm_bridge *bridge, - struct drm_atomic_commit *commit) + struct drm_atomic_commit *state) { struct tda998x_priv *priv = bridge_to_tda998x_priv(bridge); + struct drm_connector *connector; + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + const struct drm_display_mode *adjusted_mode; + u8 reg; + + connector = drm_atomic_get_new_connector_for_encoder(state, + bridge->encoder); + conn_state = drm_atomic_get_new_connector_state(state, connector); + + mutex_lock(&priv->audio_mutex); + + if (conn_state && conn_state->crtc) { + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + adjusted_mode = &crtc_state->adjusted_mode; + + /* + * CEA-861B section 6 says that: + * CEA version 1 (CEA-861) has no support for infoframes. + * CEA version 2 (CEA-861A) supports version 1 AVI infoframes, + * and optional basic audio. + * CEA version 3 (CEA-861B) supports version 1 and 2 AVI infoframes, + * and optional digital audio, with audio infoframes. + * + * Since we only support generation of version 2 AVI infoframes, + * ignore CEA version 2 and below (iow, behave as if we're a + * CEA-861 source.) + */ + priv->supports_infoframes = connector->display_info.cea_rev >= 3; + + if (priv->supports_infoframes) { + /* We need to turn HDMI HDCP stuff on to get audio through */ + reg = TBG_CNTRL_1_TGL_EN; + if (crtc_state->mode.flags & DRM_MODE_FLAG_NHSYNC) + reg |= TBG_CNTRL_1_H_TGL; + if (crtc_state->mode.flags & DRM_MODE_FLAG_NVSYNC) + reg |= TBG_CNTRL_1_V_TGL; + reg_write(priv, REG_TBG_CNTRL_1, reg); + reg_write(priv, REG_ENC_CNTRL, ENC_CNTRL_CTL_CODE(1)); + reg_set(priv, REG_TX33, TX33_HDMI); + + tda998x_write_avi(priv, connector, adjusted_mode); + tda998x_write_vsi(priv, connector, adjusted_mode); + + if (priv->sink_has_audio) + tda998x_configure_audio(priv); + } + } + + mutex_unlock(&priv->audio_mutex); if (!priv->is_on) { /* enable video ports, audio will be enabled later */ @@ -1465,7 +1538,7 @@ static void tda998x_bridge_mode_set(struct drm_bridge *bridge, * it, otherwise reduce to limited-range. */ priv->rgb_quant_range = - priv->connector.display_info.rgb_quant_range_selectable ? + priv->rgb_quant_range_selectable ? HDMI_QUANTIZATION_RANGE_FULL : drm_default_rgb_quant_range(adjusted_mode); @@ -1663,33 +1736,6 @@ static void tda998x_bridge_mode_set(struct drm_bridge *bridge, /* must be last register set: */ reg_write(priv, REG_TBG_CNTRL_0, 0); - /* CEA-861B section 6 says that: - * CEA version 1 (CEA-861) has no support for infoframes. - * CEA version 2 (CEA-861A) supports version 1 AVI infoframes, - * and optional basic audio. - * CEA version 3 (CEA-861B) supports version 1 and 2 AVI infoframes, - * and optional digital audio, with audio infoframes. - * - * Since we only support generation of version 2 AVI infoframes, - * ignore CEA version 2 and below (iow, behave as if we're a - * CEA-861 source.) - */ - priv->supports_infoframes = priv->connector.display_info.cea_rev >= 3; - - if (priv->supports_infoframes) { - /* We need to turn HDMI HDCP stuff on to get audio through */ - reg &= ~TBG_CNTRL_1_DWIN_DIS; - reg_write(priv, REG_TBG_CNTRL_1, reg); - reg_write(priv, REG_ENC_CNTRL, ENC_CNTRL_CTL_CODE(1)); - reg_set(priv, REG_TX33, TX33_HDMI); - - tda998x_write_avi(priv, adjusted_mode); - tda998x_write_vsi(priv, adjusted_mode); - - if (priv->sink_has_audio) - tda998x_configure_audio(priv); - } - mutex_unlock(&priv->audio_mutex); } @@ -1747,6 +1793,7 @@ static void tda998x_bridge_hpd_disable(struct drm_bridge *bridge) } static const struct drm_bridge_funcs tda998x_bridge_funcs = { + .atomic_check = tda998x_bridge_atomic_check, .atomic_create_state = drm_atomic_helper_bridge_create_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, @@ -2011,6 +2058,7 @@ tda998x_probe(struct i2c_client *client) priv->bridge.ops |= DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT; priv->bridge.type = DRM_MODE_CONNECTOR_HDMIA; + priv->bridge.interlace_allowed = true; drm_bridge_add(&priv->bridge); return 0; @@ -2035,8 +2083,6 @@ static void tda998x_remove(struct i2c_client *client) { struct tda998x_priv *priv = dev_get_drvdata(&client->dev); - drm_bridge_remove(&priv->bridge); - if (priv->audio_pdev) platform_device_unregister(priv->audio_pdev); @@ -2053,6 +2099,8 @@ static void tda998x_remove(struct i2c_client *client) timer_delete_sync(&priv->edid_delay_timer); cancel_work_sync(&priv->detect_work); + + drm_bridge_remove(&priv->bridge); } #ifdef CONFIG_OF -- 2.25.1