Imx8mp & mipi-dsi display: drm_bridge_attach fails with error -19

Hello,

in this thread I was able to attach several 1920x1200 panels to the imx8mm.

Now we are evaluating a Verdin iMX8MP Q 2GB WB IT with BSP6.2 on a custom carrier board for better graphical performance.

Therefore I adapted the dts-overlay for the MI1010AQT-1 to the following:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "imx8mp-pinfunc.h"

/ {
	compatible = "toradex,verdin-imx8mp";
};

&backlight {
	status = "okay";
};

&gpu_2d {
	status = "okay";
};

&gpu_3d {
	status = "okay";
};

/* LCDIF to MIPI-DSI */
&lcdif1 {
	status = "okay";
};

&mipi_dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port@1 {
		mipi_dsi_panel1_out: endpoint {
			remote-endpoint = <&panel1_in>;
		};
	};

	panel@0 {
        compatible = "mit,mi1010aqt-1";
        reg = <0>;
		
        power-supply = <&reg_3p3v>;	
		backlight = <&backlight>;

		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_panel_gpios>;
		enable-gpios = <&gpio5 0 GPIO_ACTIVE_HIGH>;	// I2S_2_BCLK (SODIMM 42)

		port {
        	panel1_in: endpoint {
				remote-endpoint = <&mipi_dsi_panel1_out>;
			};
		};
	};
};

&iomuxc {
	pinctrl_panel_gpios: panelgpiosgrp {
		fsl,pins = <
			MX8MP_IOMUXC_SAI3_TXC__GPIO5_IO00		0x146	/* SODIMM 42 - reset of display (pulled-up as active-low) */
		>;
	};
};

&mix_gpu_ml {
	status = "okay";
};

&ml_vipsi {
	status = "okay";
};

&vpu_g1 {
	status = "okay";
};

&vpu_g2 {
	status = "okay";
};

&vpu_vc8000e {
	status = "okay";
};

&vpu_v4l2 {
	status = "okay";
};

The patch for the panel-simple driver remains unchanged.

When I use this overlay I got following errors during bootup:

[    9.409858] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e60000 to encoder DSI-34: -19
[    9.421563] imx_sec_dsim_drv 32e60000.mipi_dsi: Failed to attach bridge: 32e60000.mipi_dsi
[    9.430049] imx_sec_dsim_drv 32e60000.mipi_dsi: failed to bind sec dsim bridge: -517

Why does drm_brdige_attach fail? Did I forgot something in my overlay?

Best regards,
Markus

Hi @Mowlwurf ,

Thanks for reaching out.

Out of curiosity, do you get any output on the DSI interface? Or does it stay simply black?

Best Regards
Kevin

Hello @kevin.tx,

the error message is displayed several times, the display stays black and weston fails to start.

Best regards,
Markus

Hi @Mowlwurf!

Could you please update your BSP to the latest quarterly (currently 6.5.0)? BSP 6.2.0 is not maintained.


From the device tree you shared, I see:

For the same pin you commented that it is active low, but you set it as GPIO_ACTIVE_HIGH. Maybe it should be GPIO_ACTIVE_LOW according to you comment?


From the solution of another thread of yours (below),

I assume you have applied the same patch to the panel_simple, right? If yes, have you tried it without that patch?

Best regards,

Hello @henrique.tx,

I updated the BSP to 6.5 but the error remains.

What is worse than no comments? Wrong comments!
The panel-simple driver requires an enable-gpio. But since the used panel has no enable input this pin isn’t used on our carrier board and the pin definition is meaningless. I’m using the same panel-node definition in the device tree for the imx8mm without any problems.

Yes. Since the imx8mm and imx8mp have the same kernel source I’m using the same patch for the panel-simple driver to add the timings and characteristics of our panel.
When I disable the patch the error remains the very same. So I would assume the error happens before the panel-simple driver is even called.

Best regards,
Markus

Hello,

I tried to make a minimal example with the imx8mm and the imx8mp on BSP6.5 that you guys can reproduce the issue.

Now I get the error on both SOCs.
This is interesting. What is the difference between the two yocto builds for the imx8mm that one of them works and the other one does not?

I will dig into this and will tell when I found something …

Best regards,
Markus

Hello,

the longer you search for a bug, the smaller the fix is.

The reason for error -19 was a line in the overlay in which I changed the PWM polarity of the backlight. Node pwm1 was used instead of node pwm3. I unfortunately omitted this line in my start post.

But even after correcting this error, the display remained dark. The cause was that the MIPI_DSI_MODE_LPM flag was set in my driver patch for the display.
The GPU driver for the iMX8MM seems to ignore this flag, whereas it is relevant for the iMX8MP.

And as soon as you do it right, it works …

During my tests, however, I noticed that the kernel 5.15.129 of BSP V6.4 shows a different behavior. With version 5.15.77 of V6.3, the display is loaded correctly immediately, but with V6.4 it only works on the second attempt. The first time there is again an error -19 (failed to attach bridge).
To reproduce this behavior, it is sufficient to create a tdx-reference-minimal-image and write this overlay into the overlay.txt:
verdin-imx8mp_panel_simple_vvx10f004b00.dts (1.2 KB)

In addition, the tv080wum-nl0 panel from the panel-simple.c driver works with BSP6.3, while error -22 (unsupported dsi mode) occurs with BSP 6.4. With the panel ld070wx3-sl01 it is the other way around.

What do you think about this?

Best regards,
Markus