Skip to contentSkip to conversation

drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check()

PATCH In review Christoph Niedermaier 4 participants 8 messages Feb 1, 2022 – Feb 28, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check()

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags.

Fixes fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available")
Cc Marek Vasut <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

To: [email protected]
---
V2: - Add Boris to the Cc list

---
 drivers/gpu/drm/imx/parallel-display.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/imx/parallel-display.c +0 -8
index a8aba0141ce7..06cb1a59b9bc 100644
@@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
 	if (!imx_pd_format_supported(bus_fmt))
 		return -EINVAL;
 
-	if (bus_flags &
-	    ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
-	      DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
-	      DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
-		dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
-		return -EINVAL;
-	}
-
 	bridge_state->output_bus_cfg.flags = bus_flags;
 	bridge_state->input_bus_cfg.flags = bus_flags;
 	imx_crtc_state->bus_flags = bus_flags;
Signature · 7 lines
2.11.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tested-by on v2 1/1
#1 lore raw

Am Dienstag, den 01.02.2022, 12:36 +0100 schrieb Christoph Niedermaier:

Quoted 42 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags.

Fixes fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available")
Cc Marek Vasut <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

To: [email protected]
---
V2: - Add Boris to the Cc list

---
 drivers/gpu/drm/imx/parallel-display.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/imx/parallel-display.c +0 -1
index a8aba0141ce7..06cb1a59b9bc 100644
@@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
 	if (!imx_pd_format_supported(bus_fmt))
 		return -EINVAL;
 
-	if (bus_flags &

drivers/gpu/drm/imx/parallel-display.c static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge, · line 222

Quoted 10 lines
drivers/gpu/drm/imx/parallel-display.c +0 -7
-	    ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
-	      DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
-	      DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
-		dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
-		return -EINVAL;
-	}
-
 	bridge_state->output_bus_cfg.flags = bus_flags;
 	bridge_state->input_bus_cfg.flags = bus_flags;
 	imx_crtc_state->bus_flags = bus_flags;

Tested on a Colibri iMX6DL with a panel-dpi based panel.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

From: Max Krummenacher [mailto:[email protected]]
Sent: Wednesday, February 9, 2022 10:38 AM

Quoted 55 lines
Quoted 42 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags.

Fixes fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available")
Cc Marek Vasut <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

To: [email protected]
---
V2: - Add Boris to the Cc list

---
 drivers/gpu/drm/imx/parallel-display.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/imx/parallel-display.c +0 -1
index a8aba0141ce7..06cb1a59b9bc 100644
@@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
      if (!imx_pd_format_supported(bus_fmt))
              return -EINVAL;
 
-     if (bus_flags &

drivers/gpu/drm/imx/parallel-display.c static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge, · line 222

Quoted 10 lines
drivers/gpu/drm/imx/parallel-display.c +0 -7
-         ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
-             dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
-             return -EINVAL;
-     }
-
      bridge_state->output_bus_cfg.flags = bus_flags;
      bridge_state->input_bus_cfg.flags = bus_flags;
      imx_crtc_state->bus_flags = bus_flags;

Tested on a Colibri iMX6DL with a panel-dpi based panel.

Quoted 1 line

I still ask myself why this bus flag check is in the code. Is there a reason not to remove that?

Regards
Christoph
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

Hello Christoph,

Quoted 57 lines · On Sat, 19 Feb 2022 09:28:44 +0000 Christoph Niedermaier…

From: Max Krummenacher [mailto:[email protected]]
Sent: Wednesday, February 9, 2022 10:38 AM

Quoted 55 lines
Quoted 42 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags.

Fixes fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available")
Cc Marek Vasut <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

To: [email protected]
---
V2: - Add Boris to the Cc list

---
 drivers/gpu/drm/imx/parallel-display.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/imx/parallel-display.c +0 -1
index a8aba0141ce7..06cb1a59b9bc 100644
@@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
      if (!imx_pd_format_supported(bus_fmt))
              return -EINVAL;
 
-     if (bus_flags &

drivers/gpu/drm/imx/parallel-display.c static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge, · line 222

Quoted 10 lines
drivers/gpu/drm/imx/parallel-display.c +0 -7
-         ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
-             dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
-             return -EINVAL;
-     }
-
      bridge_state->output_bus_cfg.flags = bus_flags;
      bridge_state->input_bus_cfg.flags = bus_flags;
      imx_crtc_state->bus_flags = bus_flags;  

Tested on a Colibri iMX6DL with a panel-dpi based panel.

Quoted 4 lines
Quoted 1 line

I still ask myself why this bus flag check is in the code. Is there a reason not to remove that?

The reasoning was that DE_{LOW,HIGH} and FLAG_PIXDATA_DRIVE_{POS,NEG}EDGE were the only bus_flags taken into account by the crtc logic, so anything else is simply ignored. This was definitely wrong since the driver supports at least one of the VSYNC polarity (perhaps both if there's a way to configure it that's not hooked-up yet).

So I guess figuring out the default VSYNC polarity and accepting the according DISPLAY_FLAGS_SYNC_XXXEDGE flag is what makes most sense here.

Regards,

Boris

#4 lore raw

Am Montag, den 21.02.2022, 09:29 +0100 schrieb Boris Brezillon:

Quoted 75 lines

Hello Christoph,

Quoted 58 lines · On Sat, 19 Feb 2022 09:28:44 +0000 Christoph Niedermaier…

From: Max Krummenacher [mailto:[email protected]]
Sent: Wednesday, February 9, 2022 10:38 AM

Quoted 56 lines
Quoted 43 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags.

Fixes fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when

available")

Cc Marek Vasut <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

To: [email protected]
---
V2: - Add Boris to the Cc list

---
 drivers/gpu/drm/imx/parallel-display.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/imx/parallel-display.c +0 -1
index a8aba0141ce7..06cb1a59b9bc 100644
@@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
      if (!imx_pd_format_supported(bus_fmt))
              return -EINVAL;
 
-     if (bus_flags &

drivers/gpu/drm/imx/parallel-display.c static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge, · line 222

Quoted 10 lines
drivers/gpu/drm/imx/parallel-display.c +0 -7
-         ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
-             dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
-             return -EINVAL;
-     }
-
      bridge_state->output_bus_cfg.flags = bus_flags;
      bridge_state->input_bus_cfg.flags = bus_flags;
      imx_crtc_state->bus_flags = bus_flags;  

Tested on a Colibri iMX6DL with a panel-dpi based panel.

Quoted 4 lines
Quoted 1 line

I still ask myself why this bus flag check is in the code. Is there a reason not to remove that?

The reasoning was that DE_{LOW,HIGH} and FLAG_PIXDATA_DRIVE_{POS,NEG}EDGE were the only bus_flags taken into account by the crtc logic, so anything else is simply ignored. This was definitely wrong since the driver supports at least one of the VSYNC polarity (perhaps both if there's a way to configure it that's not hooked-up yet).

Quoted 2 lines

So I guess figuring out the default VSYNC polarity and accepting the according DISPLAY_FLAGS_SYNC_XXXEDGE flag is what makes most sense here.

Note that {HV}SYNC polarities are taken from the timings '.flag' field The bus_flags do not carry
that information.
(drivers/gpu/ipu-v3/ipu-di.c:611: if (sig->mode.flags &
DISPLAY_FLAGS_HSYNC_HIGH))

The new flags DRM_BUS_FLAG_SYNC_DRIVE_{POS,NEG}EDGE are siblings to DRM_BUS_FLAG_PIXDATA_DRIVE_{POS,NEG}EDGE and would allow to specify on which pixelclock edge the sync signals are to be driven. Before that addition it was implicitly assumed that the sync signals and data signals would be driven on the same clock edge. The way I read the IPU driver it is not
foreseen that the data lines
and sync lines are driven by a different clock edge.

I personally would just drop the sanity test on
bus_flags. This is what
this patch proposes.

Regards,
Max

Quoted 4 lines

Regards,

Boris

#5 lore raw
Quoted 85 lines · On Mon, 21 Feb 2022 12:56:43 +0100 Max Krummenacher <[email protected]>…

Am Montag, den 21.02.2022, 09:29 +0100 schrieb Boris Brezillon:

Quoted 75 lines

Hello Christoph,

Quoted 58 lines · On Sat, 19 Feb 2022 09:28:44 +0000 Christoph Niedermaier…

From: Max Krummenacher [mailto:[email protected]]
Sent: Wednesday, February 9, 2022 10:38 AM

Quoted 56 lines
Quoted 43 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags.

Fixes fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when

available")

Cc Marek Vasut <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>

To: [email protected]
---
V2: - Add Boris to the Cc list

---
 drivers/gpu/drm/imx/parallel-display.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/imx/parallel-display.c +0 -1
index a8aba0141ce7..06cb1a59b9bc 100644
@@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
      if (!imx_pd_format_supported(bus_fmt))
              return -EINVAL;
 
-     if (bus_flags &

drivers/gpu/drm/imx/parallel-display.c static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge, · line 222

Quoted 10 lines
drivers/gpu/drm/imx/parallel-display.c +0 -7
-         ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
-           DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
-             dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
-             return -EINVAL;
-     }
-
      bridge_state->output_bus_cfg.flags = bus_flags;
      bridge_state->input_bus_cfg.flags = bus_flags;
      imx_crtc_state->bus_flags = bus_flags;    

Tested on a Colibri iMX6DL with a panel-dpi based panel.

Quoted 4 lines
Quoted 1 line

I still ask myself why this bus flag check is in the code. Is there a reason not to remove that?

The reasoning was that DE_{LOW,HIGH} and FLAG_PIXDATA_DRIVE_{POS,NEG}EDGE were the only bus_flags taken into account by the crtc logic, so anything else is simply ignored. This was definitely wrong since the driver supports at least one of the VSYNC polarity (perhaps both if there's a way to configure it that's not hooked-up yet).

Quoted 2 lines

So I guess figuring out the default VSYNC polarity and accepting the according DISPLAY_FLAGS_SYNC_XXXEDGE flag is what makes most sense here.

Note that {HV}SYNC polarities are taken from the timings '.flag' field The bus_flags do not carry
that information.
(drivers/gpu/ipu-v3/ipu-di.c:611: if (sig->mode.flags &
DISPLAY_FLAGS_HSYNC_HIGH))

Quoted 5 lines

The new flags DRM_BUS_FLAG_SYNC_DRIVE_{POS,NEG}EDGE are siblings to DRM_BUS_FLAG_PIXDATA_DRIVE_{POS,NEG}EDGE and would allow to specify on which pixelclock edge the sync signals are to be driven. Before that addition it was implicitly assumed that the sync signals and data signals would be driven on the same clock edge.

Oh, ok.

Quoted 7 lines

The way I read the IPU driver it is not foreseen that the data lines
and sync lines are driven by a different clock edge.

I personally would just drop the sanity test on
bus_flags. This is what
this patch proposes.

Sounds fine.

#6 lore raw
Quoted 11 lines · Boris Brezillon
Quoted 8 lines · On Mon, 21 Feb 2022 12:56:43 +0100 Max Krummenacher <[email protected]>…

Am Montag, den 21.02.2022, 09:29 +0100 schrieb Boris Brezillon:

Quoted 7 lines

Hello Christoph,

Quoted 2 lines · On Sat, 19 Feb 2022 09:28:44 +0000 Christoph Niedermaier…

From: Max Krummenacher [mailto:[email protected]]
Sent: Wednesday, February 9, 2022 10:38 AM

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this

Can you please update the commit message to fix the following warning:

Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available")'

Also, collect the AB from Boris and TB from Max.

I can also fix it up for you while applying if that's OK with you.

[...]

Quoted 1 line

[...]

#7 lore raw
Quoted 21 lines · Marek Vasut
Quoted 10 lines · Boris Brezillon
Quoted 7 lines · On Mon, 21 Feb 2022 12:56:43 +0100 Max Krummenacher <[email protected]>…

Am Montag, den 21.02.2022, 09:29 +0100 schrieb Boris Brezillon:

Quoted 6 lines

Hello Christoph,

Quoted 2 lines · On Sat, 19 Feb 2022 09:28:44 +0000 Christoph Niedermaier…

From: Max Krummenacher [mailto:[email protected]]
Sent: Wednesday, February 9, 2022 10:38 AM

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this

Quoted 7 lines

Can you please update the commit message to fix the following warning:

Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available")'

Also, collect the AB from Boris and TB from Max.

I can also fix it up for you while applying if that's OK with you.

Nevermind, the patch got applied, it seems I'm not that proficient with dim yet ...