From nobody Wed Oct 1 23:46:53 2025 Received: from fllvem-ot04.ext.ti.com (fllvem-ot04.ext.ti.com [198.47.19.246]) (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 9050B2F9D89 for ; Mon, 29 Sep 2025 10:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.246 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759140261; cv=none; b=t2DEOVIGVjNx2x5Tq/Zs+vp+vDOmQqjCES+FkntmKPXhLHUVypX3sGp9Usd//Qy2UqcZeS2qp1oYbAeGAUvb0eRrLG6LDqU/eavkMtPOGY9YSQ4+jzHfvGuu4SQEswc2Qhbk6ju4opp1XR2PkKJ4ocPaCmnAtQiCRgJzZW4J5P4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759140261; c=relaxed/simple; bh=uodlQOc0p5N8+eEFenCZtnu7vHFME/3mJDddapKzCKs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iIHWDZI26qRTipDEaYuTCc6JtnErrGBq6l97QyDbtrelH5UMqeakZBJ1RhL5M9a533UqG3KtbAgGt7LbqJ/39dKHo3svWiqKHUnRpKRGQl3/3eAG+LEOkQJD/Oy8/PLebCZXOzsHuT3wY+829UlyB32KIVm72mbydqqZ9VehBlE= 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=jPiw8co9; arc=none smtp.client-ip=198.47.19.246 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="jPiw8co9" Received: from fllvem-sh04.itg.ti.com ([10.64.41.54]) by fllvem-ot04.ext.ti.com (8.15.2/8.15.2) with ESMTP id 58T8eDeZ2600000; Mon, 29 Sep 2025 03:40:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1759135213; bh=x+bW5nILqEv/SK3Js8aT/xxiSAA0HD5g/YohhDShMzg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jPiw8co9mfMYpCgFH+F6XSCL/SmVXfj1GxrEgf3YVqUml+mlgp6xVJ/fpsrEqRqEl pE0NB+mtFHQO4FK22DuvKLGAIWvPSnFWnX4P3EoF/oCqdp2yoWr7aTnVTkAFnYF8Ks J+8XX1+xby7o/4oxwSTf/mS7vK7HofbDodvEXaHs= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllvem-sh04.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 58T8eDRs2996185 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Mon, 29 Sep 2025 03:40:13 -0500 Received: from DLEE202.ent.ti.com (157.170.170.77) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Mon, 29 Sep 2025 03:40:12 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE202.ent.ti.com (157.170.170.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Mon, 29 Sep 2025 03:40:12 -0500 Received: from hkshenoy.dhcp.ti.com (hkshenoy.dhcp.ti.com [172.24.235.208] (may be forged)) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 58T8daaR927539; Mon, 29 Sep 2025 03:40:06 -0500 From: Harikrishna Shenoy To: , , , , , , , , , , , , , , , , , , , , , , , , CC: , Subject: [PATCH v7 4/6] drm/bridge: cadence: cdns-mhdp8546-core: Add mode_valid hook to drm_bridge_funcs Date: Mon, 29 Sep 2025 14:09:34 +0530 Message-ID: <20250929083936.1575685-5-h-shenoy@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250929083936.1575685-1-h-shenoy@ti.com> References: <20250929083936.1575685-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 Add cdns_mhdp_bridge_mode_valid() to check if specific mode is valid for this bridge or not. In the legacy !(DBANC) usecase, we were using the hook from drm_connector_helper_funcs but with removal of legacy code, we need to have mode_valid() in drm_bridge_funcs. Fixes: c932ced6b585 ("drm/tidss: Update encoder/bridge chain connect model") Reviewed-by: Tomi Valkeinen Signed-off-by: Jayesh Choudhary Signed-off-by: Harikrishna Shenoy --- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/= gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index b2f5a48cac2d..47c657237c37 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -1999,6 +1999,25 @@ static const struct drm_edid *cdns_mhdp_bridge_edid_= read(struct drm_bridge *brid return cdns_mhdp_edid_read(mhdp, connector); } =20 +static enum drm_mode_status +cdns_mhdp_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + struct cdns_mhdp_device *mhdp =3D bridge_to_mhdp(bridge); + + 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 const struct drm_bridge_funcs cdns_mhdp_bridge_funcs =3D { .atomic_enable =3D cdns_mhdp_atomic_enable, .atomic_disable =3D cdns_mhdp_atomic_disable, @@ -2013,6 +2032,7 @@ static const struct drm_bridge_funcs cdns_mhdp_bridge= _funcs =3D { .edid_read =3D cdns_mhdp_bridge_edid_read, .hpd_enable =3D cdns_mhdp_bridge_hpd_enable, .hpd_disable =3D cdns_mhdp_bridge_hpd_disable, + .mode_valid =3D cdns_mhdp_bridge_mode_valid, }; =20 static bool cdns_mhdp_detect_hpd(struct cdns_mhdp_device *mhdp, bool *hpd_= pulse) --=20 2.34.1