* [PATCH v2 0/4] drm: mxsfb: Support LCDIF interface bus width
@ 2026-07-23 9:38 Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property Francesco Dolcini
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 9:38 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein
Cc: Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
From: Francesco Dolcini <francesco.dolcini@toradex.com>
The width of the physical LCDIF output bus can differ from the input bus
format advertised by the downstream panel or bridge.
Such a distinction is required when the LCDIF bus width does not match the
width of the downstream display interface. For example, an 18-bit or
16-bit LCDIF bus can drive a 24-bit display by wiring the available color
bits to the appropriate display inputs. Configuring LCDIF solely from the
display's 24-bit format in this case selects the wrong LCD_DATABUS_WIDTH
mode, changing the color-bit assignment on the LCD_DATA pins and resulting
in incorrect colors.
Use the common OF graph endpoint bus-width property to describe the width
of the physical LCDIF output bus. Make the mxsfb driver derive the
corresponding media bus format from this property and use it in preference
to the format reported by the downstream display. When the property is
absent, the existing behavior is preserved.
Set the endpoint bus width for the Colibri iMX6ULL and Colibri iMX7 boards,
which route an 18-bit LCD interface.
v2: use the common bus-width property instead of the legacy interface-pix-fmt
v1: https://lore.kernel.org/all/20260717121847.488148-1-francesco@dolcini.it/
Francesco Dolcini (4):
dt-bindings: lcdif: Add endpoint bus-width property
drm: mxsfb: Add optional DPI output bus-width configuration
ARM: dts: imx6ull-colibri: Set LCDIF bus-width
ARM: dts: imx7-colibri: Set LCDIF bus-width
.../bindings/display/fsl,lcdif.yaml | 9 +++++++
.../arm/boot/dts/nxp/imx/imx6ull-colibri.dtsi | 1 +
arch/arm/boot/dts/nxp/imx/imx7-colibri.dtsi | 1 +
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 24 +++++++++++++++++++
drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++
drivers/gpu/drm/mxsfb/mxsfb_kms.c | 12 ++++++++++
6 files changed, 49 insertions(+)
--
2.47.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property
2026-07-23 9:38 [PATCH v2 0/4] drm: mxsfb: Support LCDIF interface bus width Francesco Dolcini
@ 2026-07-23 9:38 ` Francesco Dolcini
2026-07-23 9:52 ` sashiko-bot
2026-07-23 15:45 ` Frank Li
2026-07-23 9:38 ` [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration Francesco Dolcini
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 9:38 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein
Cc: Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
From: Francesco Dolcini <francesco.dolcini@toradex.com>
The DPI output of the LCD interface can be configured with a bus width
of 16, 18, or 24 bits. Introduce a bus-width property to the output
endpoint, specifying the number of parallel RGB bits connected.
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: use the common bus-width property instead of the legacy interface-pix-fmt
---
Documentation/devicetree/bindings/display/fsl,lcdif.yaml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
index 2dd0411ec651..6931f0ae3829 100644
--- a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
+++ b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
@@ -71,6 +71,15 @@ properties:
$ref: /schemas/graph.yaml#/properties/port
description: The LCDIF output port
+ properties:
+ endpoint:
+ $ref: /schemas/graph.yaml#/$defs/endpoint-base
+ unevaluatedProperties: false
+
+ properties:
+ bus-width:
+ enum: [ 16, 18, 24 ]
+
display:
$ref: /schemas/types.yaml#/definitions/phandle
description: phandle to display panel
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration
2026-07-23 9:38 [PATCH v2 0/4] drm: mxsfb: Support LCDIF interface bus width Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property Francesco Dolcini
@ 2026-07-23 9:38 ` Francesco Dolcini
2026-07-23 9:48 ` Marco Felsch
2026-07-23 15:47 ` Frank Li
2026-07-23 9:38 ` [PATCH v2 3/4] ARM: dts: imx6ull-colibri: Set LCDIF bus-width Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 4/4] ARM: dts: imx7-colibri: " Francesco Dolcini
3 siblings, 2 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 9:38 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein
Cc: Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
From: Francesco Dolcini <francesco.dolcini@toradex.com>
LCDIF programs LCD_DATABUS_WIDTH from the selected media bus format. The
format reported by the downstream panel or bridge describes the display
input, but it does not describe how the LCDIF data pins are physically
wired on the board.
These can differ. For example, a 16-bit LCDIF bus can be connected to a
24-bit display by wiring the available color bits to the corresponding
display inputs. In that case, using the display's 24-bit format to
configure LCDIF selects the wrong data-bus mode and changes the assignment
of color bits on the LCD_DATA pins.
Read the optional bus-width endpoint property from the LCDIF output port
and use it to select the media bus format used to configure LCDIF. This
allows the LCDIF bus mode to describe the physical interface
independently of the downstream display format.
When the optional property is absent, continue using the format reported
by the downstream display device, preserving the existing behavior.
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: use the common bus-width property instead of the legacy interface-pix-fmt
---
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 24 ++++++++++++++++++++++++
drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++
drivers/gpu/drm/mxsfb/mxsfb_kms.c | 12 ++++++++++++
3 files changed, 38 insertions(+)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 9b8fbda85d28..0545718a4b65 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -12,7 +12,10 @@
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
+#include <linux/media-bus-format.h>
#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/pm_runtime.h>
@@ -209,7 +212,10 @@ static int mxsfb_load(struct drm_device *drm,
const struct mxsfb_devdata *devdata)
{
struct platform_device *pdev = to_platform_device(drm->dev);
+ struct device_node *np = pdev->dev.of_node;
struct mxsfb_drm_private *mxsfb;
+ struct device_node *ep;
+ u32 bus_width = 0;
int ret;
mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
@@ -236,6 +242,24 @@ static int mxsfb_load(struct drm_device *drm,
if (IS_ERR(mxsfb->clk_disp_axi))
mxsfb->clk_disp_axi = NULL;
+ ep = of_graph_get_next_endpoint(np, NULL);
+ if (ep) {
+ of_property_read_u32(ep, "bus-width", &bus_width);
+ of_node_put(ep);
+ }
+
+ switch (bus_width) {
+ case 16:
+ mxsfb->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
+ break;
+ case 18:
+ mxsfb->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
+ break;
+ case 24:
+ mxsfb->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+ break;
+ }
+
ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32));
if (ret)
return ret;
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.h b/drivers/gpu/drm/mxsfb/mxsfb_drv.h
index d160d921b25f..bdc47ce5be79 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.h
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.h
@@ -46,6 +46,8 @@ struct mxsfb_drm_private {
struct drm_connector *connector;
struct drm_bridge *bridge;
+ u32 bus_format;
+
bool crc_active;
};
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
index d8ebebc5314b..1d78c486d147 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
@@ -386,6 +386,18 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
if (!bus_format)
bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+ /*
+ * Prefer the bus format derived from the OF graph endpoint "bus-width"
+ * property when available. Otherwise, use the bus format reported by
+ * the downstream bridge or panel.
+ *
+ * This supports mismatched display and interface bus widths, such as
+ * a 24-bit panel connected through an 18-bit interface or an 18-bit
+ * panel connected through a 24-bit interface.
+ */
+ if (mxsfb->bus_format)
+ bus_format = mxsfb->bus_format;
+
mxsfb_crtc_mode_set_nofb(mxsfb, bridge_state, bus_format);
/* Write cur_buf as well to avoid an initial corrupt frame */
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/4] ARM: dts: imx6ull-colibri: Set LCDIF bus-width
2026-07-23 9:38 [PATCH v2 0/4] drm: mxsfb: Support LCDIF interface bus width Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration Francesco Dolcini
@ 2026-07-23 9:38 ` Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 4/4] ARM: dts: imx7-colibri: " Francesco Dolcini
3 siblings, 0 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 9:38 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein
Cc: Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
From: Francesco Dolcini <francesco.dolcini@toradex.com>
The lcd DPI interface on colibri imx6ull uses a 18-bit width bus, set
the bus-width property accordingly.
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: use the common bus-width property instead of the legacy interface-pix-fmt
---
arch/arm/boot/dts/nxp/imx/imx6ull-colibri.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/nxp/imx/imx6ull-colibri.dtsi b/arch/arm/boot/dts/nxp/imx/imx6ull-colibri.dtsi
index ec3c1e7301f4..1eb1cf2d7395 100644
--- a/arch/arm/boot/dts/nxp/imx/imx6ull-colibri.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx6ull-colibri.dtsi
@@ -229,6 +229,7 @@ &lcdif {
port {
lcdif_out: endpoint {
+ bus-width = <18>;
remote-endpoint = <&lcd_panel_in>;
};
};
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/4] ARM: dts: imx7-colibri: Set LCDIF bus-width
2026-07-23 9:38 [PATCH v2 0/4] drm: mxsfb: Support LCDIF interface bus width Francesco Dolcini
` (2 preceding siblings ...)
2026-07-23 9:38 ` [PATCH v2 3/4] ARM: dts: imx6ull-colibri: Set LCDIF bus-width Francesco Dolcini
@ 2026-07-23 9:38 ` Francesco Dolcini
3 siblings, 0 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 9:38 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein
Cc: Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
From: Francesco Dolcini <francesco.dolcini@toradex.com>
The lcd DPI interface on colibri imx7 uses a 18-bit width bus, set
the bus-width property accordingly.
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: use the common bus-width property instead of the legacy interface-pix-fmt
---
arch/arm/boot/dts/nxp/imx/imx7-colibri.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/nxp/imx/imx7-colibri.dtsi b/arch/arm/boot/dts/nxp/imx/imx7-colibri.dtsi
index 8666dcd7fe97..c4088d3c5ab1 100644
--- a/arch/arm/boot/dts/nxp/imx/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx7-colibri.dtsi
@@ -537,6 +537,7 @@ &lcdif {
port {
lcdif_out: endpoint {
+ bus-width = <18>;
remote-endpoint = <&lcd_panel_in>;
};
};
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration
2026-07-23 9:38 ` [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration Francesco Dolcini
@ 2026-07-23 9:48 ` Marco Felsch
2026-07-23 9:55 ` Francesco Dolcini
2026-07-23 15:47 ` Frank Li
1 sibling, 1 reply; 11+ messages in thread
From: Marco Felsch @ 2026-07-23 9:48 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein, imx,
devicetree, linux-kernel, dri-devel, Francesco Dolcini,
linux-arm-kernel
Hi Francesco,
On 26-07-23, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> LCDIF programs LCD_DATABUS_WIDTH from the selected media bus format. The
> format reported by the downstream panel or bridge describes the display
> input, but it does not describe how the LCDIF data pins are physically
> wired on the board.
>
> These can differ. For example, a 16-bit LCDIF bus can be connected to a
> 24-bit display by wiring the available color bits to the corresponding
> display inputs. In that case, using the display's 24-bit format to
> configure LCDIF selects the wrong data-bus mode and changes the assignment
> of color bits on the LCD_DATA pins.
>
> Read the optional bus-width endpoint property from the LCDIF output port
> and use it to select the media bus format used to configure LCDIF. This
> allows the LCDIF bus mode to describe the physical interface
> independently of the downstream display format.
>
> When the optional property is absent, continue using the format reported
> by the downstream display device, preserving the existing behavior.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2: use the common bus-width property instead of the legacy interface-pix-fmt
> ---
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 24 ++++++++++++++++++++++++
> drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 12 ++++++++++++
> 3 files changed, 38 insertions(+)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 9b8fbda85d28..0545718a4b65 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -12,7 +12,10 @@
> #include <linux/clk.h>
> #include <linux/dma-mapping.h>
> #include <linux/io.h>
> +#include <linux/media-bus-format.h>
> #include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_graph.h>
> #include <linux/platform_device.h>
> #include <linux/property.h>
> #include <linux/pm_runtime.h>
> @@ -209,7 +212,10 @@ static int mxsfb_load(struct drm_device *drm,
> const struct mxsfb_devdata *devdata)
> {
> struct platform_device *pdev = to_platform_device(drm->dev);
> + struct device_node *np = pdev->dev.of_node;
> struct mxsfb_drm_private *mxsfb;
> + struct device_node *ep;
> + u32 bus_width = 0;
With this beeing set to '0' and ...
> int ret;
>
> mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
> @@ -236,6 +242,24 @@ static int mxsfb_load(struct drm_device *drm,
> if (IS_ERR(mxsfb->clk_disp_axi))
> mxsfb->clk_disp_axi = NULL;
>
> + ep = of_graph_get_next_endpoint(np, NULL);
> + if (ep) {
> + of_property_read_u32(ep, "bus-width", &bus_width);
no bus-width property present, this ...
> + of_node_put(ep);
Furthermore please see
20260723-v6-18-topic-imx93-parallel-display-v13-1-ccf3f9bbc0fc@nxp.com
for a proper error handling.
> + }
> +
> + switch (bus_width) {
switch should fail. Therefore I would recommend to set the default to
24 (bit) aka no limitation.
Regards,
Marco
> + case 16:
> + mxsfb->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
> + break;
> + case 18:
> + mxsfb->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
> + break;
> + case 24:
> + mxsfb->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
> + break;
> + }
> +
> ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32));
> if (ret)
> return ret;
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.h b/drivers/gpu/drm/mxsfb/mxsfb_drv.h
> index d160d921b25f..bdc47ce5be79 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.h
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.h
> @@ -46,6 +46,8 @@ struct mxsfb_drm_private {
> struct drm_connector *connector;
> struct drm_bridge *bridge;
>
> + u32 bus_format;
> +
> bool crc_active;
> };
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
> index d8ebebc5314b..1d78c486d147 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
> @@ -386,6 +386,18 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
> if (!bus_format)
> bus_format = MEDIA_BUS_FMT_RGB888_1X24;
>
> + /*
> + * Prefer the bus format derived from the OF graph endpoint "bus-width"
> + * property when available. Otherwise, use the bus format reported by
> + * the downstream bridge or panel.
> + *
> + * This supports mismatched display and interface bus widths, such as
> + * a 24-bit panel connected through an 18-bit interface or an 18-bit
> + * panel connected through a 24-bit interface.
> + */
> + if (mxsfb->bus_format)
> + bus_format = mxsfb->bus_format;
> +
> mxsfb_crtc_mode_set_nofb(mxsfb, bridge_state, bus_format);
>
> /* Write cur_buf as well to avoid an initial corrupt frame */
> --
> 2.47.3
>
>
>
--
#gernperDu
#CallMeByMyFirstName
Pengutronix e.K. | |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property
2026-07-23 9:38 ` [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property Francesco Dolcini
@ 2026-07-23 9:52 ` sashiko-bot
2026-07-23 15:45 ` Frank Li
1 sibling, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-07-23 9:52 UTC (permalink / raw)
To: Francesco Dolcini; +Cc: robh, dri-devel, devicetree, conor+dt, imx, Frank.Li
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Schema validation bypass for numbered endpoint nodes.
--
--- Patch [1]: [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property ---
commit 73f976bb84f0f0a26cb8385791e8483235c1fe74
Author: Francesco Dolcini <francesco.dolcini@toradex.com>
dt-bindings: lcdif: Add endpoint bus-width property
The DPI output of the LCD interface can be configured with a bus width
of 16, 18, or 24 bits. Introduce a bus-width property to the output
endpoint, specifying the number of parallel RGB bits connected.
> diff --git a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
> index 2dd0411ec6516..6931f0ae38297 100644
> --- a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
> +++ b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
> @@ -71,6 +71,15 @@ properties:
> $ref: /schemas/graph.yaml#/properties/port
> description: The LCDIF output port
>
> + properties:
> + endpoint:
[Severity: Low]
Will this schema validate device trees with multiple endpoints correctly?
Defining `endpoint:` under `properties` will only match nodes exactly named
"endpoint". Any numbered endpoints like "endpoint@1" or "endpoint@2" will
silently bypass these constraints and the `unevaluatedProperties: false`
check.
Should this be defined using `patternProperties: "^endpoint(@[0-9a-f]+)?$":`
instead to ensure the rules apply to all endpoint nodes?
> + $ref: /schemas/graph.yaml#/$defs/endpoint-base
> + unevaluatedProperties: false
> +
> + properties:
> + bus-width:
> + enum: [ 16, 18, 24 ]
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723093813.180089-1-francesco@dolcini.it?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration
2026-07-23 9:48 ` Marco Felsch
@ 2026-07-23 9:55 ` Francesco Dolcini
0 siblings, 0 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 9:55 UTC (permalink / raw)
To: Marco Felsch
Cc: Francesco Dolcini, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Alexander Stein, imx, devicetree, linux-kernel, dri-devel,
Francesco Dolcini, linux-arm-kernel
Hello Marco,
thanks for the review
On Thu, Jul 23, 2026 at 11:48:03AM +0200, Marco Felsch wrote:
> On 26-07-23, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> >
> > LCDIF programs LCD_DATABUS_WIDTH from the selected media bus format. The
> > format reported by the downstream panel or bridge describes the display
> > input, but it does not describe how the LCDIF data pins are physically
> > wired on the board.
> >
> > These can differ. For example, a 16-bit LCDIF bus can be connected to a
> > 24-bit display by wiring the available color bits to the corresponding
> > display inputs. In that case, using the display's 24-bit format to
> > configure LCDIF selects the wrong data-bus mode and changes the assignment
> > of color bits on the LCD_DATA pins.
> >
> > Read the optional bus-width endpoint property from the LCDIF output port
> > and use it to select the media bus format used to configure LCDIF. This
> > allows the LCDIF bus mode to describe the physical interface
> > independently of the downstream display format.
> >
> > When the optional property is absent, continue using the format reported
> > by the downstream display device, preserving the existing behavior.
> >
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > ---
> > v2: use the common bus-width property instead of the legacy interface-pix-fmt
> > ---
> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 24 ++++++++++++++++++++++++
> > drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++
> > drivers/gpu/drm/mxsfb/mxsfb_kms.c | 12 ++++++++++++
> > 3 files changed, 38 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > index 9b8fbda85d28..0545718a4b65 100644
> > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > @@ -12,7 +12,10 @@
> > #include <linux/clk.h>
> > #include <linux/dma-mapping.h>
> > #include <linux/io.h>
> > +#include <linux/media-bus-format.h>
> > #include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <linux/of_graph.h>
> > #include <linux/platform_device.h>
> > #include <linux/property.h>
> > #include <linux/pm_runtime.h>
> > @@ -209,7 +212,10 @@ static int mxsfb_load(struct drm_device *drm,
> > const struct mxsfb_devdata *devdata)
> > {
> > struct platform_device *pdev = to_platform_device(drm->dev);
> > + struct device_node *np = pdev->dev.of_node;
> > struct mxsfb_drm_private *mxsfb;
> > + struct device_node *ep;
> > + u32 bus_width = 0;
>
> With this beeing set to '0' and ...
>
> > int ret;
> >
> > mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
> > @@ -236,6 +242,24 @@ static int mxsfb_load(struct drm_device *drm,
> > if (IS_ERR(mxsfb->clk_disp_axi))
> > mxsfb->clk_disp_axi = NULL;
> >
> > + ep = of_graph_get_next_endpoint(np, NULL);
> > + if (ep) {
> > + of_property_read_u32(ep, "bus-width", &bus_width);
>
> no bus-width property present, this ...
>
> > + of_node_put(ep);
>
> Furthermore please see
> 20260723-v6-18-topic-imx93-parallel-display-v13-1-ccf3f9bbc0fc@nxp.com
> for a proper error handling.
Not sure if I see the value on doing this. You are just doing the
validation of the DT again in the code. My understanding is that this is
not the way to go.
BTW, I assume you are suggesting something like this, if this is not the
case please let me know
if (ep) {
err = of_property_read_u32();
of_node_put(ep);
if (err && err != -EINVAL)
return dev_err_probe(dev, err,
"failed to query bus-width\n");
}
>
> > + }
> > +
> > + switch (bus_width) {
>
> switch should fail. Therefore I would recommend to set the default to
> 24 (bit) aka no limitation.
I would not do that.
We have an optional property, the DT is validated against the binding
for correctness, we should not validate it again in the code. If the
property is not present or it contains an invalid value it is
just ignored, preserving the existing behavior.
Francesco
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property
2026-07-23 9:38 ` [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property Francesco Dolcini
2026-07-23 9:52 ` sashiko-bot
@ 2026-07-23 15:45 ` Frank Li
1 sibling, 0 replies; 11+ messages in thread
From: Frank Li @ 2026-07-23 15:45 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Marek Vasut, Stefan Agner, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein,
Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
On Thu, Jul 23, 2026 at 11:38:08AM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> The DPI output of the LCD interface can be configured with a bus width
> of 16, 18, or 24 bits. Introduce a bus-width property to the output
> endpoint, specifying the number of parallel RGB bits connected.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2: use the common bus-width property instead of the legacy interface-pix-fmt
> ---
> Documentation/devicetree/bindings/display/fsl,lcdif.yaml | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
> index 2dd0411ec651..6931f0ae3829 100644
> --- a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
> +++ b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml
> @@ -71,6 +71,15 @@ properties:
> $ref: /schemas/graph.yaml#/properties/port
> description: The LCDIF output port
>
> + properties:
> + endpoint:
> + $ref: /schemas/graph.yaml#/$defs/endpoint-base
Is it better by use video-interfaces.yaml# ?
Frank
> + unevaluatedProperties: false
> +
> + properties:
> + bus-width:
> + enum: [ 16, 18, 24 ]
> +
> display:
> $ref: /schemas/types.yaml#/definitions/phandle
> description: phandle to display panel
> --
> 2.47.3
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration
2026-07-23 9:38 ` [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration Francesco Dolcini
2026-07-23 9:48 ` Marco Felsch
@ 2026-07-23 15:47 ` Frank Li
2026-07-23 15:53 ` Francesco Dolcini
1 sibling, 1 reply; 11+ messages in thread
From: Frank Li @ 2026-07-23 15:47 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Alexander Stein,
Francesco Dolcini, dri-devel, devicetree, linux-kernel, imx,
linux-arm-kernel
On Thu, Jul 23, 2026 at 11:38:09AM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> LCDIF programs LCD_DATABUS_WIDTH from the selected media bus format. The
> format reported by the downstream panel or bridge describes the display
> input, but it does not describe how the LCDIF data pins are physically
> wired on the board.
>
> These can differ. For example, a 16-bit LCDIF bus can be connected to a
> 24-bit display by wiring the available color bits to the corresponding
> display inputs. In that case, using the display's 24-bit format to
> configure LCDIF selects the wrong data-bus mode and changes the assignment
> of color bits on the LCD_DATA pins.
>
> Read the optional bus-width endpoint property from the LCDIF output port
> and use it to select the media bus format used to configure LCDIF. This
> allows the LCDIF bus mode to describe the physical interface
> independently of the downstream display format.
>
> When the optional property is absent, continue using the format reported
> by the downstream display device, preserving the existing behavior.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2: use the common bus-width property instead of the legacy interface-pix-fmt
> ---
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 24 ++++++++++++++++++++++++
> drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 12 ++++++++++++
> 3 files changed, 38 insertions(+)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 9b8fbda85d28..0545718a4b65 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -12,7 +12,10 @@
> #include <linux/clk.h>
> #include <linux/dma-mapping.h>
> #include <linux/io.h>
> +#include <linux/media-bus-format.h>
> #include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_graph.h>
> #include <linux/platform_device.h>
> #include <linux/property.h>
> #include <linux/pm_runtime.h>
> @@ -209,7 +212,10 @@ static int mxsfb_load(struct drm_device *drm,
> const struct mxsfb_devdata *devdata)
> {
> struct platform_device *pdev = to_platform_device(drm->dev);
> + struct device_node *np = pdev->dev.of_node;
> struct mxsfb_drm_private *mxsfb;
> + struct device_node *ep;
> + u32 bus_width = 0;
> int ret;
>
> mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
> @@ -236,6 +242,24 @@ static int mxsfb_load(struct drm_device *drm,
> if (IS_ERR(mxsfb->clk_disp_axi))
> mxsfb->clk_disp_axi = NULL;
>
> + ep = of_graph_get_next_endpoint(np, NULL);
use auto cleanup
struct device_node *ep __free(device_node) = of_graph_get_next_endpoint(np, NULL);
Frank
> + if (ep) {
> + of_property_read_u32(ep, "bus-width", &bus_width);
> + of_node_put(ep);
> + }
> +
> + switch (bus_width) {
> + case 16:
> + mxsfb->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
> + break;
> + case 18:
> + mxsfb->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
> + break;
> + case 24:
> + mxsfb->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
> + break;
> + }
> +
> ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32));
> if (ret)
> return ret;
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.h b/drivers/gpu/drm/mxsfb/mxsfb_drv.h
> index d160d921b25f..bdc47ce5be79 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.h
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.h
> @@ -46,6 +46,8 @@ struct mxsfb_drm_private {
> struct drm_connector *connector;
> struct drm_bridge *bridge;
>
> + u32 bus_format;
> +
> bool crc_active;
> };
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
> index d8ebebc5314b..1d78c486d147 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
> @@ -386,6 +386,18 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
> if (!bus_format)
> bus_format = MEDIA_BUS_FMT_RGB888_1X24;
>
> + /*
> + * Prefer the bus format derived from the OF graph endpoint "bus-width"
> + * property when available. Otherwise, use the bus format reported by
> + * the downstream bridge or panel.
> + *
> + * This supports mismatched display and interface bus widths, such as
> + * a 24-bit panel connected through an 18-bit interface or an 18-bit
> + * panel connected through a 24-bit interface.
> + */
> + if (mxsfb->bus_format)
> + bus_format = mxsfb->bus_format;
> +
> mxsfb_crtc_mode_set_nofb(mxsfb, bridge_state, bus_format);
>
> /* Write cur_buf as well to avoid an initial corrupt frame */
> --
> 2.47.3
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration
2026-07-23 15:47 ` Frank Li
@ 2026-07-23 15:53 ` Francesco Dolcini
0 siblings, 0 replies; 11+ messages in thread
From: Francesco Dolcini @ 2026-07-23 15:53 UTC (permalink / raw)
To: Frank Li
Cc: Francesco Dolcini, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Alexander Stein, Francesco Dolcini, dri-devel, devicetree,
linux-kernel, imx, linux-arm-kernel
On Thu, Jul 23, 2026 at 10:47:36AM -0500, Frank Li wrote:
> On Thu, Jul 23, 2026 at 11:38:09AM +0200, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> >
> > LCDIF programs LCD_DATABUS_WIDTH from the selected media bus format. The
> > format reported by the downstream panel or bridge describes the display
> > input, but it does not describe how the LCDIF data pins are physically
> > wired on the board.
> >
> > These can differ. For example, a 16-bit LCDIF bus can be connected to a
> > 24-bit display by wiring the available color bits to the corresponding
> > display inputs. In that case, using the display's 24-bit format to
> > configure LCDIF selects the wrong data-bus mode and changes the assignment
> > of color bits on the LCD_DATA pins.
> >
> > Read the optional bus-width endpoint property from the LCDIF output port
> > and use it to select the media bus format used to configure LCDIF. This
> > allows the LCDIF bus mode to describe the physical interface
> > independently of the downstream display format.
> >
> > When the optional property is absent, continue using the format reported
> > by the downstream display device, preserving the existing behavior.
> >
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > ---
> > v2: use the common bus-width property instead of the legacy interface-pix-fmt
> > ---
> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 24 ++++++++++++++++++++++++
> > drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++
> > drivers/gpu/drm/mxsfb/mxsfb_kms.c | 12 ++++++++++++
> > 3 files changed, 38 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > index 9b8fbda85d28..0545718a4b65 100644
> > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > @@ -12,7 +12,10 @@
> > #include <linux/clk.h>
> > #include <linux/dma-mapping.h>
> > #include <linux/io.h>
> > +#include <linux/media-bus-format.h>
> > #include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <linux/of_graph.h>
> > #include <linux/platform_device.h>
> > #include <linux/property.h>
> > #include <linux/pm_runtime.h>
> > @@ -209,7 +212,10 @@ static int mxsfb_load(struct drm_device *drm,
> > const struct mxsfb_devdata *devdata)
> > {
> > struct platform_device *pdev = to_platform_device(drm->dev);
> > + struct device_node *np = pdev->dev.of_node;
> > struct mxsfb_drm_private *mxsfb;
> > + struct device_node *ep;
> > + u32 bus_width = 0;
> > int ret;
> >
> > mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
> > @@ -236,6 +242,24 @@ static int mxsfb_load(struct drm_device *drm,
> > if (IS_ERR(mxsfb->clk_disp_axi))
> > mxsfb->clk_disp_axi = NULL;
> >
> > + ep = of_graph_get_next_endpoint(np, NULL);
>
> use auto cleanup
>
> struct device_node *ep __free(device_node) = of_graph_get_next_endpoint(np, NULL);
Does it makes the code more read-able or better in this specific case? I
would say no, to me it is more compact and clear the way it is.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-07-23 15:53 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 9:38 [PATCH v2 0/4] drm: mxsfb: Support LCDIF interface bus width Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 1/4] dt-bindings: lcdif: Add endpoint bus-width property Francesco Dolcini
2026-07-23 9:52 ` sashiko-bot
2026-07-23 15:45 ` Frank Li
2026-07-23 9:38 ` [PATCH v2 2/4] drm: mxsfb: Add optional DPI output bus-width configuration Francesco Dolcini
2026-07-23 9:48 ` Marco Felsch
2026-07-23 9:55 ` Francesco Dolcini
2026-07-23 15:47 ` Frank Li
2026-07-23 15:53 ` Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 3/4] ARM: dts: imx6ull-colibri: Set LCDIF bus-width Francesco Dolcini
2026-07-23 9:38 ` [PATCH v2 4/4] ARM: dts: imx7-colibri: " Francesco Dolcini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.