[Linux-stm32] [PATCH 0/1] [Kontron] [URGENT]: drm/bridge/synopsys/dsi: fix activation sequence

Antonio Borneo antonio.borneo at st.com
Mon Jun 22 12:36:41 UTC 2020


Customer is waiting for this patch, but I don't want to send it
out without the approval of the experts.

Background:
Kontron is connecting a dsi-to-lvds bridge TI sn65dsi83 to MP15x.
The driver for the bridge is not mainline, but taken from
https://github.com/varigit/linux-imx/tree/imx_4.14.98_2.0.0_ga_var01/drivers/gpu/drm/bridge/sn65dsi83
and rebased by customer.

Note: I do not have the bridge above, so I have hacked the driver
to skip all the I2C transfer. My target is to get it loaded and
to get the DSI signal out.

Kontron reports:
| we want to connect a LVDS display on the DSI port of the MP157.
| The DSI2LVDS bridge chip is an SN65DSI84 chip on i2c bus. I've
| configured the connectors in the following way:
|
| ltdc at ep1 -> dsi at ep0, dsi at ep1 -> lvds at ep0
|
| The documentation mentions that a panel or bridge node must be
| available in the DSI part. So for a panel this works. But what
| must be the entry for a bridge?
| My bridge must be located on the i2c bus because of the
| configuration interface. The display parameters are configured
| in the bridge node.
|
| When the DSI node doesn't contain a panel node, DRM/modetest
| doesn't even recognize the DSI-1 connector. When the node
| contains a panel, the DSI-1 is created, but no framebuffer can
| be created. Seems this is not the right way, else i have to>
| configure the display twice (in the dsi node and in the bridge).

Verified on my side. If there is no panel as subnode of DSI, the
DSI does not start and also LTDC fails the probe.

This case would be common for each bridge that is not initialized
through DSI but through e.g. I2C.

The bug is schematized in the activation sequence of current code:

LTDC driver:
 .probe
	stm_drm_platform_probe()
		drv_load()
			ltdc_load()
				drm_of_find_panel_or_bridge()

The call drm_of_find_panel_or_bridge() returns -EPROBE_DEFER if
the driver of DSI has not registered the bridge (rgb to dsi) by
calling drm_bridge_add().

DSI driver:
 .probe
	dw_mipi_dsi_stm_probe()
		dw_mipi_dsi_probe()
			mipi_dsi_host_register()

As you can see, the probe of DSI does not call drm_bridge_add()
directly.
If as subnode of DSI there is a "panel", mipi_dsi_host_register()
will cause the probe() of the panel.
At least for the panels we use today with MP15x, their probe()
terminates by attaching the panel to the DSI by calling
mipi_dsi_attach() that, in turn, calls the .attach() method of the
DSI driver, reported below:

 .attach
	dw_mipi_dsi_host_attach()
		drm_bridge_add()

If the DSI has no subnodes, the .attach method will never get
called, the DSI does not declare itself as a DRM bridge, the ltdc
will defer forever its own probe.

This patch moves the relevant part of the attach method in probe.
Of course, the corresponding detach part goes in remove.

The binding document in v5.4 reports that the DSI subnode is
mandatory. But from v5.5 the yaml document drops the mandatory
requirement.

I have tested that on EV1 we do not have regressions.
Test on DK2 on-going.
Do you approve sending this out to customer?

By the way, I highlighted with FIXME another bug in the code.
I will check it later.

Antonio Borneo (1):
  drm/bridge/synopsys: fix activation sequence

 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 72 ++++++++++---------
 1 file changed, 37 insertions(+), 35 deletions(-)

-- 
2.17.1




More information about the Linux-stm32 mailing list