drm/imx: parallel-display: Prefer bus format set via legacy "interface-pix-fmt" DT property

Prefer bus format set via legacy "interface-pix-fmt" DT property
over panel bus format. This is necessary to retain support for
DTs which configure the IPUv3 parallel output as 24bit DPI, but
connect 18bit DPI panels to it with hardware swizzling.

This used to work up to Linux 6.12, but stopped working in 6.13,
reinstate the behavior to support old DTs.

Cc: stable@vger.kernel.org
Fixes: 5f6e56d331 ("drm/imx: parallel-display: switch to drm_panel_bridge")
Signed-off-by: Marek Vasut <marex@nabladev.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://patch.msgid.link/20260110171510.692666-1-marex@nabladev.com
This commit is contained in:
Marek Vasut 2026-01-10 18:14:10 +01:00 committed by Philipp Zabel
parent ba683f7742
commit cdf26e1462

View File

@ -110,8 +110,7 @@ imx_pd_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
output_fmt = imxpd->bus_format ? : MEDIA_BUS_FMT_RGB888_1X24;
/* Now make sure the requested output format is supported. */
if ((imxpd->bus_format && imxpd->bus_format != output_fmt) ||
!imx_pd_format_supported(output_fmt)) {
if (!imx_pd_format_supported(output_fmt)) {
*num_input_fmts = 0;
return NULL;
}
@ -121,7 +120,17 @@ imx_pd_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
if (!input_fmts)
return NULL;
input_fmts[0] = output_fmt;
/*
* Prefer bus format set via legacy "interface-pix-fmt" DT property
* over panel bus format. This is necessary to retain support for
* DTs which configure the IPUv3 parallel output as 24bit, but
* connect 18bit DPI panels to it with hardware swizzling.
*/
if (imxpd->bus_format && imxpd->bus_format != output_fmt)
input_fmts[0] = imxpd->bus_format;
else
input_fmts[0] = output_fmt;
return input_fmts;
}