* [PATCH] drm/bridge: imx93-mipi-dsi: Fix mode validation
@ 2026-02-27 7:36 Liu Ying
2026-05-07 21:08 ` Frank Li
2026-05-08 11:40 ` Dmitry Baryshkov
0 siblings, 2 replies; 3+ messages in thread
From: Liu Ying @ 2026-02-27 7:36 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Luca Ceresoli
Cc: dri-devel, imx, linux-arm-kernel, linux-kernel, Liu Ying
Instead of checking the last bridge's operation bit masks against
DRM_BRIDGE_OP_DETECT and DRM_BRIDGE_OP_EDID to determine if allowing
+/-0.5% pixel clock rate deviation, check any bridge after this bridge,
because the last bridge is usually a display connector bridge without
any operation bit mask when the clock rate deviation is allowed.
Fixes: ce62f8ea7e3f ("drm/bridge: imx: Add i.MX93 MIPI DSI support")
Fixes: 5849eff7f067 ("drm/bridge: imx93-mipi-dsi: use drm_bridge_chain_get_last_bridge()")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 33 ++++++++++++++++-------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
index 8f312f9edf97..6d65df9ed970 100644
--- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
@@ -493,21 +493,24 @@ static enum drm_mode_status
imx93_dsi_validate_mode(struct imx93_dsi *dsi, const struct drm_display_mode *mode)
{
struct drm_bridge *dmd_bridge = dw_mipi_dsi_get_bridge(dsi->dmd);
- struct drm_bridge *last_bridge __free(drm_bridge_put) =
- drm_bridge_chain_get_last_bridge(dmd_bridge->encoder);
-
- if ((last_bridge->ops & DRM_BRIDGE_OP_DETECT) &&
- (last_bridge->ops & DRM_BRIDGE_OP_EDID)) {
- unsigned long pixel_clock_rate = mode->clock * 1000;
- unsigned long rounded_rate;
-
- /* Allow +/-0.5% pixel clock rate deviation */
- rounded_rate = clk_round_rate(dsi->clk_pixel, pixel_clock_rate);
- if (rounded_rate < pixel_clock_rate * 995 / 1000 ||
- rounded_rate > pixel_clock_rate * 1005 / 1000) {
- dev_dbg(dsi->dev, "failed to round clock for mode " DRM_MODE_FMT "\n",
- DRM_MODE_ARG(mode));
- return MODE_NOCLOCK;
+
+ drm_for_each_bridge_in_chain_from(dmd_bridge, bridge) {
+ if ((bridge->ops & DRM_BRIDGE_OP_DETECT) &&
+ (bridge->ops & DRM_BRIDGE_OP_EDID)) {
+ unsigned long pixel_clock_rate = mode->clock * 1000;
+ unsigned long rounded_rate;
+
+ /* Allow +/-0.5% pixel clock rate deviation */
+ rounded_rate = clk_round_rate(dsi->clk_pixel, pixel_clock_rate);
+ if (rounded_rate < pixel_clock_rate * 995 / 1000 ||
+ rounded_rate > pixel_clock_rate * 1005 / 1000) {
+ dev_dbg(dsi->dev,
+ "failed to round clock for mode " DRM_MODE_FMT "\n",
+ DRM_MODE_ARG(mode));
+ return MODE_NOCLOCK;
+ }
+
+ break;
}
}
---
base-commit: 877552aa875839314afad7154b5a561889e87ea9
change-id: 20260227-imx93-mipi-dsi-fix-mode-validation-425c872a2493
Best regards,
--
Liu Ying <victor.liu@nxp.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/bridge: imx93-mipi-dsi: Fix mode validation
2026-02-27 7:36 [PATCH] drm/bridge: imx93-mipi-dsi: Fix mode validation Liu Ying
@ 2026-05-07 21:08 ` Frank Li
2026-05-08 11:40 ` Dmitry Baryshkov
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-05-07 21:08 UTC (permalink / raw)
To: Liu Ying
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Luca Ceresoli, dri-devel,
imx, linux-arm-kernel, linux-kernel
On Fri, Feb 27, 2026 at 03:36:41PM +0800, Liu Ying wrote:
> Instead of checking the last bridge's operation bit masks against
> DRM_BRIDGE_OP_DETECT and DRM_BRIDGE_OP_EDID to determine if allowing
> +/-0.5% pixel clock rate deviation, check any bridge after this bridge,
> because the last bridge is usually a display connector bridge without
> any operation bit mask when the clock rate deviation is allowed.
>
> Fixes: ce62f8ea7e3f ("drm/bridge: imx: Add i.MX93 MIPI DSI support")
> Fixes: 5849eff7f067 ("drm/bridge: imx93-mipi-dsi: use drm_bridge_chain_get_last_bridge()")
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 33 ++++++++++++++++-------------
> 1 file changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> index 8f312f9edf97..6d65df9ed970 100644
> --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> @@ -493,21 +493,24 @@ static enum drm_mode_status
> imx93_dsi_validate_mode(struct imx93_dsi *dsi, const struct drm_display_mode *mode)
> {
> struct drm_bridge *dmd_bridge = dw_mipi_dsi_get_bridge(dsi->dmd);
> - struct drm_bridge *last_bridge __free(drm_bridge_put) =
> - drm_bridge_chain_get_last_bridge(dmd_bridge->encoder);
> -
> - if ((last_bridge->ops & DRM_BRIDGE_OP_DETECT) &&
> - (last_bridge->ops & DRM_BRIDGE_OP_EDID)) {
> - unsigned long pixel_clock_rate = mode->clock * 1000;
> - unsigned long rounded_rate;
> -
> - /* Allow +/-0.5% pixel clock rate deviation */
> - rounded_rate = clk_round_rate(dsi->clk_pixel, pixel_clock_rate);
> - if (rounded_rate < pixel_clock_rate * 995 / 1000 ||
> - rounded_rate > pixel_clock_rate * 1005 / 1000) {
> - dev_dbg(dsi->dev, "failed to round clock for mode " DRM_MODE_FMT "\n",
> - DRM_MODE_ARG(mode));
> - return MODE_NOCLOCK;
> +
> + drm_for_each_bridge_in_chain_from(dmd_bridge, bridge) {
> + if ((bridge->ops & DRM_BRIDGE_OP_DETECT) &&
> + (bridge->ops & DRM_BRIDGE_OP_EDID)) {
> + unsigned long pixel_clock_rate = mode->clock * 1000;
> + unsigned long rounded_rate;
> +
> + /* Allow +/-0.5% pixel clock rate deviation */
> + rounded_rate = clk_round_rate(dsi->clk_pixel, pixel_clock_rate);
> + if (rounded_rate < pixel_clock_rate * 995 / 1000 ||
> + rounded_rate > pixel_clock_rate * 1005 / 1000) {
> + dev_dbg(dsi->dev,
> + "failed to round clock for mode " DRM_MODE_FMT "\n",
> + DRM_MODE_ARG(mode));
> + return MODE_NOCLOCK;
> + }
> +
> + break;
> }
> }
>
>
> ---
> base-commit: 877552aa875839314afad7154b5a561889e87ea9
> change-id: 20260227-imx93-mipi-dsi-fix-mode-validation-425c872a2493
>
> Best regards,
> --
> Liu Ying <victor.liu@nxp.com>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/bridge: imx93-mipi-dsi: Fix mode validation
2026-02-27 7:36 [PATCH] drm/bridge: imx93-mipi-dsi: Fix mode validation Liu Ying
2026-05-07 21:08 ` Frank Li
@ 2026-05-08 11:40 ` Dmitry Baryshkov
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2026-05-08 11:40 UTC (permalink / raw)
To: Liu Ying
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Luca Ceresoli, dri-devel, imx, linux-arm-kernel, linux-kernel
On Fri, Feb 27, 2026 at 03:36:41PM +0800, Liu Ying wrote:
> Instead of checking the last bridge's operation bit masks against
> DRM_BRIDGE_OP_DETECT and DRM_BRIDGE_OP_EDID to determine if allowing
> +/-0.5% pixel clock rate deviation, check any bridge after this bridge,
> because the last bridge is usually a display connector bridge without
> any operation bit mask when the clock rate deviation is allowed.
It would be nice to add an explanation, why this check is performed only
for these bridges.
>
> Fixes: ce62f8ea7e3f ("drm/bridge: imx: Add i.MX93 MIPI DSI support")
> Fixes: 5849eff7f067 ("drm/bridge: imx93-mipi-dsi: use drm_bridge_chain_get_last_bridge()")
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 33 ++++++++++++++++-------------
> 1 file changed, 18 insertions(+), 15 deletions(-)
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-08 11:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 7:36 [PATCH] drm/bridge: imx93-mipi-dsi: Fix mode validation Liu Ying
2026-05-07 21:08 ` Frank Li
2026-05-08 11:40 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox