From nobody Tue Dec 16 22:32:24 2025 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 39B9221E0BB for ; Thu, 29 May 2025 14:25:51 +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=1748528753; cv=none; b=Svp7lbdVj7PBeGb50Fq9zMU6YC7B+RkwlJgF4OM0xnPngeIW+89tL5XPxvMDQmJRr4K0zL0/neXmx7D1rl+bbXkbnxl0mtfsjt7LwPrs3x4MdKGgeZqf/9EDDnPNf2eMB3vYBllySRNcbrpZRtZf3obRlBxDL+cySSs5+QMk2D0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748528753; c=relaxed/simple; bh=1osUGaoML6utIeyp8SnPWPNFyZdRjgnVWgh7Uzw7jK4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nsIlgKHIKrxf1xaDbJhY9AfU4AQj09yKsTc4iXOmPcsN5+F+sMN+Q3uXqsqvaV85CmVXj+1/lu5Y9GKUF8Z6A2Grimdxi5dkv45QorEu7OhEw5Qz7dnx4Z7N/EA5Ev9uYSmyEmQ0uTLr6+Aa4q8euLQhz5a+pUxa2SgH+gG+AX0= 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=VWYPHiiW; 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="VWYPHiiW" 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 54TEPPiK3599009; Thu, 29 May 2025 09:25:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1748528725; bh=nlBX2hdY1lPiIRIIK25xlstSZAlj3P5AoisLUrlM3pE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=VWYPHiiWu49qzuVDvoh1Wapj5fGeEL01024mJ4RjOOjAEG4ngvYdBf6F2Mx5FB/HM PKbHoMW8WRTH08YdPL+KhnncnxUDwheZsejkOqFUNHm5PSX1VGGpHlyAtE5T9Hykmb 3nxOLQQ7OVnGtt+Z2UNnkYOGhBfZsX0dfJwIbq1g= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 54TEPODY152075 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 29 May 2025 09:25:24 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 29 May 2025 09:25:24 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 29 May 2025 09:25:24 -0500 Received: from localhost (jayesh-hp-z2-tower-g5-workstation.dhcp.ti.com [172.24.227.14]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 54TEPN241704173; Thu, 29 May 2025 09:25:24 -0500 From: Jayesh Choudhary To: , , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH v3 4/5] drm/bridge: cadence: cdns-mhdp8546-core: Add mode_valid hook to drm_bridge_funcs Date: Thu, 29 May 2025 19:55:16 +0530 Message-ID: <20250529142517.188786-5-j-choudhary@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250529142517.188786-1-j-choudhary@ti.com> References: <20250529142517.188786-1-j-choudhary@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" 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") Signed-off-by: Jayesh Choudhary --- .../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 97ecee98851f..2b8c542e9d48 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -1998,6 +1998,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, @@ -2012,6 +2031,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