From nobody Tue Feb 10 00:58:55 2026 Received: from fllvem-ot03.ext.ti.com (fllvem-ot03.ext.ti.com [198.47.19.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAC62304BDD for ; Tue, 14 Oct 2025 09:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760435199; cv=none; b=I9CGFME56MWvCXG9ecKXvuWGZ0QPY9rr4XCgPHzIrQOFj/y5ylmQT6Up8Xn6Bwe1DLVbC/W3NMdQjOIwa7McdsS46u29NLiQb7hORTmGCuxkhN2x9yJiRwdV/wa6O1Hs04vkompbsGCQUZbbj9L481F3AGavsGV5KtSAFl1E01g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760435199; c=relaxed/simple; bh=1+wYFb+rcNkohfJgT8lwydPWZ8DopBA29qXXLGaJZOg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oIcMctxOXSaMIQha9i4E6C3gwvLZivEzgdBKMzdNCiTlNiA8PLfpRVvn15FYjUAduH9YWFQ7QBYbHuYqeJduFj8s8hvDVzfBTvFPabXGZYbD0qSy6lQvvlqE8j1r/crcRiUK6LI482G02KxV8zu5Y4Cp57QcQF6owSQhc1u1ZG8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=IpXeHOp+; arc=none smtp.client-ip=198.47.19.245 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="IpXeHOp+" Received: from fllvem-sh03.itg.ti.com ([10.64.41.86]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTP id 59E9jv9p1039187; Tue, 14 Oct 2025 04:45:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1760435157; bh=l8iHiY7tMJVLwGXGTY5mepOYcBK+Lwuh11eUlqYpYrM=; h=From:To:Subject:Date:In-Reply-To:References; b=IpXeHOp+JxWTO2NpQssQH8WmkMKPaBgWgXvuzI3mjSBy1714Cmb/1yBKeAhxiduKo hcqHnJQOnhF0ocgf5DRQuks7wDpRSvyQSOlX5W1g4tvIZRl7iqztmgHxxBJXGnmPRS uEmB3+NfD23QzPANm2tBifN/4PhAFRwdtw0ck+Io= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 59E9jvD5967965 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Tue, 14 Oct 2025 04:45:57 -0500 Received: from DLEE204.ent.ti.com (157.170.170.84) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Tue, 14 Oct 2025 04:45:56 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE204.ent.ti.com (157.170.170.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 14 Oct 2025 04:45:56 -0500 Received: from hkshenoy.dhcp.ti.com (hkshenoy.dhcp.ti.com [172.24.235.208]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 59E9jSjV3359281; Tue, 14 Oct 2025 04:45:49 -0500 From: Harikrishna Shenoy To: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v8 3/6] drm/bridge: cadence: cdns-mhdp8546-core: Remove legacy support for connector initialisation in bridge Date: Tue, 14 Oct 2025 15:15:24 +0530 Message-ID: <20251014094527.3916421-4-h-shenoy@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251014094527.3916421-1-h-shenoy@ti.com> References: <20251014094527.3916421-1-h-shenoy@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" From: Jayesh Choudhary Now that we have DBANC framework, remove the connector initialisation code as that piece of code is not called if DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is used. Only TI K3 platforms consume this driver and tidss (their display controller) has this flag set. So this legacy support can be dropped. Reviewed-by: Dmitry Baryshkov Signed-off-by: Jayesh Choudhary Signed-off-by: Harikrishna Shenoy --- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 188 +----------------- 1 file changed, 10 insertions(+), 178 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/= gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 7178a01e4d4d..31256ad69602 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -739,12 +739,8 @@ static void cdns_mhdp_fw_cb(const struct firmware *fw,= void *context) spin_lock(&mhdp->start_lock); bridge_attached =3D mhdp->bridge_attached; spin_unlock(&mhdp->start_lock); - if (bridge_attached) { - if (mhdp->connector_ptr && mhdp->connector_ptr->dev) - drm_kms_helper_hotplug_event(mhdp->bridge.dev); - else - drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); - } + if (bridge_attached) + drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); } =20 static int cdns_mhdp_load_firmware(struct cdns_mhdp_device *mhdp) @@ -1444,56 +1440,6 @@ static const struct drm_edid *cdns_mhdp_edid_read(st= ruct cdns_mhdp_device *mhdp, return drm_edid_read_custom(connector, cdns_mhdp_get_edid_block, mhdp); } =20 -static int cdns_mhdp_get_modes(struct drm_connector *connector) -{ - struct cdns_mhdp_device *mhdp =3D connector_to_mhdp(connector); - const struct drm_edid *drm_edid; - int num_modes; - - if (!mhdp->plugged) - return 0; - - drm_edid =3D cdns_mhdp_edid_read(mhdp, connector); - - drm_edid_connector_update(connector, drm_edid); - - if (!drm_edid) { - dev_err(mhdp->dev, "Failed to read EDID\n"); - return 0; - } - - num_modes =3D drm_edid_connector_add_modes(connector); - drm_edid_free(drm_edid); - - /* - * HACK: Warn about unsupported display formats until we deal - * with them correctly. - */ - if (connector->display_info.color_formats && - !(connector->display_info.color_formats & - mhdp->display_fmt.color_format)) - dev_warn(mhdp->dev, - "%s: No supported color_format found (0x%08x)\n", - __func__, connector->display_info.color_formats); - - if (connector->display_info.bpc && - connector->display_info.bpc < mhdp->display_fmt.bpc) - dev_warn(mhdp->dev, "%s: Display bpc only %d < %d\n", - __func__, connector->display_info.bpc, - mhdp->display_fmt.bpc); - - return num_modes; -} - -static int cdns_mhdp_connector_detect(struct drm_connector *conn, - struct drm_modeset_acquire_ctx *ctx, - bool force) -{ - struct cdns_mhdp_device *mhdp =3D connector_to_mhdp(conn); - - return cdns_mhdp_detect(mhdp); -} - static u32 cdns_mhdp_get_bpp(struct cdns_mhdp_display_fmt *fmt) { u32 bpp; @@ -1547,115 +1493,6 @@ bool cdns_mhdp_bandwidth_ok(struct cdns_mhdp_device= *mhdp, return true; } =20 -static -enum drm_mode_status cdns_mhdp_mode_valid(struct drm_connector *conn, - const struct drm_display_mode *mode) -{ - struct cdns_mhdp_device *mhdp =3D connector_to_mhdp(conn); - - mutex_lock(&mhdp->link_mutex); - - if (!cdns_mhdp_bandwidth_ok(mhdp, mode, mhdp->link.num_lanes, - mhdp->link.rate)) { - mutex_unlock(&mhdp->link_mutex); - return MODE_CLOCK_HIGH; - } - - mutex_unlock(&mhdp->link_mutex); - return MODE_OK; -} - -static int cdns_mhdp_connector_atomic_check(struct drm_connector *conn, - struct drm_atomic_state *state) -{ - struct cdns_mhdp_device *mhdp =3D connector_to_mhdp(conn); - struct drm_connector_state *old_state, *new_state; - struct drm_crtc_state *crtc_state; - u64 old_cp, new_cp; - - if (!mhdp->hdcp_supported) - return 0; - - old_state =3D drm_atomic_get_old_connector_state(state, conn); - new_state =3D drm_atomic_get_new_connector_state(state, conn); - old_cp =3D old_state->content_protection; - new_cp =3D new_state->content_protection; - - if (old_state->hdcp_content_type !=3D new_state->hdcp_content_type && - new_cp !=3D DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { - new_state->content_protection =3D DRM_MODE_CONTENT_PROTECTION_DESIRED; - goto mode_changed; - } - - if (!new_state->crtc) { - if (old_cp =3D=3D DRM_MODE_CONTENT_PROTECTION_ENABLED) - new_state->content_protection =3D DRM_MODE_CONTENT_PROTECTION_DESIRED; - return 0; - } - - if (old_cp =3D=3D new_cp || - (old_cp =3D=3D DRM_MODE_CONTENT_PROTECTION_DESIRED && - new_cp =3D=3D DRM_MODE_CONTENT_PROTECTION_ENABLED)) - return 0; - -mode_changed: - crtc_state =3D drm_atomic_get_new_crtc_state(state, new_state->crtc); - crtc_state->mode_changed =3D true; - - return 0; -} - -static const struct drm_connector_helper_funcs cdns_mhdp_conn_helper_funcs= =3D { - .detect_ctx =3D cdns_mhdp_connector_detect, - .get_modes =3D cdns_mhdp_get_modes, - .mode_valid =3D cdns_mhdp_mode_valid, - .atomic_check =3D cdns_mhdp_connector_atomic_check, -}; - -static const struct drm_connector_funcs cdns_mhdp_conn_funcs =3D { - .fill_modes =3D drm_helper_probe_single_connector_modes, - .atomic_duplicate_state =3D drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state =3D drm_atomic_helper_connector_destroy_state, - .reset =3D drm_atomic_helper_connector_reset, - .destroy =3D drm_connector_cleanup, -}; - -static int cdns_mhdp_connector_init(struct cdns_mhdp_device *mhdp) -{ - u32 bus_format =3D MEDIA_BUS_FMT_RGB121212_1X36; - struct drm_connector *conn =3D &mhdp->connector; - struct drm_bridge *bridge =3D &mhdp->bridge; - int ret; - - conn->polled =3D DRM_CONNECTOR_POLL_HPD; - - ret =3D drm_connector_init(bridge->dev, conn, &cdns_mhdp_conn_funcs, - DRM_MODE_CONNECTOR_DisplayPort); - if (ret) { - dev_err(mhdp->dev, "Failed to initialize connector with drm\n"); - return ret; - } - - mhdp->connector_ptr =3D conn; - drm_connector_helper_add(conn, &cdns_mhdp_conn_helper_funcs); - - ret =3D drm_display_info_set_bus_formats(&conn->display_info, - &bus_format, 1); - if (ret) - return ret; - - ret =3D drm_connector_attach_encoder(conn, bridge->encoder); - if (ret) { - dev_err(mhdp->dev, "Failed to attach connector to encoder\n"); - return ret; - } - - if (mhdp->hdcp_supported) - ret =3D drm_connector_attach_content_protection_property(conn, true); - - return ret; -} - static int cdns_mhdp_attach(struct drm_bridge *bridge, struct drm_encoder *encoder, enum drm_bridge_attach_flags flags) @@ -1672,9 +1509,11 @@ static int cdns_mhdp_attach(struct drm_bridge *bridg= e, return ret; =20 if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { - ret =3D cdns_mhdp_connector_init(mhdp); - if (ret) - goto aux_unregister; + ret =3D -EINVAL; + dev_err(mhdp->dev, + "Connector initialisation not supported in bridge_attach %d\n", + ret); + goto aux_unregister; } =20 spin_lock(&mhdp->start_lock); @@ -2391,17 +2230,10 @@ static void cdns_mhdp_hpd_work(struct work_struct *= work) struct cdns_mhdp_device *mhdp =3D container_of(work, struct cdns_mhdp_device, hpd_work); - int ret; =20 - ret =3D cdns_mhdp_update_link_status(mhdp); - if (mhdp->connector_ptr && mhdp->connector_ptr->dev) { - if (ret < 0) - schedule_work(&mhdp->modeset_retry_work); - else - drm_kms_helper_hotplug_event(mhdp->bridge.dev); - } else { - drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); - } + cdns_mhdp_update_link_status(mhdp); + + drm_bridge_hpd_notify(&mhdp->bridge, cdns_mhdp_detect(mhdp)); } =20 static int cdns_mhdp_probe(struct platform_device *pdev) --=20 2.34.1