HDMI+LVDS0 Mirror IMX6 Solo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HDMI+LVDS0 Mirror IMX6 Solo

Jump to solution
6,282 Views
luisrobertotogo
Contributor II

Hello:

 

I'm having a real bad time trying to setup HDMI+LVDS0 display mirror in IMX6 Solo.

 

I have gone through several posts regarding this issue but non of them work.

 

Here my setup:

 

1) I'm using Wandboard Solo with a custom carrier board

2) Yocto Dizzy (Linux 3.10.17)

3) I have a 1024x600 LVDS screen connected to LVDS0

4) I have a remote "monitor" 1024x600 on HDMI

 

This is my configuration on the dtb:

 

mxcfb1: fb@0 {
compatible = "fsl,mxc_sdc_fb";
disp_dev = "hdmi";
interface_pix_fmt = "RGB24";
mode_str ="1280x720M@60";
default_bpp = <24>;
int_clk = <0>;
late_init = <0>;
status = "disabled";
};

 

mxcfb2: fb@1 {
compatible = "fsl,mxc_sdc_fb";
disp_dev = "ldb";
interface_pix_fmt = "RGB24"; /*TOGO CHANGED INTERFACE TO RGB888*/
mode_str ="LDB-WXGA"; /*TOGO MUST BE CHANGED TO WSVGA*/
default_bpp = <24>; /*TOGO CHANGED TO 24BITS*/
int_clk = <0>;
late_init = <0>;
status = "disabled";

};

 

&hdmi_core {
ipu_id = <0>;
disp_id = <0>;
status = "okay";
};

 

&ldb {
ipu_id = <0>;
disp_id = <1>;
ext_ref = <1>;
mode = "sin0";
sec_ipu_id = <1>;
sec_disp_id = <1>;
status = "okay";
};

 

Here my bootargs:

setenv bootargs console=ttymxc0,115200 root=/dev/mmcblk0p2 rootwait rw video=mxcfb0:dev=ldb,LDB-WSVGA,if=RGB888 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24

 

Now this is my situation:

I have a total of 6 boards, 3 of them perform the mirror perfectly using the configurations above, the other 3 just show LVDS0 and HDMI is OFF.

 

I have swapped boards and so on and the failure always follows the "cpu", for instance if I take the sdcard from a "good" CPU and place it in a "bad" CPU the issue is still on the bad CPU. If I swap carriers between a bad CPU and a good CPU then again the failure follows the CPU.

 

I know HDMI is working on the "bad" CPUs because when I enter to uboot I can see the "Wandboard" logo on the HDMI monitor.

 

Could it be possible that the "bad" CPUs are somehow damaged? But could it be that only the screen mirror is damaged? All other functions of the board are working 100%

 

I checked the boot-up log and dmesg and didn't find any significant difference.

 

I would really appreciate any input you might have, this issue is driving really me crazy.

 

UPDATE 1: today I switched ON a "bad" board and I was able to see TUX on the HDMI monitor, later on when the application started TUX is gone and I have no longer HDMI video. I switched OFF/ON the board and again HDMI is not shown any longer... This tells me again HDMI is fine on the PCB and seems to be an initialization problem.

 

UPDATE 2: attached the DMESG of a "bad " cpu, in general it looks the same as a "good" cpu; I notice that LVDS0  is changed from DI1 to DI0 by the LDB driver which theoretically will conflict with HDMI; but the funny thing is that the same setup and same configuration works OK on the "good" CPUs, thus this seems not to be the problem.

 

Thanks!

Togo

Original Attachment has been moved to: dmesg.log.zip

0 Kudos
1 Solution
3,522 Views
luisrobertotogo
Contributor II

Finally found the problem!

I don't know why by the HDMI PHY was reset and disabled after uBoot on some boards.

So, what I did is to re-enable the PHY after kernel start by using a script and the devregs tool. My script is:

./devregs CCM_CCGR2 0x00ff0033

./devregs 0x124005.b 1

./devregs 0x124005.b 0

I call the script at start-up(via rc.d) and now I get a perfect HDMI + LVDS0 mirror without the need of any other hack.

Please be aware this will only work with a uBoot version that pre-configures the HDMI PHY (ie. to show a splash screen). 

At the end the idea is to use ipuo, di0 for both HDMI and LVDS0 so that the are mirrowed. In my case I configure the framebuffer using LVDS and just enable the HDMI PHY and connect it to the same DI as LVDS0.

Regards!

Togo

View solution in original post

0 Kudos
15 Replies
3,522 Views
hyobokahn
Contributor II

Hello Luis.

I'm trying to make mirror display on LVDS and HDMI.

But, I fail and I guess current driver do not support dual display(mirror display).

How did you get mirror display driver?

May I ask you share your linux driver for dual display?

I use 4.1.15 and I try 3.0.35 kernel, but fail.

any kernel version is fine. I want to see working driver.

Thanks.

0 Kudos
3,522 Views
mdw
Contributor I

I have managed to do it. Look at my response above.

0 Kudos
3,522 Views
luisrobertotogo
Contributor II

Hello:

More hints!, I have been able to make an external HDMI monitor to work and also the LVDS LCD but unfortunately not at the same time as in the "good" CPU.

It seems that uBoot is configuring the HDMI PHY and somehow linking it to the LVDS0 output (using same IPU and DI) and the configuration stays as it is in the "good CPUs", is this possible?

Now that I'm 100% sure HDMI is operation and LVDS is operational separately in the "bad CPUs" how can I perform a mirror of both? 

Regards!

0 Kudos
3,523 Views
luisrobertotogo
Contributor II

Finally found the problem!

I don't know why by the HDMI PHY was reset and disabled after uBoot on some boards.

So, what I did is to re-enable the PHY after kernel start by using a script and the devregs tool. My script is:

./devregs CCM_CCGR2 0x00ff0033

./devregs 0x124005.b 1

./devregs 0x124005.b 0

I call the script at start-up(via rc.d) and now I get a perfect HDMI + LVDS0 mirror without the need of any other hack.

Please be aware this will only work with a uBoot version that pre-configures the HDMI PHY (ie. to show a splash screen). 

At the end the idea is to use ipuo, di0 for both HDMI and LVDS0 so that the are mirrowed. In my case I configure the framebuffer using LVDS and just enable the HDMI PHY and connect it to the same DI as LVDS0.

Regards!

Togo

0 Kudos
3,522 Views
joeservo
Contributor III

did you ever get the mirroring to work? not sure i understand your solution correctly. 

i have the same setup and added the devregs to a script, i dont get a mirroring of my displays.  i dont think my setup requires it to be honest. did you have to change something with the ipu/di as well? 

0 Kudos
3,522 Views
luisrobertotogo
Contributor II

Hi Joe:

Yes, it worked perfectly. Are you using Yocto?

The linux drivers seem to not allow to have the LVDS0 and HDMI connected to the same IPU and DI; if you try to do this via dtb you will get an error either on LVDS0 or HDMI depending on the interface that is setup first.

If you configure a different IPU and DI then basically you will get two frame buffers and you can't perform the mirror easily.

In order to make this work you will have to hack a bit the system.

In my case I setup the kernel to boot with LVDS0 in IPU0/DI0; uBoot pre-configured HDMI to be in IPIU0/DI0 as well but some cases the kernel disabled HDMI (don't know why).

I used devregs to re-enable HDMI once the kernel started (that is basically what the script does), but all registers of HDMI were pre-configured by uBoot already.

If you are using Wandboard and Yocto Dizzy you will notice that in uBoot HDMI is enabled showing the Wandboard Logo.

My suggestion is, make sure LVDS0 works by itself first and also that you get HDMI video in uBoot.

If both work OK then you very likely will have the same problem I had.

In my case devregs didn't work for Wandboard Solo, so I had to hack it as well to force CPU detection.

I hope this helps to solve this issue if not just let me know.

Regards!

Togo

0 Kudos
3,522 Views
joeservo
Contributor III

i am using timesys linux. 

both lvds/hdmi work perfectly, the reason i want to mirror the displays is two fold

1, i develop with an lvds display but my end application uses hdmi.

2, the boot logo does not show up with hdmi as my primary display. works with lvds.

so if i mirror displays i was hoping it would fix both of these in one change.

u-boot has both lvds and hdmi mirrored so i know its possible. 

i looked at my dts settings and both ldb and hdmi_core are set to the same ipu_id. i do get a warning about the ipu already being used so not sure if it is related.

mxc_sdc_fb fb.29: ipu0-di0 already in use

i also tried your script and it only resets my hdmi video. if you have any info on how to hack to use the same ipu i would appreciate it.

0 Kudos
3,522 Views
luisrobertotogo
Contributor II

Got you!

Can you share your dtb configuration and bootargs related to video(HDMI, LVDS and Framebuffers)?

The LVDS driver won't allow you to use the same DI and IPU as HDMI and will try to change it to an available one (at least this happens on kernel 3.10.17).

In my case I only enable LVDS in bootargs and then force HDMI to use the same DI and IPU.

Regards!

Togo

0 Kudos
3,522 Views
joeservo
Contributor III

i've tried so many different bootargs, but the one i intend to use is this (video stuff only)

video=mxcfb0:dev=hdmi,1024x600M@60,if=RGB24 fbmem=28M mxc_hdmi.only_cea=0 consoleblank=0 video=mxcfb1:dev=ldb,LDB-WSVGA,if=RGB666

attached is the dtsi i am using. i noticed the disp_id is not the same bewteen hdmi/lvds so i am compiling a new kernel with them the same. i think the warning i got was for the lcd

0 Kudos
3,522 Views
luisrobertotogo
Contributor II

Can you try:

video=mxcfb0:dev=ldb,LDB-WSVGA,if=RGB666 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB666 

I believe 1024x600 is not a valid resolution for HDMI...

Make sure both HDMI and LDB have the same IPU and DI

&hdmi_core {
ipu_id = <0>;
disp_id = <0>;
status = "okay";
};

&ldb {
ipu_id = <0>;
disp_id = <0>;
ext_ref = <1>;
mode = "sin0";
sec_ipu_id = <1>;
sec_disp_id = <1>;
status = "okay";
};

If you don't use LCD just disable it or send it to another IPU and DI.

lcd@0 {
compatible = "fsl,lcd";
ipu_id = <0>;
disp_id = <1>;
default_ifmt = "RGB565";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_4>;

Regards!

0 Kudos
3,522 Views
joeservo
Contributor III

i understand 1024x600 is not a common resolution but it is what my glass handles. i design custom displays and have the receiving end taken care of. i have to trick the imx with fake EDID info, hence the only_cea=0. but to simplify things, i am connected to a monitor that can handle 1024x768 or 1280x720. my lvds panel can handle 1024x768 timing so i can make them both the same if you really have your doubts.

i tried making the ipu_id and disp_id the same in my dts file and it fails to create fb2 with a warning of 'ipu0-di0 already in use'. only the display i pass as mxcfb0 gets created. this was with your recommended bootargs (and mine).

0 Kudos
3,522 Views
luisrobertotogo
Contributor II

Correct! that is the idea behind, you shall have a single framebuffer!

Pass the arguments in such a way that only LDB works, then you could have a look using devregs on the different registers of the HDMI phy to check if it is correctly configured. If it does then you only need to enable the clocks and reset the PHY so that the mirror works.

In my case I compared the initialization performed by uBoot vs the value of the registers of the HDMI PHY to verify if they were correctly set after kernel start.

Regards!

Togo

0 Kudos
3,522 Views
mdw
Contributor I

Okay, found the solution with kernel 4.1.15:

  • I needed to have the HDMI and LVDS be set to the same IPU and display (as already told by Luis)
    e.g. on my Variscite VAR-SOM-MX6 board it works like this (caveat: in hdmi_core the IPU enumeration starts with 0, not 1)
    imx6q-var-som.dtsi
    ...
    &ldb {
            lvds-channel@0 {
                    crtc = "ipu1-di0";
            };

            lvds-channel@1 {
                    crtc = "ipu2-di0";
            };
    };
    ...
    imx6qdl-var-som.dtsi
    ...
    &hdmi_core {
            ipu_id = <0>;
            disp_id = <0>;
            status = "okay";
    };
    ...
  • I let both the fb0 and fb1 enabled and disabled fb2 and fb3, where fb0 points to the LVDS and fb1 to the HDMI.
    imx6q-var-som.dtsi
    ...
    &mxcfb1 {
            status = "okay";
    };

    &mxcfb2 {
            status = "okay";
    };

    #if 0
    &mxcfb3 {
            status = "okay";
    };

    &mxcfb4 {
            status = "okay";
    };
    #endif
    ...
    imx6qdl-var-som.dtsi (practically unchanged in my case)
    ...
            mxcfb1: fb@0 {
                    compatible = "fsl,mxc_sdc_fb";
                    disp_dev = "ldb";
                    default_bpp = <32>;
                    int_clk = <0>;
                    late_init = <0>;
                    status = "disabled";
            };

            mxcfb2: fb@1 {
                    compatible = "fsl,mxc_sdc_fb";
                    disp_dev = "hdmi";
                    interface_pix_fmt = "RGB24";
                    mode_str ="1920x1080M@60";
                    default_bpp = <32>;
                    int_clk = <0>;
                    late_init = <0>;
                    status = "disabled";
            };

            mxcfb3: fb@2 {
            ...
            };

            mxcfb4: fb@3 {
            ...
            };
    ...
  • last but not least (very important) I had to patch the MXC IPUv3 driver, so that it allowed the HDMI driver to be load on the same IPU and display. This is the patch:
    diff --git a/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c b/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c
    index e61ef67..4b836d3 100644
    --- a/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c
    +++ b/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c
    @@ -3492,12 +3492,14 @@ static int mxcfb_probe(struct platform_device *pdev)
            if (ret < 0)
                    goto init_dispdrv_failed;

    +#if 0
            ret = ipu_test_set_usage(mxcfbi->ipu_id, mxcfbi->ipu_di);
            if (ret < 0) {
                    dev_err(&pdev->dev, "ipu%d-di%d already in use\n",
                                    mxcfbi->ipu_id, mxcfbi->ipu_di);
                    goto ipu_in_busy;
            }
    +#endif

Now the HDMI-LVDS mirroring on /dev/fb0 and its overlay /dev/fb1 is working like a charm. In my case the HDMI output resolution is automatically reduced to the LVDS one which is just 800x480 pixels.

0 Kudos
3,522 Views
joeservo
Contributor III

i commented out a line of code in mxc_ipuv3_fb.c that checks for duplicate ipu/di settings and got closer, fb2 was mirrored. if i write to fb0 i get nothing.  that was only if i pass mxcfb0:hdmi and mxcfb1:ldb, any other way it trips up on edid data and never completes the bootup. i may go back to original kernel and just manually set the registers to the correct fb address.

0 Kudos
3,522 Views
luisrobertotogo
Contributor II

I'm executing more tests but still can't find the problem :smileysad:, is there someone that might have already configured the HW in this manner?

Thanks!

0 Kudos