From nobody Mon Feb 9 22:02:55 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 BB5F52FDC57 for ; Tue, 14 Oct 2025 09:46:38 +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=1760435200; cv=none; b=SVEd/DO8wCfEP+lpHYSvpcREwqZ3okdSx85Rwclh/n0yPScbIWCCU4MPF3gjmKJ2hAv1Xuz1QY/1b2tALPm/cQe/NBV91Ni2MM7d43zF74Sv8LjdgU0U7PYf8KMa598+0l9lglAT/EC+3Qm5LlNpqc8cH6rWdPrBBh5lbohyb4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760435200; c=relaxed/simple; bh=AvxFicySUy7tAxHB9r1r8REB31ssMmdCVLldUJLPlWc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ekPUwAHW9lC+dsbubwuOmGlz8iBH1aST2UfOveGUM2RI4Swei2EToMhJIxVhdt2pydvTXI3U827dc/HueWfnBtK4a4HYRQDHY1scC6KYnhlqdub8wVnQM2Q6PUm06eLO8Nl9Wl+8aIakpcWX/l62z6eA6bKChFjjGqMMlMdas2w= 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=upTHZvYT; 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="upTHZvYT" Received: from fllvem-sh04.itg.ti.com ([10.64.41.54]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 59E9jono1118512; Tue, 14 Oct 2025 04:45:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1760435150; bh=/U4os51AnkFPhZjaN58wUCcTRHoRAW032REhBml+xEU=; h=From:To:Subject:Date:In-Reply-To:References; b=upTHZvYTy2P9SHtWJmlwnCFViB21HHI94gBxSV2+FeJonODe3Lj9UeTAYN/95RXqg LGfQD8yputhrfvRl2t9nP7LSEr7lPViak9fSmDI7K+7tupHrnl7stWO40tOyT8QZyu Ihdb7KLjQpzfy/U68Z10FplIBA0RH+7O7C7eEkUg= Received: from DFLE203.ent.ti.com (dfle203.ent.ti.com [10.64.6.61]) by fllvem-sh04.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 59E9jnKD3713471 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Oct 2025 04:45:49 -0500 Received: from DFLE211.ent.ti.com (10.64.6.69) by DFLE203.ent.ti.com (10.64.6.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 14 Oct 2025 04:45:49 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE211.ent.ti.com (10.64.6.69) 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:49 -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 59E9jSjU3359281; Tue, 14 Oct 2025 04:45:42 -0500 From: Harikrishna Shenoy To: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v8 2/6] drm/bridge: cadence: cdns-mhdp8546-core: Add mode_valid hook to drm_bridge_funcs Date: Tue, 14 Oct 2025 15:15:23 +0530 Message-ID: <20251014094527.3916421-3-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 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 DBANC 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 f3076e9cdabb..7178a01e4d4d 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2162,6 +2162,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, @@ -2176,6 +2195,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