From nobody Tue Feb 10 08:01:16 2026 Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) (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 11E343101B4 for ; Tue, 14 Oct 2025 09:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760435207; cv=none; b=A07D5mtd8vRYxsvU/o8MqizvNp/qnQ2kLuSifQ2+G+Uc0PAyI7udPX8spz0JjHC78CW7VHQXdhgcmyRkrpMvdUmBDpmahNQWzYPfYVtMxsoZMYYmNzvlnHvf3DrngFivM356QoUqrPirVrlS3qQ0XiCZqUsnVZuLjyk9PZhHsWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760435207; c=relaxed/simple; bh=sF62NY/hXkORD2Eeq/8O3ZO4kcfZFnZ0z6Kg9mSuvEk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MwaXkCYVUGp5TjLUQVffFLkr9Y6nb/bRvCrvubEwMv150SaV45rHKkAzhMSmeCGsCtSUiZkJZHh/PLCYZTyOHKkXydv3B3ZoQcQQbT7NNO+MSU8jyGig0n6pkesY5yb6k4GV99i49TmKpw8CzUazixQ4FOBPIM5VpZKOEIGgOR8= 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=U3sU7j5T; arc=none smtp.client-ip=198.47.23.234 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="U3sU7j5T" Received: from lelvem-sh02.itg.ti.com ([10.180.78.226]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 59E9k4Pd1118566; Tue, 14 Oct 2025 04:46:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1760435164; bh=G2eY2o4OEo6VtywjaA2qCwEaXYWT6r4fqOW+c1QiJww=; h=From:To:Subject:Date:In-Reply-To:References; b=U3sU7j5TGiQ4ob0UCO+la6ysCFOB9tg+WHlDwKNHLju0TORrbiHZCCcWI+qwvVA/I Zm620KfT8ONMMDq2aM35xGjgRETYKBKdK9N5Wb2r1Jmx21mZaS+8O28TwA7o5o9fZq zEuyfy3dMn2+0bO35cnofaax/PKRnCM1Pj1kzwVw= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelvem-sh02.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 59E9k4M8350837 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Tue, 14 Oct 2025 04:46:04 -0500 Received: from DLEE213.ent.ti.com (157.170.170.116) by DLEE100.ent.ti.com (157.170.170.30) 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:46:03 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE213.ent.ti.com (157.170.170.116) 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:46:03 -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 59E9jSjW3359281; Tue, 14 Oct 2025 04:45:56 -0500 From: Harikrishna Shenoy To: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v8 4/6] drm/bridge: cadence: cdns-mhdp8546*: Change drm_connector from structure to pointer Date: Tue, 14 Oct 2025 15:15:25 +0530 Message-ID: <20251014094527.3916421-5-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 After adding DBANC framework, mhdp->connector is not initialised during bridge_attach(). The connector is however required in few driver calls like cdns_mhdp_hdcp_enable() and cdns_mhdp_modeset_retry_fn(). Now that we have dropped the legacy code which became redundant with introduction of DBNAC usecase in driver, we can cleanly switch to drm_connector pointer instead of structure. Set it in bridge_enable() and clear it in bridge_disable(), and make appropriate changes. This allows us to dynamically set the reference in bridge_enable() when the connector becomes available and clear it in bridge_disable(). This change is necessary to properly integrate with the DBANC framework while maintaining all connector-dependent functionality in the driver. Reviewed-by: Dmitry Baryshkov Signed-off-by: Jayesh Choudhary Signed-off-by: Harikrishna Shenoy --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 12 ++++++------ drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h | 3 +-- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/= gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 31256ad69602..fe2da567ec66 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -1765,12 +1765,12 @@ static void cdns_mhdp_atomic_enable(struct drm_brid= ge *bridge, =20 mutex_lock(&mhdp->link_mutex); =20 - mhdp->connector_ptr =3D drm_atomic_get_new_connector_for_encoder(state, - bridge->encoder); - if (WARN_ON(!mhdp->connector_ptr)) + mhdp->connector =3D drm_atomic_get_new_connector_for_encoder(state, + bridge->encoder); + if (WARN_ON(!mhdp->connector)) goto out; =20 - conn_state =3D drm_atomic_get_new_connector_state(state, mhdp->connector_= ptr); + conn_state =3D drm_atomic_get_new_connector_state(state, mhdp->connector); if (WARN_ON(!conn_state)) goto out; =20 @@ -1869,7 +1869,7 @@ static void cdns_mhdp_atomic_disable(struct drm_bridg= e *bridge, if (mhdp->info && mhdp->info->ops && mhdp->info->ops->disable) mhdp->info->ops->disable(mhdp); =20 - mhdp->connector_ptr =3D NULL; + mhdp->connector =3D NULL; mutex_unlock(&mhdp->link_mutex); } =20 @@ -2156,7 +2156,7 @@ static void cdns_mhdp_modeset_retry_fn(struct work_st= ruct *work) =20 mhdp =3D container_of(work, typeof(*mhdp), modeset_retry_work); =20 - conn =3D mhdp->connector_ptr; + conn =3D mhdp->connector; =20 /* Grab the locks before changing connector property */ mutex_lock(&conn->dev->mode_config.mutex); diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h b/drivers/= gpu/drm/bridge/cadence/cdns-mhdp8546-core.h index a76775c76895..b297db53ba28 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h @@ -375,8 +375,7 @@ struct cdns_mhdp_device { */ struct mutex link_mutex; =20 - struct drm_connector connector; - struct drm_connector *connector_ptr; + struct drm_connector *connector; struct drm_bridge bridge; =20 struct cdns_mhdp_link link; diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c b/drivers/= gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c index 42248f179b69..59f18c3281ef 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c @@ -394,7 +394,7 @@ static int _cdns_mhdp_hdcp_disable(struct cdns_mhdp_dev= ice *mhdp) int ret; =20 dev_dbg(mhdp->dev, "[%s:%d] HDCP is being disabled...\n", - mhdp->connector.name, mhdp->connector.base.id); + mhdp->connector->name, mhdp->connector->base.id); =20 ret =3D cdns_mhdp_hdcp_set_config(mhdp, 0, false); =20 @@ -445,7 +445,7 @@ static int cdns_mhdp_hdcp_check_link(struct cdns_mhdp_d= evice *mhdp) =20 dev_err(mhdp->dev, "[%s:%d] HDCP link failed, retrying authentication\n", - mhdp->connector.name, mhdp->connector.base.id); + mhdp->connector->name, mhdp->connector->base.id); =20 ret =3D _cdns_mhdp_hdcp_disable(mhdp); if (ret) { @@ -487,13 +487,13 @@ static void cdns_mhdp_hdcp_prop_work(struct work_stru= ct *work) struct cdns_mhdp_device *mhdp =3D container_of(hdcp, struct cdns_mhdp_device, hdcp); - struct drm_device *dev =3D mhdp->connector.dev; + struct drm_device *dev =3D mhdp->connector->dev; struct drm_connector_state *state; =20 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); mutex_lock(&mhdp->hdcp.mutex); if (mhdp->hdcp.value !=3D DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { - state =3D mhdp->connector.state; + state =3D mhdp->connector->state; state->content_protection =3D mhdp->hdcp.value; } mutex_unlock(&mhdp->hdcp.mutex); --=20 2.34.1