Torizon: Issues with LVDS and device tree overlay (Apalis iMX6)

Hi team,

I’m currently finishing some documentation for some new displays, and to round it up, I’m also adding the needed changes for Torizon, in the form of DTOs. However, during this process I had a couple of issues.

  1. Once understood a bit the DTO syntax, and launching process, I tried to create a DTS based on the 10.1" display that we have, but with the timings of the given display (a WVGA, 800x480 one). I activated the enable_lvds_display_apalis_imx6.dts.dtbo and my recently created one.

Unluckily it didn’t work as expected, and the image seemed cropped, like if it was using the 10.1" LVDS timings instead. Needless to say that the 10.1" DTO was not activated.

After some trial and error, and trying to understanding what was going on, I could found a working scenario (to which doesn’t make much sense to me).

## dtconf activate enable_lvds_display_apalis_imx6.dts
## dtconf activate --no-git-repo /dts/mydisplay.dts

AND

## dtconf activate enable_lvds_display_apalis_imx6.dts
## dtconf activate display_10.1_lvds_cap_touch.dts

have the same outcome.

But if I only apply the enable_lvds_display_apalis_imx6.dts one, I get an (expected) error message that no timings are found.

The DTO in question:

/dts-v1/;
/plugin/;

/ {
    compatible = "toradex,apalis_imx6q";

    fragment@0 {
        target-path="/panel-lvds";
        __overlay__ {
            status = "okay";
            data-mapping = "vesa-24";
            width-mm = <193>;
            height-mm = <130>;
            panel-timings {
                clock-frequency = <30400000>; //30.4 MHZ
                hactive = <800>;
                vactive = <480>;
                hback-porch = <112>;
                hfront-porch = <32>;
                vback-porch = <3>;
                vfront-porch = <17>;
                hsync-len = <80>;
                vsync-len = <4>;
                hsync-active = <0>;
                vsync-active = <0>;
                pixelclk-active = <0>;
            };
        };
    };
};

I even tried reducing the hactive and vactive to half, disable and reactivate the DTS but no change whatsoever. It looks like LVDS 10.1" values are hardcoded behind the DTO, and any additional DTO won’t make any change.

However, if I remove all the display timings and keep enable_lvds_display_apalis_imx6 I get the expected error:

Starting kernel ...

[    1.183694] /ldb/lvds-channel@0: could not find display-timings node
[    1.190054] /ldb/lvds-channel@0: no timings specified
[    1.195147] imx-ldb ldb: could not determine data mapping: -22
[    1.201000] imx-drm display-subsystem: failed to bind ldb (ops imx_ldb_ops): -22
[    2.331916] imx6q-pcie 1ffc000.pcie: Phy link never came up
Error opening /dev/fb0
Starting version 243+

2 . So in order to workaround this, I tried to use the former approach and access the ldb node directly instead of the panel-lvds node which seems buggy.
So this is the following DTS (I disabled enable_lvds_display_apalis_imx6) :

/dts-v1/;
/plugin/;

/ {
    model = "Toradex Apalis iMX6Q/D Module";
    compatible = "toradex,apalis_imx6q", "fsl,imx6q";

    fragment@0 {
        target = <&ldb>;
        __overlay__ {
            status = "okay";
            lvds-channel@0 {
                reg = <0>;
                status = "okay";
                fsl,data-mapping = "spwg";
                fsl,data-width = <24>; //Selected by pin 19 of the LVDS connector
                crtc = "ipu2-di1";
                display-timings {
                    native-mode = <&mitsubishi_7>;

                    /* Mitsubishi 7", WVGA" */
                    mitsubishi_7: 800x480 {
                        clock-frequency = <30400000>; //30.4 MHZ
                        hactive = <800>;
                        vactive = <480>;
                        hback-porch = <112>;
                        hfront-porch = <32>;
                        vback-porch = <3>;
                        vfront-porch = <17>;
                        hsync-len = <80>;
                        vsync-len = <4>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        pixelclk-active = <0>;
                    };
                };
            };
            lvds-channel@1 {
                reg = <1>;
                fsl,data-mapping = "spwg";
                fsl,data-width = <24>; //Selected by pin 19 of the LVDS connector
                crtc = "ipu1-di0";
                status = "okay";
                display-timings {
                    native-mode = <&mitsubishi_7_ch2>;

                    /* Mitsubishi 7", WVGA" */
                    mitsubishi_7_ch2: 800x480 {
                        clock-frequency = <30400000>; //30.4 MHZ
                        hactive = <800>;
                        vactive = <480>;
                        hback-porch = <112>;
                        hfront-porch = <32>;
                        vback-porch = <3>;
                        vfront-porch = <17>;
                        hsync-len = <80>;
                        vsync-len = <4>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        pixelclk-active = <0>;
                        };
                };
            };
        };
    };
};

Since I’m also testing the double channel capabilities, I hooked up 2 exact same displays that use a single LVDS each.

By launching the above DTO, I get the image correctly displayed but only on the second LVDS channel! (at lvds-channel@1). Only a single /dev/fb0 (no /dev/fb1) that is routed to the LVDS channel B (Confirmed this by sending /dev/random to it). What is the current/expected support for +2 framebuffers?

3 . So I did a couple of more tests (disabling previous DTO and activating the newer with the changes):

3.1. I tried exchanging the crtc variable between channels: No change, I still only have image in channel B.

3.2. I removed the lvds-channel@1 node, leaving only the lvds-channel@0: I get no image in either channel (but on restart I see the login image as it is a backlight issue)

3.3. I removed the lvds-channel@0 node, leaving only the lvds-channel@1: I get no image in either channel with the same error at question 1 that /ldb/lvds-channel@0: could not find display-timings node

So this approach seems quite buggy as well… Any help would be appreciated to get this done, I’m out of ideas, but feel free to create a ticket.

Thanks.
Alvaro.

Hi @alvaro.tx,

Just to clarify you are connecting completely different displays correct? Not our off the shelf 10.1’’ one correct?

I tried applying the below overlay which is identical to yours except I also changed width-mm and height-mm to match hactive/vactive (don’t think this actually affects anything).

/dts-v1/;
/plugin/;

/ {
        compatible = "toradex,apalis_imx6q";

        fragment@0 {
                target-path="/panel-lvds";
                __overlay__ {
                        status = "okay";

                        data-mapping = "vesa-24";
                        width-mm = <800>;
                        height-mm = <480>;

                        panel-timing {
                                clock-frequency = <30400000>;
                                hactive = <800>;
                                vactive = <480>;
                                hback-porch = <112>;
                                hfront-porch = <32>;
                                vback-porch = <3>;
                                vfront-porch = <17>;
                                hsync-len = <80>;
                                vsync-len = <4>;
                                hsync-active = <0>;
                                vsync-active = <0>;
                                pixelclk-active = <0>;
                        };
                };
        };
};

So the resolution does change on my connected hdmi monitor to a smaller what I assume to be 800x480 resolution. The off the shelf Toradex 10.1’’ doesn’t display anything except the backlight but this is expected since the timings are completely off for this display. Running fbset on TorizonCore also reports that the resolution is 800x480.

Unfortunately, I don’t have enough displays here to really test what you’re seeing with the dual channel. Perhaps @stefan.tx could chime in and comment on the behaviors you’re seeing.

Best Regards,
Jeremias

Hi @jeremias.tx,

Just to clarify you are connecting completely different displays correct? Not our off the shelf 10.1’’ one correct?

Not sure what you mean by completely different: They are different providers, they have different timings and resolution (this is a 7" WVGA) but the signals and connection to our LVDS connector is the same (because we have a cable that handles that).

So the resolution does change on my
connected hdmi monitor to a smaller
what I assume to be 800x480
resolution. The off the shelf Toradex
10.1’’ doesn’t display anything except the backlight but this is expected
since the timings are completely off
for this display. Running fbset on
TorizonCore also reports that the
resolution is 800x480.

Hmm, I believe you mean to your lvds display, not hdmi, right? Can you tell me how you see the difference? How I see myself it doesn’t work in my WVGA display is that only a portion of the Torizon loading screen is shown (top left corner).

I can try to see what happens if I change the default 10.1" one to a smaller resolution in our LVDS but I’m afraid that we are still in the same as for solving the issue… (So still any help is appreciated)

Hi @alvaro.tx

Not sure what you mean by completely
different: They are different
providers, they have different timings
and resolution (this is a 7" WVGA) but
the signals and connection to our LVDS
connector is the same (because we have
a cable that handles that).

This is what I meant, I was just clarifying for myself.

Hmm, I believe you mean to your lvds
display, not hdmi, right? Can you tell
me how you see the difference? How I
see myself it doesn’t work in my WVGA
display is that only a portion of the
Torizon loading screen is shown (top
left corner).

No I do mean my HDMI, changing the resolution for the LVDS does change the resolution on my HDMI as well. When no overlays are set the intial Torizon splash screen that occurs on boot is a full 1920x1080. When I set an overlay that changes LVDS resolution then reboot, the splash screen size shown on my HDMI changes accordingly as well.

To clarify as expected I see nothing but the backlight on the off the shelf 10.1’’ LVDS when I try to change timings/resolutions.

Hi @jeremias.tx @stefan.tx , the HDMI thing gave an idea to further see what is going on, so I went to test this with the double LVDS displays and the HDMI connected.

  1. Using directly the ldb node, with both channels, I get image in the HDMI and the LVDS_B display. Only a single FB used tho. The image displays at the correct resolution (cropped in a Full HD screen)
  2. Using directly the ldb node, with only channel 0, only HDMI image, but again, when restarting got that flicker, which led me to think that it is related to the backlight. So, since the LVDS A display uses an internal backlight circuit (through the LVDS connector) while the one at LVDS B, used an external one, I decided to swap them and it worked. So the problem with the ldb approach is that the backlight part is not correctly taken care of, but the timings are OK. So probably I’m ovewritting the original BL pinmux values (Where are those defined?)
  3. With the panel-lvds approach, tried the 400x240 DTO but it only displays at Full HD on the HDMI screen: The timings are not correctly set.

To clarify as expected I see nothing
but the backlight on the off the shelf
10.1’’ LVDS when I try to change timings/resolutions.

I get the same result (only backlight on my LVDS display) but I wouldn’t say this is expected as the HDMI keeps using the Full HD resolution instead of adjusting… Feel free to try my ldb node with the 800x480 resolution. You will get an image of that size in the HDMI screen AND image as well in the display (if you were using an external backlight circuit).

Just to be sure, I went through the ldb approach with an adjusted resolution/timing of 400x240: The image was shown several times, but it was there in both the LVDS display and cropped in the HDMI display.

In my opinion, the lvds-panel approach has a bug or simply I’m not doing things correctly, since by copying and adjusting the timings of the LVDS display through there, it seems to always output the 10.1" LVDS display resolution.

For reference, this is my panel-lvds DTO:

/dts-v1/;
/plugin/;

/ {
    compatible = "toradex,apalis_imx6q";

    fragment@0 {
        target-path="/panel-lvds";
        __overlay__ {            
            status = "okay";
            data-mapping = "vesa-24";
            width-mm = <193>;
	    height-mm = <130>;
	    panel-timings {
                clock-frequency = <30400000>; //30.4 MHZ
                hactive = <400>;
                vactive = <240>;
                hback-porch = <112>;
                hfront-porch = <32>;
                vback-porch = <3>;
                vfront-porch = <17>;
                hsync-len = <80>;
                vsync-len = <4>;
                hsync-active = <0>;
                vsync-active = <0>;
                pixelclk-active = <0>;
            };                                      
        };
    };  
};

I could confirm that even with this DTO, the image the 10.1" LVDS remains unchanged with and without the HDMI connected ( fbset shows the 1280x800 mode).

Did you get the HDMI scaled down through by changing the panel-lvds in a DTO? I could only get 1280x800.

Regards,
Alvaro.

Hi @alvaro.tx,

So I figured out what’s wrong with your overlays and I’m slightly embarrassed for not noticing sooner.

The node for your timings panel-timings is wrong you appended an extra (s) the proper binding is panel-timing. Once I removed the (s) and applied your overlay my HDMI monitor had a very small what appears to be 400x240 splash screen.

I’m not sure why the timings/resolution default to the proper 1280x800 of the 10.1’’ LVDS though.

Just for reference here’s your overlay I modified:

/dts-v1/;  /plugin/;    / {
     compatible = "toradex,apalis_imx6q";
 
     fragment@0 {
         target-path="/panel-lvds";
         __overlay__ {            
             status = "okay";
             data-mapping = "vesa-24";
             width-mm = <193>;
         height-mm = <130>;
         panel-timing {
                 clock-frequency = <30400000>; //30.4 MHZ
                 hactive = <400>;
                 vactive = <240>;
                 hback-porch = <112>;
                 hfront-porch = <32>;
                 vback-porch = <3>;
                 vfront-porch = <17>;
                 hsync-len = <80>;
                 vsync-len = <4>;
                 hsync-active = <0>;
                 vsync-active = <0>;
                 pixelclk-active = <0>;
             };                                      
         };
     };     
 };

Literally the only difference is I removed the (s) on panel-timing.

Best Regards,
Jeremias

Hi @jeremias.tx , oh man… Well it is embarrasing for both of us, haha. Indeed, removing the (s) to panel-timing(s) fixed it! Thanks again!

Kind regards,
Alvaro.