From nobody Thu Dec 18 10:36:18 2025 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 AB82B233553 for ; Tue, 14 Jan 2025 05:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834214; cv=none; b=hq8fOgRxC8veg/ms7APeN0hVKcjjGVvsH/XS1FHp4n/Q+cQs+Ovzr9P0VwCi3Or8YXH+ua35UiEWFsW1O4kV9XO1dgetsNEL5etn1pZatU6LxsZfGa7DzNG61GyPUZZ8KodWyUFBjpvf5er7TG/IOx/Ypz2QI5zykdkO5LvNKkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834214; c=relaxed/simple; bh=CjAUuUxRrPQFtKfkFOb0ojXdlLmyL0zNo5Y4zJ/PFss=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sXGQ2BL9paj7pxe11cqXL8LYY3sutW4AWybFv1xr0Mltq/Q763Fchjg7WhyHklXxf10eVIJlGF0tEt8aEqxg2yPPKpgGNolDjcWRpn7wEEMTcqqkNAYvTjm2mCaLiKVGBAWrnFQi4YM82O3KQnvN46WnVFJfDjfL2Si/f2Q1CiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=EBqiBoD8; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="EBqiBoD8" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5d3apa4TFaIozaxno1Aw98+GKuBrpTgMRN2+gubjz6Q=; b=EBqiBoD8g+uty0BPacVWJhfqlOHQBna2Jc2qktG7Hnu3panYkFT4BLh1qSzc5q1/Id4TUT 540YhEOwBR7q2KqT85i38tzqpbxIg3fKQpgU180A81z+GRAaGn83nGSOpDAVpu3vsNLd1h P2Bw7OhYHkENR1SPVYJ+IdoY5ygPlPE= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 01/12] drm/bridge: cdns-dsi: Fix connecting to next bridge Date: Tue, 14 Jan 2025 11:26:15 +0530 Message-Id: <20250114055626.18816-2-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Fix the OF node pointer passed to the of_drm_find_bridge() call to find the next bridge in the display chain. The code to find the next panel (and create its panel-bridge) works fine, but to find the next (non-panel) bridge does not. To find the next bridge in the pipeline, we need to pass "np" - the OF node pointer of the next entity in the devicetree chain. Passing "of_node" to of_drm_find_bridge (which is what the code does currently) will fetch the bridge for the cdns-dsi which is not what's required. Fix that. Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver") Reviewed-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index c7a0247e06ad..2f897ea5e80a 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -952,7 +952,7 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, bridge =3D drm_panel_bridge_add_typed(panel, DRM_MODE_CONNECTOR_DSI); } else { - bridge =3D of_drm_find_bridge(dev->dev.of_node); + bridge =3D of_drm_find_bridge(np); if (!bridge) bridge =3D ERR_PTR(-EINVAL); } --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 D5EAA2397BD for ; Tue, 14 Jan 2025 05:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834218; cv=none; b=NKzG43kI8/x3G2CPBqy6IbRQnjfwUUWyW+Q0uyLN0rckAPPqUjYO95oHa3Qs03PWa+j0ck8VdxhG2SqAtffV+uHuGT3mK25MX4VOlyiYjusO7wiU+sMJCZ5frQvG8HxVYuWta+TVA3sIM0KAxzceFrHdKKoz3efPTIoqtONGjrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834218; c=relaxed/simple; bh=Fz9dsFeFmmlSyuf32Qarv/FGle1hsi5NpAz9e/QDoUY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aO3ak0GKlEyCXFpnyf8lRWPAV2pep/NA5vxVdgARTGY3ysfLhrNvRus/FrMvM9tBPYaLnDeUhD/yOBcXVPPnw2IQaagFEfjRfyPDb1O5K4R8twuS8xtxlJ7P5Gjijbr2q9IPRWWmOAAODRqZV6DEvwd5DZRt6IQXexnYWuOSVWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=MZZ19EsA; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="MZZ19EsA" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pTQNYNRsRTDPvLebMCe+3PXGgkJKRcAnZQYe/nMlLjQ=; b=MZZ19EsAR+5c82l7aPeZDyIWDjVFjHX/OM8v04HZr/KRTkyGP22NKkxo3IFmHNk7LliWlV kOnCn/TPDlPPRGD93so7+zF9Tv4zAFQ1WQ4H5zXjcvN37hrSqK1XXPcotmu2xOZPYbeu/Z laod2owNyJomSoyXR7MpkiEcN1PXaE4= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 02/12] drm/bridge: cdns-dsi: Move to devm_drm_of_get_bridge() Date: Tue, 14 Jan 2025 11:26:16 +0530 Message-Id: <20250114055626.18816-3-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Instead of manually finding the next bridge/panel, and maintaining the panel-bridge (in-case the next entity is a panel), switch to using the automatically managing devm_drm_of_get_bridge() API. Drop the drm_panel support completely from the driver while at it. Reviewed-by: Tomi Valkeinen Reviewed-by: Dmitry Baryshkov Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 28 ++----------------- .../gpu/drm/bridge/cadence/cdns-dsi-core.h | 2 -- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 2f897ea5e80a..056583e81155 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -920,8 +920,6 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, struct cdns_dsi_output *output =3D &dsi->output; struct cdns_dsi_input *input =3D &dsi->input; struct drm_bridge *bridge; - struct drm_panel *panel; - struct device_node *np; int ret; =20 /* @@ -939,26 +937,10 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, /* * The host <-> device link might be described using an OF-graph * representation, in this case we extract the device of_node from - * this representation, otherwise we use dsidev->dev.of_node which - * should have been filled by the core. + * this representation. */ - np =3D of_graph_get_remote_node(dsi->base.dev->of_node, DSI_OUTPUT_PORT, - dev->channel); - if (!np) - np =3D of_node_get(dev->dev.of_node); - - panel =3D of_drm_find_panel(np); - if (!IS_ERR(panel)) { - bridge =3D drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - } else { - bridge =3D of_drm_find_bridge(np); - if (!bridge) - bridge =3D ERR_PTR(-EINVAL); - } - - of_node_put(np); - + bridge =3D devm_drm_of_get_bridge(dsi->base.dev, dsi->base.dev->of_node, + DSI_OUTPUT_PORT, dev->channel); if (IS_ERR(bridge)) { ret =3D PTR_ERR(bridge); dev_err(host->dev, "failed to add DSI device %s (err =3D %d)", @@ -968,7 +950,6 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, =20 output->dev =3D dev; output->bridge =3D bridge; - output->panel =3D panel; =20 /* * The DSI output has been properly configured, we can now safely @@ -984,12 +965,9 @@ static int cdns_dsi_detach(struct mipi_dsi_host *host, struct mipi_dsi_device *dev) { struct cdns_dsi *dsi =3D to_cdns_dsi(host); - struct cdns_dsi_output *output =3D &dsi->output; struct cdns_dsi_input *input =3D &dsi->input; =20 drm_bridge_remove(&input->bridge); - if (output->panel) - drm_panel_bridge_remove(output->bridge); =20 return 0; } diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.h index ca7ea2da635c..5db5dbbbcaad 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h @@ -10,7 +10,6 @@ =20 #include #include -#include =20 #include #include @@ -21,7 +20,6 @@ struct reset_control; =20 struct cdns_dsi_output { struct mipi_dsi_device *dev; - struct drm_panel *panel; struct drm_bridge *bridge; union phy_configure_opts phy_opts; }; --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 92CBB23A0FF for ; Tue, 14 Jan 2025 05:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834222; cv=none; b=GW82zMmZZuUd/KL+2MfMt2328Ii0V976OeXRj/Mep97zzKcleOLVUan8VEN9mvO9cRZYr5X94uMxIDggbH/BF6w3D8ZLbZCA5HHT6fINRpadZErXZoohFP7CsI92IcqODTFGw40ZbycLooUjizh1iOcRICbJYNLzMeOxk8d4L+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834222; c=relaxed/simple; bh=OWR1y5UbXd+nIZWVNGuKG43ji/uY+F9GCelktxkYqqI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u6Eazs+K9pu5RZJ2ro5HEHgTNKGiOBQLnxNYkb4b2y+OYML3MNE7NrfISHZuxOXhR18a+xxC7YZG9rnyTCdiKeYVSerJkAoE7j2HX2kCmX0kHaYWOOsbVGDlIx/UYediUWl5HjXLGdPSpxYij/KIv2A/Mn5OcFiXiVqSWbLrJBw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=IxmezzX4; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="IxmezzX4" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UH2zGmcA5HXp21+So6ChmmD6SFUtGHmJj7f4jX4RLU4=; b=IxmezzX4XGWW0CG796RKhKRF/gOG2OVLgtc0CJK3NaKT6XdKqaRic0z8OAHmR9CyMUQrfQ JJ7YgoKdqYwdVS5D+wxTZ/dH/hDLv+LCbVsTd0QZ+fBFBeYOKHXuOZaIz04CdxMqC729km F2A6XjVynMQYknqUm30qdH5+P2ynDOc= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 03/12] drm/bridge: cdns-dsi: Fix phy de-init and flag it so Date: Tue, 14 Jan 2025 11:26:17 +0530 Message-Id: <20250114055626.18816-4-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia The driver code doesn't have a Phy de-initialization path as yet, and so it does not clear the phy_initialized flag while suspending. This is a problem because after resume the driver looks at this flag to determine if a Phy re-initialization is required or not. It is in fact required because the hardware is resuming from a suspend, but the driver does not carry out any re-initialization causing the D-Phy to not work at all. Call the counterparts of phy_init() and phy_power_on(), that are phy_exit() and phy_power_off(), from _bridge_disable(), and clear the flags so that the Phy can be initialized again when required. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 056583e81155..039c5eb7fb66 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -672,6 +672,11 @@ static void cdns_dsi_bridge_disable(struct drm_bridge = *bridge) if (dsi->platform_ops && dsi->platform_ops->disable) dsi->platform_ops->disable(dsi); =20 + dsi->phy_initialized =3D false; + dsi->link_initialized =3D false; + phy_power_off(dsi->dphy); + phy_exit(dsi->dphy); + pm_runtime_put(dsi->base.dev); } =20 @@ -1130,7 +1135,6 @@ static int __maybe_unused cdns_dsi_suspend(struct dev= ice *dev) clk_disable_unprepare(dsi->dsi_sys_clk); clk_disable_unprepare(dsi->dsi_p_clk); reset_control_assert(dsi->dsi_p_rst); - dsi->link_initialized =3D false; return 0; } =20 --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 41DAE235BE8 for ; Tue, 14 Jan 2025 05:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834231; cv=none; b=gB0sIx6zD/geiL26h3WFDPAYzCcubaTwpr8vpIlaJXbsg9XR1uTnuLmpk/bd2a7a1unk0cVBtZH1P3lmD2qgaIOLTtFwExb0wSnx80fabc8fjdxjRJeY/AwjczeuxZ58g660KJwUhCEux3WIh5nwDfuDhWhGNDDJpWHd4LDU2kg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834231; c=relaxed/simple; bh=sGIqa5YXmMwo4v8o6RIecKOWy8gBEjwhOLHFUGaQ0H4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SuzbsVUxnhlYZ1v13nCxPwkkLwUzsuuxtVuU0n0sFrH2h1aIqDM93jTYW18iCGCS/3yjw/SOG+gr/Bq9NDv1nNHbqFQsx+rTBCoClypkEpVfEfhGx5ZCI2Jhg3HRuZRSVkK98MZ5vw4YK4J4QCrrHCEnJAyP9vMtf2C21G+Scgg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=sWLCHvh6; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="sWLCHvh6" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xMqg2hsBn5Cq31mZLHDekYEO2K2e7ncBx+45OHYtapA=; b=sWLCHvh6NJv5gEPdTwbIEh1IPRFX5P9O/mOYtYhbT8/fUrpW8QbdHnuRUS0VoGyrwmg/7X y6g+79VxXarwPShkhaXRS3XGMl+Kv8ssS+iQbgvgrKl1FeKGThC3W5xrzx8T9cWR8UejOO XfMoKCTzoohEWa1bTSDBv2gzeijJrvM= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 04/12] drm/bridge: cdns-dsi: Fix the link and phy init order Date: Tue, 14 Jan 2025 11:26:18 +0530 Message-Id: <20250114055626.18816-5-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia The order of init of DSI link and DSI phy is wrong. The DSI link needs to be configured before the DSI phy is getting configured. Otherwise, the D-Phy is unable to lock in on the incoming PLL Reference clock[0]. Fix the order of inits. [0]: See section 12.6.5.7.3 "Start-up Procedure" in J721E SoC TRM TRM Link: http://www.ti.com/lit/pdf/spruil1 Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 039c5eb7fb66..89e8d6f1c4dd 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -780,8 +780,8 @@ static void cdns_dsi_bridge_enable(struct drm_bridge *b= ridge) =20 WARN_ON_ONCE(cdns_dsi_check_conf(dsi, mode, &dsi_cfg, false)); =20 - cdns_dsi_hs_init(dsi); cdns_dsi_init_link(dsi); + cdns_dsi_hs_init(dsi); =20 writel(HBP_LEN(dsi_cfg.hbp) | HSA_LEN(dsi_cfg.hsa), dsi->regs + VID_HSIZE1); --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (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 B3ECB23A58B for ; Tue, 14 Jan 2025 05:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834235; cv=none; b=e6nYrol8swZBRx2J9CJe/+a7guQwanOYsvtFAPuZ2SaUVyh3WJbmEAKEOn/rRoE2yLnZTm0oG6fgoChqBeQTpjHrsemIEf8QBfyFRjwCOvc7OM2et1Ma9egALfE+vlMyzDEICLBlELlnFTHyLpiG9kvB/m5YtZM6Bn3f649ZiIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834235; c=relaxed/simple; bh=5ZYUpOk5yIPDjSfrA8H0+cN8qupT+JHwstlWJzg8YUg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NZhjxzxdwVXDBB8xK94yxCUb1PuGmBijj50rTzhiDs+0hRQfsGzsgnsAH5HprG+nvf1owpLauIefPhv37ltpnvapLwOeBf3TQLBtu++Tb+SSAryKlHiO1EBH1iXPY6Uds78bjSkgUjXdPXojfhnen9RZKrIgNYeKLU2RyO6Hle8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OdR/PluS; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OdR/PluS" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Imf/xyhw4uKNsZ4oYDisBJ/mi1o4AP5Pj/xgfsiIWdc=; b=OdR/PluSbjPZ0ifkOoh8GdtwUkO3dKzbUbrEowtm+wjIYWfbneZQU6N8JmHaenSzdCRCgC rjk43Auvp5IUJwfPHq3+Detpi7EzZ/J+GRnE1tkB6O+kgv6sBdvTyMwczTvUOcDX/AdVGB BKvSCMvHuqS2/eNsDM9qRya39RlEFQ0= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 05/12] drm/bridge: cdns-dsi: Fix the clock variable for mode_valid() Date: Tue, 14 Jan 2025 11:26:19 +0530 Message-Id: <20250114055626.18816-6-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia The crtc_* mode parameters do not get generated (duplicated in this case) from the regular parameters before the mode validation phase begins. The rest of the code conditionally uses the crtc_* parameters only during the bridge enable phase, but sticks to the regular parameters for mode validation. In this singular instance, however, the driver tries to use the crtc_clock parameter even during the mode validation, causing the validation to fail. Allow the D-Phy config checks to use mode->clock instead of mode->crtc_clock during mode_valid checks, like everywhere else in the driver. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 89e8d6f1c4dd..ccd964ba8c23 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -568,13 +568,14 @@ static int cdns_dsi_check_conf(struct cdns_dsi *dsi, struct phy_configure_opts_mipi_dphy *phy_cfg =3D &output->phy_opts.mipi_d= phy; unsigned long dsi_hss_hsa_hse_hbp; unsigned int nlanes =3D output->dev->lanes; + int mode_clock =3D (mode_valid_check ? mode->clock : mode->crtc_clock); int ret; =20 ret =3D cdns_dsi_mode2cfg(dsi, mode, dsi_cfg, mode_valid_check); if (ret) return ret; =20 - phy_mipi_dphy_get_default_config(mode->crtc_clock * 1000, + phy_mipi_dphy_get_default_config(mode_clock * 1000, mipi_dsi_pixel_format_to_bpp(output->dev->format), nlanes, phy_cfg); =20 --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 8507E23353B for ; Tue, 14 Jan 2025 05:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834244; cv=none; b=q9QLFHV4s26LECeiZJpeM9jcZZX5Mq83cPF01QzuaGjXiZgueDIWMXcgJzGDItyf3mrlmb01vUPAuPd92zUqXm2Th5fHjAimJP47/frWgAXAMq8RNVtYzLnAzmzwEVuHXp4QuZN8K5VZYi5lp7pCoT9681sdvKnz+sYBXwvEXNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834244; c=relaxed/simple; bh=xcpSPbDC8vf9yYwoPztwfXlsk3SShtgdieWBOE9aB1k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WQAySPBlMTh6dQ//QVsTVoBtfi32B5Z+s1+qwdQDMFrxVI5IwQDTB1QDr9gsuxT/B03dPdD08Ww1fQlz8T7TNmyAmMPNF8HCZuVxbj2U/RMjYa/5Gl7xdJBbsMjOKrpCgK6Bfg+C2D7ZGmdThghi3nBH9qCMAJTlAIwTOQsNNVU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=CToddPai; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CToddPai" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uxb9KnTp9FXMdHTDdRf0BZ+7VLiPmS3oOAnR318lSNw=; b=CToddPaiaMVtSnzMCriSErnqPZemyUSu5IK85wOXzbEeN365puuCfkvg9JLPovqFh3QYqP 20t2MyrCen6KAg9i1CjYnmargZ639eltNiJnk7OI/3ZxKqqd4a90IoelXKLt+xb7dWwOvz u1W0J532O819mhwhz+9D7h4Euwifv98= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 06/12] drm/bridge: cdns-dsi: Check return value when getting default PHY config Date: Tue, 14 Jan 2025 11:26:20 +0530 Message-Id: <20250114055626.18816-7-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Check for the return value of the phy_mipi_dphy_get_default_config() call, and incase of an error, return back the same. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Reviewed-by: Tomi Valkeinen Reviewed-by: Dmitry Baryshkov Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index ccd964ba8c23..b278e424b4b5 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -575,9 +575,11 @@ static int cdns_dsi_check_conf(struct cdns_dsi *dsi, if (ret) return ret; =20 - phy_mipi_dphy_get_default_config(mode_clock * 1000, - mipi_dsi_pixel_format_to_bpp(output->dev->format), - nlanes, phy_cfg); + ret =3D phy_mipi_dphy_get_default_config(mode_clock * 1000, + mipi_dsi_pixel_format_to_bpp(output->dev->format), + nlanes, phy_cfg); + if (ret) + return ret; =20 ret =3D cdns_dsi_adjust_phy_config(dsi, dsi_cfg, phy_cfg, mode, mode_vali= d_check); if (ret) --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 D293A23278D for ; Tue, 14 Jan 2025 05:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834253; cv=none; b=EI1sCiKNWYPfLkWeEuIatGWhsbIyGruMI3YJXjH3aALAGG7+gpz+RGR2IF3xiWT96KbkrsOxH344lhNsyG/pKcALoJONK8E+sVyKi22RsZ6NCkm0NHub7GClauFK9H7bzvft+6pzYjCuTJWeOG6ItXMr7I8oiA54B4Dky5/hqHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834253; c=relaxed/simple; bh=LU37xuyaXWmti8evUPe0M6UNVMR0u8CcrZpRM5irT1w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tbyllN4baaCfHcj+iE9IFBdjRCcyrVFYHiDxwDSlrxQWO3Qab0wUK1YHInlA0mDYo64QprsSdN6sdKfNRtZog9UU0RFKDjA3v1HLcRkEr7xmzjEYFUviGoI+fD1jI+wr0xZ7X/6YmAsH6QGx8TwXL7PENltuugV+r9/iXh7ljoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xIc4MS+i; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xIc4MS+i" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/e/3IAHR9g60l6Tuqhyx0TozV0ny05UUNHxgLK7WQHo=; b=xIc4MS+iSPzcQDc41CEb10X1ajZwurj3Qx+pb3Xt2W4WNoRt3Oizvz/2Nh5R3FltN4m8cf VAugI8VG6Mnz21u0fvPdMdn5Hc8KNBaPjfZgiU496TU06/qK29I39vN8SRYhfBROalEAqa bRAC/dBTNiCWx85PrnNaBr6nLUZ/VpE= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 07/12] drm/bridge: cdns-dsi: Wait for Clk and Data Lanes to be ready Date: Tue, 14 Jan 2025 11:26:21 +0530 Message-Id: <20250114055626.18816-8-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Once the DSI Link and DSI Phy are initialized, the code needs to wait for Clk and Data Lanes to be ready, before continuing configuration. This is in accordance with the DSI Start-up procedure, found in the Technical Reference Manual of Texas Instrument's J721E SoC[0] which houses this DSI TX controller. If the previous bridge (or crtc/encoder) are configured pre-maturely, the input signal FIFO gets corrupt. This introduces a color-shift on the display. Allow the driver to wait for the clk and data lanes to get ready during DSI enable. [0]: See section 12.6.5.7.3 "Start-up Procedure" in J721E SoC TRM TRM Link: http://www.ti.com/lit/pdf/spruil1 Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver") Tested-by: Dominik Haller Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index b278e424b4b5..713003e6c210 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -769,7 +769,7 @@ static void cdns_dsi_bridge_enable(struct drm_bridge *b= ridge) struct phy_configure_opts_mipi_dphy *phy_cfg =3D &output->phy_opts.mipi_d= phy; unsigned long tx_byte_period; struct cdns_dsi_cfg dsi_cfg; - u32 tmp, reg_wakeup, div; + u32 tmp, reg_wakeup, div, status; int nlanes; =20 if (WARN_ON(pm_runtime_get_sync(dsi->base.dev) < 0)) @@ -786,6 +786,19 @@ static void cdns_dsi_bridge_enable(struct drm_bridge *= bridge) cdns_dsi_init_link(dsi); cdns_dsi_hs_init(dsi); =20 + /* + * Now that the DSI Link and DSI Phy are initialized, + * wait for the CLK and Data Lanes to be ready. + */ + tmp =3D CLK_LANE_RDY; + for (int i =3D 0; i < nlanes; i++) + tmp |=3D DATA_LANE_RDY(i); + + if (readl_poll_timeout(dsi->regs + MCTL_MAIN_STS, status, + (tmp =3D=3D (status & tmp)), 100, 500000)) + dev_err(dsi->base.dev, + "Timed Out: DSI-DPhy Clock and Data Lanes not ready.\n"); + writel(HBP_LEN(dsi_cfg.hbp) | HSA_LEN(dsi_cfg.hsa), dsi->regs + VID_HSIZE1); writel(HFP_LEN(dsi_cfg.hfp) | HACT_LEN(dsi_cfg.hact), --=20 2.34.1 From nobody Thu Dec 18 10:36:18 2025 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 A9E2C23499F for ; Tue, 14 Jan 2025 05:57:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834262; cv=none; b=rTBnXWpj11YnNNALzuYJMKow5+eCQlAFUAeLXfuaRl++3j6+mlxBwkh3yIpi7eflmlX4CNlVw+mxnMdoHHWqj/ecTpO4evkvEHs03ALv3xRj8fEv6AHJ1OYYKhyQAwU0c3+5vjvC3NU0bPmbCh+t5EFXSpd5cv+jDyqYWWlD7Po= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736834262; c=relaxed/simple; bh=TzzvmyZr6inHri4Kx8qN0rk8PqsshAgOnei6iJkGU0s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GavdyIWbbj1LhDgks/ju03NtiTZ4WBdgcLRcvYdDphEeQXl0cgabuGGnYLbJL41KUmsinxJvkEMHq858dnYn0cJumLHkrra/eFEewvc5dy6W0R0d0OkG/DXkTXnFbKviFPTFnJ7SF1EQAsUk50iZdgCvCHxN0jRMLD9oOf/js9I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=pB+BaucK; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="pB+BaucK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736834253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4WYLOQhw/RKMm5QY26fFHeUV0OebPBM++WNDwYTSgLM=; b=pB+BaucKg/UVHOuaxro69yzy3ssqvsb8Jp0ih+nrnbKtLQKoyXg2EYhYnAJBk76/BMNvnm 74R67HpKDgKmbp399ksBAD74OaSzhzG+gCXAOKVtmDpeK3lQ71Y41WtnpN+mnlWlJTXthl 8KyRY39LjRPBTThX8UKqjhftBBdktH4= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v7 08/12] drm/mipi-dsi: Add helper to find input format Date: Tue, 14 Jan 2025 11:26:22 +0530 Message-Id: <20250114055626.18816-9-aradhya.bhatia@linux.dev> In-Reply-To: <20250114055626.18816-1-aradhya.bhatia@linux.dev> References: <20250114055626.18816-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Add a helper API that can be used by the DSI hosts to find the required input bus format for the given output dsi pixel format. Reviewed-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/drm_mipi_dsi.c | 37 ++++++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 38 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 5e5c5f84daac..076826f2445a 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -36,6 +36,8 @@ #include #include =20 +#include + #include