aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--queue-5.4/drm-bridge-cdns-dsi-check-return-value-when-getting-default-phy-config.patch43
-rw-r--r--queue-5.4/drm-bridge-cdns-dsi-fix-connecting-to-next-bridge.patch47
-rw-r--r--queue-5.4/drm-bridge-cdns-dsi-fix-the-clock-variable-for-mode_valid.patch55
-rw-r--r--queue-5.4/series3
4 files changed, 148 insertions, 0 deletions
diff --git a/queue-5.4/drm-bridge-cdns-dsi-check-return-value-when-getting-default-phy-config.patch b/queue-5.4/drm-bridge-cdns-dsi-check-return-value-when-getting-default-phy-config.patch
new file mode 100644
index 0000000000..04bc0d2150
--- /dev/null
+++ b/queue-5.4/drm-bridge-cdns-dsi-check-return-value-when-getting-default-phy-config.patch
@@ -0,0 +1,43 @@
+From c6a7ef0d4856b9629df390e9935d7fd67fe39f81 Mon Sep 17 00:00:00 2001
+From: Aradhya Bhatia <a-bhatia1@ti.com>
+Date: Sat, 29 Mar 2025 17:09:15 +0530
+Subject: drm/bridge: cdns-dsi: Check return value when getting default PHY config
+
+From: Aradhya Bhatia <a-bhatia1@ti.com>
+
+commit c6a7ef0d4856b9629df390e9935d7fd67fe39f81 upstream.
+
+Check for the return value of the phy_mipi_dphy_get_default_config()
+call, and in case of an error, return back the same.
+
+Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework")
+Cc: stable@vger.kernel.org
+Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
+Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
+Link: https://lore.kernel.org/r/20250329113925.68204-5-aradhya.bhatia@linux.dev
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/bridge/cdns-dsi.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/bridge/cdns-dsi.c
++++ b/drivers/gpu/drm/bridge/cdns-dsi.c
+@@ -616,9 +616,11 @@ static int cdns_dsi_check_conf(struct cd
+ if (ret)
+ return ret;
+
+- phy_mipi_dphy_get_default_config(mode_clock * 1000,
+- mipi_dsi_pixel_format_to_bpp(output->dev->format),
+- nlanes, phy_cfg);
++ ret = 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;
+
+ ret = cdns_dsi_adjust_phy_config(dsi, dsi_cfg, phy_cfg, mode, mode_valid_check);
+ if (ret)
diff --git a/queue-5.4/drm-bridge-cdns-dsi-fix-connecting-to-next-bridge.patch b/queue-5.4/drm-bridge-cdns-dsi-fix-connecting-to-next-bridge.patch
new file mode 100644
index 0000000000..dd4976f4f5
--- /dev/null
+++ b/queue-5.4/drm-bridge-cdns-dsi-fix-connecting-to-next-bridge.patch
@@ -0,0 +1,47 @@
+From 688eb4d465484bc2a3471a6a6f06f833b58c7867 Mon Sep 17 00:00:00 2001
+From: Aradhya Bhatia <a-bhatia1@ti.com>
+Date: Sat, 29 Mar 2025 17:09:12 +0530
+Subject: drm/bridge: cdns-dsi: Fix connecting to next bridge
+
+From: Aradhya Bhatia <a-bhatia1@ti.com>
+
+commit 688eb4d465484bc2a3471a6a6f06f833b58c7867 upstream.
+
+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")
+Cc: stable@vger.kernel.org
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
+Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
+Link: https://lore.kernel.org/r/20250329113925.68204-2-aradhya.bhatia@linux.dev
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/bridge/cdns-dsi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/bridge/cdns-dsi.c
++++ b/drivers/gpu/drm/bridge/cdns-dsi.c
+@@ -959,7 +959,7 @@ static int cdns_dsi_attach(struct mipi_d
+ if (!IS_ERR(panel)) {
+ bridge = drm_panel_bridge_add(panel, DRM_MODE_CONNECTOR_DSI);
+ } else {
+- bridge = of_drm_find_bridge(dev->dev.of_node);
++ bridge = of_drm_find_bridge(np);
+ if (!bridge)
+ bridge = ERR_PTR(-EINVAL);
+ }
diff --git a/queue-5.4/drm-bridge-cdns-dsi-fix-the-clock-variable-for-mode_valid.patch b/queue-5.4/drm-bridge-cdns-dsi-fix-the-clock-variable-for-mode_valid.patch
new file mode 100644
index 0000000000..f232604cd4
--- /dev/null
+++ b/queue-5.4/drm-bridge-cdns-dsi-fix-the-clock-variable-for-mode_valid.patch
@@ -0,0 +1,55 @@
+From 132bdcec399be6ae947582249a134b38cf56731c Mon Sep 17 00:00:00 2001
+From: Aradhya Bhatia <a-bhatia1@ti.com>
+Date: Sat, 29 Mar 2025 17:09:14 +0530
+Subject: drm/bridge: cdns-dsi: Fix the clock variable for mode_valid()
+
+From: Aradhya Bhatia <a-bhatia1@ti.com>
+
+commit 132bdcec399be6ae947582249a134b38cf56731c upstream.
+
+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")
+Cc: stable@vger.kernel.org
+Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
+Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
+Link: https://lore.kernel.org/r/20250329113925.68204-4-aradhya.bhatia@linux.dev
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/bridge/cdns-dsi.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/bridge/cdns-dsi.c
++++ b/drivers/gpu/drm/bridge/cdns-dsi.c
+@@ -609,13 +609,14 @@ static int cdns_dsi_check_conf(struct cd
+ struct phy_configure_opts_mipi_dphy *phy_cfg = &output->phy_opts.mipi_dphy;
+ unsigned long dsi_hss_hsa_hse_hbp;
+ unsigned int nlanes = output->dev->lanes;
++ int mode_clock = (mode_valid_check ? mode->clock : mode->crtc_clock);
+ int ret;
+
+ ret = cdns_dsi_mode2cfg(dsi, mode, dsi_cfg, mode_valid_check);
+ if (ret)
+ return ret;
+
+- 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);
+
diff --git a/queue-5.4/series b/queue-5.4/series
index 4f532d0e8a..971e150827 100644
--- a/queue-5.4/series
+++ b/queue-5.4/series
@@ -54,3 +54,6 @@ hid-wacom-fix-memory-leak-on-kobject-creation-failure.patch
hid-wacom-fix-memory-leak-on-sysfs-attribute-creation-failure.patch
hid-wacom-fix-kobject-reference-count-leak.patch
drm-tegra-assign-plane-type-before-registration.patch
+drm-bridge-cdns-dsi-fix-the-clock-variable-for-mode_valid.patch
+drm-bridge-cdns-dsi-fix-connecting-to-next-bridge.patch
+drm-bridge-cdns-dsi-check-return-value-when-getting-default-phy-config.patch