* [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes
@ 2026-08-03 14:56 Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Esben Haabendal @ 2026-08-03 14:56 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Esben Haabendal, dri-devel, linux-kernel, Robert Chiras,
Laurentiu Palcu, Oliver F. Brown
This series brings a few patches fixing horizontal sync timing, EOTP packet
behavior and hsync/vsync polarity selection when using DCSS endpoint, as
well as a small fix to properly handle if/when nwl_dsi_mode_set() fails.
The 2nd commit ("Correct auto-insert EOTP behavior") is taken directly from
NXP vendor tree, so I have kept Author unchanged, although I have modified
the commit message. Let me know if I should change Author for that.
Signed-off-by: Esben Haabendal <esben@geanix.com>
---
Changes in v2:
- Added safeguard against small horizontal sync timings, protecting against
division by zero and integer underflow.
- Added error handling of nwl_dsi_mode_set() call.
- Link to v1: https://patch.msgid.link/20260710-nwl-dsi-fixes-v1-0-927d918a86ad@geanix.com
To: Andrzej Hajda <andrzej.hajda@intel.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Robert Foss <rfoss@kernel.org>
To: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
To: Jonas Karlman <jonas@kwiboo.se>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
---
Esben Haabendal (3):
drm/bridge: nwl-dsi: Limit LCDIF specific sync override
drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing
drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set()
Robert Chiras (1):
drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior
drivers/gpu/drm/bridge/nwl-dsi.c | 95 ++++++++++++++++++++++++++++++++++------
1 file changed, 81 insertions(+), 14 deletions(-)
---
base-commit: 075b74841bd0065a3bda3440873c747938e69b68
change-id: 20260710-nwl-dsi-fixes-c148b0adb685
Best regards,
--
Esben Haabendal <esben@geanix.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
@ 2026-08-03 14:56 ` Esben Haabendal
2026-08-05 8:36 ` Luca Ceresoli
2026-08-03 14:56 ` [PATCH v2 2/4] drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior Esben Haabendal
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Esben Haabendal @ 2026-08-03 14:56 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Esben Haabendal, dri-devel, linux-kernel
When using DCSS with NWL, overriding the mode flags to enforce active high
sync is preventing the use of active low with downstream bridges, such as
ti-sn65dsi83, which will not see such mode flags set by the panel.
Signed-off-by: Esben Haabendal <esben@geanix.com>
---
drivers/gpu/drm/bridge/nwl-dsi.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 3c9ae93c4f67..915e1bdc73c8 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -110,6 +110,8 @@ struct nwl_dsi {
int error;
struct nwl_dsi_transfer *xfer;
+
+ unsigned int endpoint;
};
static const struct regmap_config nwl_dsi_regmap_config = {
@@ -821,10 +823,13 @@ static int nwl_dsi_bridge_atomic_check(struct drm_bridge *bridge,
struct drm_connector_state *conn_state)
{
struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
+ struct nwl_dsi *dsi = bridge_to_dsi(bridge);
/* At least LCDIF + NWL needs active high sync */
- adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
- adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
+ if (dsi->endpoint == NWL_DSI_ENDPOINT_LCDIF) {
+ adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
+ adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
+ }
/*
* Do a full modeset if crtc_state->active is changed to be true.
@@ -1088,13 +1093,12 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi)
static int nwl_dsi_select_input(struct nwl_dsi *dsi)
{
struct device_node *remote;
- u32 use_dcss = 1;
int ret;
remote = of_graph_get_remote_node(dsi->dev->of_node, 0,
NWL_DSI_ENDPOINT_LCDIF);
if (remote) {
- use_dcss = 0;
+ dsi->endpoint = NWL_DSI_ENDPOINT_LCDIF;
} else {
remote = of_graph_get_remote_node(dsi->dev->of_node, 0,
NWL_DSI_ENDPOINT_DCSS);
@@ -1103,11 +1107,12 @@ static int nwl_dsi_select_input(struct nwl_dsi *dsi)
"No valid input endpoint found\n");
return -EINVAL;
}
+ dsi->endpoint = NWL_DSI_ENDPOINT_DCSS;
}
DRM_DEV_INFO(dsi->dev, "Using %s as input source\n",
- (use_dcss) ? "DCSS" : "LCDIF");
- ret = mux_control_try_select(dsi->mux, use_dcss);
+ (dsi->endpoint == NWL_DSI_ENDPOINT_DCSS) ? "DCSS" : "LCDIF");
+ ret = mux_control_try_select(dsi->mux, dsi->endpoint == NWL_DSI_ENDPOINT_DCSS);
if (ret < 0)
DRM_DEV_ERROR(dsi->dev, "Failed to select input: %d\n", ret);
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/4] drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
@ 2026-08-03 14:56 ` Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() Esben Haabendal
3 siblings, 0 replies; 9+ messages in thread
From: Esben Haabendal @ 2026-08-03 14:56 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Esben Haabendal, dri-devel, linux-kernel, Robert Chiras,
Laurentiu Palcu
From: Robert Chiras <robert.chiras@nxp.com>
In order to respect the DSI protocol, make sure that auto-insert EOTP is
enabled according to the NO_EOT_PACKET flag instead of the
CLOCK_NON_CONTINUOUS flag.
Signed-off-by: Esben Haabendal <esben@geanix.com>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
---
drivers/gpu/drm/bridge/nwl-dsi.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 915e1bdc73c8..c9af6a3d47e1 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -222,13 +222,15 @@ static int nwl_dsi_config_host(struct nwl_dsi *dsi)
DRM_DEV_DEBUG_DRIVER(dsi->dev, "DSI Lanes %d\n", dsi->lanes);
nwl_dsi_write(dsi, NWL_DSI_CFG_NUM_LANES, dsi->lanes - 1);
- if (dsi->dsi_mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) {
+ if (dsi->dsi_mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)
nwl_dsi_write(dsi, NWL_DSI_CFG_NONCONTINUOUS_CLK, 0x01);
- nwl_dsi_write(dsi, NWL_DSI_CFG_AUTOINSERT_EOTP, 0x01);
- } else {
+ else
nwl_dsi_write(dsi, NWL_DSI_CFG_NONCONTINUOUS_CLK, 0x00);
+
+ if (dsi->dsi_mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)
nwl_dsi_write(dsi, NWL_DSI_CFG_AUTOINSERT_EOTP, 0x00);
- }
+ else
+ nwl_dsi_write(dsi, NWL_DSI_CFG_AUTOINSERT_EOTP, 0x01);
/* values in byte clock cycles */
cycles = ui2bc(cfg->clk_pre);
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 2/4] drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior Esben Haabendal
@ 2026-08-03 14:56 ` Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() Esben Haabendal
3 siblings, 0 replies; 9+ messages in thread
From: Esben Haabendal @ 2026-08-03 14:56 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Esben Haabendal, dri-devel, linux-kernel, Robert Chiras,
Oliver F. Brown
The NWL MIPI Host controller registers specifies the horizontal front
porch, sync pulse, and back porch in DSI packet payload size in bytes (ie.
not in pixel clocks).
The calculation for this is (mostly) described in section 13.6.3.5.1.2 of
the i.MX 8M Dual/8M QuadLite/8M Quad Applications Processors Reference
Manual (rev. 3.1). The formula shown there does not take packet header size
into account though.
The formula implemented here converts the hfp, hsa, and hbp to DSI packet
bytes and then subtracts the number of packet header bytes.
It is worth noting that these values only needs to match approximately,
according to the reference manual.
Based on commit in NXP vendor tree
commit f2a61699749d ("LF-7981-4: drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing")
Signed-off-by: Esben Haabendal <esben@geanix.com>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: Oliver F. Brown <oliver.brown@oss.nxp.com>
---
drivers/gpu/drm/bridge/nwl-dsi.c | 64 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 61 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index c9af6a3d47e1..226036d22e3f 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -22,6 +22,7 @@
#include <linux/reset.h>
#include <linux/sys_soc.h>
#include <linux/time64.h>
+#include <linux/math64.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_bridge.h>
@@ -264,6 +265,10 @@ static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
bool burst_mode;
int hfront_porch, hback_porch, vfront_porch, vback_porch;
int hsync_len, vsync_len;
+ int hfp, hbp, hsa;
+ unsigned long long pclk_period;
+ unsigned long long hs_period;
+ int h_blank, pkt_hdr_len, pkt_len;
hfront_porch = dsi->mode.hsync_start - dsi->mode.hdisplay;
hsync_len = dsi->mode.hsync_end - dsi->mode.hsync_start;
@@ -317,9 +322,62 @@ static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
dsi->mode.hdisplay);
}
- nwl_dsi_write(dsi, NWL_DSI_HFP, hfront_porch);
- nwl_dsi_write(dsi, NWL_DSI_HBP, hback_porch);
- nwl_dsi_write(dsi, NWL_DSI_HSA, hsync_len);
+ pclk_period = DIV_ROUND_UP_ULL(PSEC_PER_SEC, dsi->mode.clock * 1000);
+ DRM_DEV_DEBUG_DRIVER(dsi->dev, "pclk_period: %llu\n", pclk_period);
+
+ hs_period = DIV_ROUND_UP_ULL(PSEC_PER_SEC, dsi->phy_cfg.mipi_dphy.hs_clk_rate);
+ DRM_DEV_DEBUG_DRIVER(dsi->dev, "hs_period: %llu\n", hs_period);
+
+ /*
+ * Calculate the bytes needed, according to the RM formula:
+ * Time of DPI event = time to transmit x number of bytes on the DSI
+ * interface
+ * dpi_event_size * dpi_pclk_period = dsi_bytes * 8 * hs_bit_period /
+ * num_lanes
+ * ===>
+ * dsi_bytes = dpi_event_size * dpi_pclk_period * num_lanes /
+ * (8 * hs_bit_period)
+ */
+ hfp = hfront_porch * pclk_period * dsi->lanes / (8 * hs_period);
+ hbp = hback_porch * pclk_period * dsi->lanes / (8 * hs_period);
+ hsa = hsync_len * pclk_period * dsi->lanes / (8 * hs_period);
+
+ /* Make sure horizontal blankins are even numbers */
+ hfp = roundup(hfp, 2);
+ hbp = roundup(hbp, 2);
+ hsa = roundup(hsa, 2);
+
+ /*
+ * We need to subtract the packet header length: 32
+ * In order to make sure we don't get negative values,
+ * subtract a proportional value to the total length of the
+ * horizontal blanking duration.
+ */
+ h_blank = hfp + hbp + hsa;
+
+ if (h_blank) {
+ pkt_len = min(hfp, roundup(((hfp * 100 / h_blank) * 32) / 100, 2));
+ pkt_hdr_len = pkt_len;
+ hfp -= pkt_len;
+
+ pkt_len = min(hbp, roundup(((hbp * 100 / h_blank) * 32) / 100, 2));
+ pkt_hdr_len += pkt_len;
+ hbp -= pkt_len;
+
+ pkt_len = min(hsa, 32 - pkt_hdr_len);
+ pkt_hdr_len += pkt_len;
+ hsa -= pkt_len;
+ if (pkt_hdr_len != 32)
+ dev_warn(dsi->dev,
+ "Unable to subtract packet header length fully: %d left\n",
+ 32 - pkt_hdr_len);
+ }
+
+ DRM_DEV_DEBUG_DRIVER(dsi->dev, "Register values: hfp=%d hbp=%d hsa=%d\n", hfp, hbp, hsa);
+
+ nwl_dsi_write(dsi, NWL_DSI_HFP, hfp);
+ nwl_dsi_write(dsi, NWL_DSI_HBP, hbp);
+ nwl_dsi_write(dsi, NWL_DSI_HSA, hsa);
nwl_dsi_write(dsi, NWL_DSI_ENABLE_MULT_PKTS, 0x0);
nwl_dsi_write(dsi, NWL_DSI_BLLP_MODE, 0x1);
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set()
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
` (2 preceding siblings ...)
2026-08-03 14:56 ` [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing Esben Haabendal
@ 2026-08-03 14:56 ` Esben Haabendal
2026-08-05 8:36 ` Luca Ceresoli
3 siblings, 1 reply; 9+ messages in thread
From: Esben Haabendal @ 2026-08-03 14:56 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Esben Haabendal, dri-devel, linux-kernel
There does not seem to be any good reasons for ignoring the return value of
the nwl_dsi_mode_set() function.
Signed-off-by: Esben Haabendal <esben@geanix.com>
---
drivers/gpu/drm/bridge/nwl-dsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 226036d22e3f..08e87d166b17 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -942,7 +942,9 @@ nwl_dsi_bridge_mode_set(struct drm_bridge *bridge,
}
/* Step 2 from DSI reset-out instructions */
- nwl_dsi_mode_set(dsi);
+ ret = nwl_dsi_mode_set(dsi);
+ if (ret < 0)
+ goto runtime_put;
/* Step 3 from DSI reset-out instructions */
ret = reset_control_deassert(dsi->rst_esc);
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
@ 2026-08-05 8:36 ` Luca Ceresoli
2026-08-05 12:56 ` Esben Haabendal
0 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2026-08-05 8:36 UTC (permalink / raw)
To: Esben Haabendal
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
dri-devel, linux-kernel
On Mon, 03 Aug 2026 16:56:19 +0200, Esben Haabendal <esben@geanix.com> wrote:
Hi Esben,
> When using DCSS with NWL, overriding the mode flags to enforce active high
> sync is preventing the use of active low with downstream bridges, such as
> ti-sn65dsi83, which will not see such mode flags set by the panel.
>
> Signed-off-by: Esben Haabendal <esben@geanix.com>
Is this a fix? If so, it should have Fixes: + Cc: stable.
>
>
> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index 09992529f3d8..0fb10b686d1f 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -821,10 +823,13 @@ static int nwl_dsi_bridge_atomic_check(struct drm_bridge *bridge,
> struct drm_connector_state *conn_state)
> {
> struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
> + struct nwl_dsi *dsi = bridge_to_dsi(bridge);
>
> /* At least LCDIF + NWL needs active high sync */
> - adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
> - adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
> + if (dsi->endpoint == NWL_DSI_ENDPOINT_LCDIF) {
> + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
> + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
> + }
In some sense, this patch is doing two things. One is the hunk above, doing
what the commit message says...
> @@ -1103,11 +1107,12 @@ static int nwl_dsi_select_input(struct nwl_dsi *dsi)
> "No valid input endpoint found\n");
> return -EINVAL;
> }
> + dsi->endpoint = NWL_DSI_ENDPOINT_DCSS;
> }
...and this is a somewhat orthogonal change, changing the way the endpoint
selection is stored: either as a bool (false = LCDIF, true = DCSS) or as an
index (0 = LCDIF, 1 = DCSS). No problem with this change, I think it makes
code more readable. Just I'd rather keep it as a separate cleanup patch.
>
> DRM_DEV_INFO(dsi->dev, "Using %s as input source\n",
> - (use_dcss) ? "DCSS" : "LCDIF");
> - ret = mux_control_try_select(dsi->mux, use_dcss);
> + (dsi->endpoint == NWL_DSI_ENDPOINT_DCSS) ? "DCSS" : "LCDIF");
> + ret = mux_control_try_select(dsi->mux, dsi->endpoint == NWL_DSI_ENDPOINT_DCSS);
The code here is not formally correct. mux_control_try_select() takes a
state argument, which is an integer, but you are passing a bool. It would
still work just because bools are mapped to 0/1. Looks like should simply
become:
ret = mux_control_try_select(dsi->mux, dsi->endpoint);
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set()
2026-08-03 14:56 ` [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() Esben Haabendal
@ 2026-08-05 8:36 ` Luca Ceresoli
2026-08-05 12:58 ` Esben Haabendal
0 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2026-08-05 8:36 UTC (permalink / raw)
To: Esben Haabendal
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
dri-devel, linux-kernel
On Mon, 03 Aug 2026 16:56:22 +0200, Esben Haabendal <esben@geanix.com> wrote:
> There does not seem to be any good reasons for ignoring the return value of
> the nwl_dsi_mode_set() function.
>
> Signed-off-by: Esben Haabendal <esben@geanix.com>
Here too, if it's a fix it needs Fixes: + Cc: stable.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override
2026-08-05 8:36 ` Luca Ceresoli
@ 2026-08-05 12:56 ` Esben Haabendal
0 siblings, 0 replies; 9+ messages in thread
From: Esben Haabendal @ 2026-08-05 12:56 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
linux-kernel
"Luca Ceresoli" <luca.ceresoli@bootlin.com> writes:
> On Mon, 03 Aug 2026 16:56:19 +0200, Esben Haabendal <esben@geanix.com> wrote:
>
> Hi Esben,
>
>> When using DCSS with NWL, overriding the mode flags to enforce active high
>> sync is preventing the use of active low with downstream bridges, such as
>> ti-sn65dsi83, which will not see such mode flags set by the panel.
>>
>> Signed-off-by: Esben Haabendal <esben@geanix.com>
>
> Is this a fix? If so, it should have Fixes: + Cc: stable.
Yes. I will add tags.
>> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
>> index 09992529f3d8..0fb10b686d1f 100644
>> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
>> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
>> @@ -821,10 +823,13 @@ static int nwl_dsi_bridge_atomic_check(struct drm_bridge *bridge,
>> struct drm_connector_state *conn_state)
>> {
>> struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
>> + struct nwl_dsi *dsi = bridge_to_dsi(bridge);
>>
>> /* At least LCDIF + NWL needs active high sync */
>> - adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
>> - adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
>> + if (dsi->endpoint == NWL_DSI_ENDPOINT_LCDIF) {
>> + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
>> + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
>> + }
>
> In some sense, this patch is doing two things. One is the hunk above, doing
> what the commit message says...
>
>> @@ -1103,11 +1107,12 @@ static int nwl_dsi_select_input(struct nwl_dsi *dsi)
>> "No valid input endpoint found\n");
>> return -EINVAL;
>> }
>> + dsi->endpoint = NWL_DSI_ENDPOINT_DCSS;
>> }
>
> ...and this is a somewhat orthogonal change, changing the way the endpoint
> selection is stored: either as a bool (false = LCDIF, true = DCSS) or as an
> index (0 = LCDIF, 1 = DCSS). No problem with this change, I think it makes
> code more readable. Just I'd rather keep it as a separate cleanup
> patch.
I will split it into two patches.
>> DRM_DEV_INFO(dsi->dev, "Using %s as input source\n",
>> - (use_dcss) ? "DCSS" : "LCDIF");
>> - ret = mux_control_try_select(dsi->mux, use_dcss);
>> + (dsi->endpoint == NWL_DSI_ENDPOINT_DCSS) ? "DCSS" : "LCDIF");
>> + ret = mux_control_try_select(dsi->mux, dsi->endpoint == NWL_DSI_ENDPOINT_DCSS);
>
> The code here is not formally correct. mux_control_try_select() takes a
> state argument, which is an integer, but you are passing a bool. It would
> still work just because bools are mapped to 0/1. Looks like should simply
> become:
>
> ret = mux_control_try_select(dsi->mux, dsi->endpoint);
Fixing, thanks.
/Esben
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set()
2026-08-05 8:36 ` Luca Ceresoli
@ 2026-08-05 12:58 ` Esben Haabendal
0 siblings, 0 replies; 9+ messages in thread
From: Esben Haabendal @ 2026-08-05 12:58 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
linux-kernel
"Luca Ceresoli" <luca.ceresoli@bootlin.com> writes:
> On Mon, 03 Aug 2026 16:56:22 +0200, Esben Haabendal <esben@geanix.com> wrote:
>> There does not seem to be any good reasons for ignoring the return value of
>> the nwl_dsi_mode_set() function.
>>
>> Signed-off-by: Esben Haabendal <esben@geanix.com>
>
> Here too, if it's a fix it needs Fixes: + Cc: stable.
Added for v3.
/Esben
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-08-05 12:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
2026-08-05 8:36 ` Luca Ceresoli
2026-08-05 12:56 ` Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 2/4] drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() Esben Haabendal
2026-08-05 8:36 ` Luca Ceresoli
2026-08-05 12:58 ` Esben Haabendal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).