Android lag and LVDS flicker on i.MX6 dual display setup

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

Android lag and LVDS flicker on i.MX6 dual display setup

Jump to solution
1,915 Views
valts
Contributor II

I am trying to get dual display support working for Android 5.1.1 for a device based on Variscite VAR_SOM_MX6 with i.MX6 Dual.
I have a 1280x800 panel on LVDS0 and an HDMI port that I intend to drive at the same resolution. I have managed to get Android displayed in mirror mode on both displays, but when HDMI is plugged in, Android becomes very sluggish (framerate may be around 5fps) and the LVDS panel starts to flicker as if the clock frequency was wrong.

I also tried this on i.MX6 Quad and I set hdmi_core to ipu_id = <1> to use the other IPU, but the result was the same.

I have spent multiple days experimenting with this but I can't find a configuration that doesn't lag. Either LVDS or HDMI works smoothly with no lag.

Any help would be greatly appreciated! I am getting desperate by now with a tight deadline on this.

I use the following bootargs:

console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off video=mxcfb3:off fbmem=24M vmalloc=400M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled

And these are relevant fragments of the board device tree:

&hdmi_core {

  ipu_id = <0>;

  disp_id = <1>;

  status = "okay";

};

&hdmi_video {

  fsl,phy_reg_vlev = <0x0294>;

  fsl,phy_reg_cksymtx = <0x800d>;

  status = "okay";

};

&ldb {

  status = "okay";

  lvds-channel@0 {

     fsl,data-mapping = "spwg";

     fsl,data-width = <24>;

     primary;

     status = "okay";

     display-timings{

         native-mode = <&timing0c>;

         timing0c: hsd100pxn1 {

             clock-frequency = <72000000>;

             hactive = <1280>;

             vactive = <800>;

             hback-porch = <39>;

             hfront-porch = <39>;

             vback-porch = <29>;

             vfront-porch = <13>;

             hsync-len = <47>;

             vsync-len = <2>;

         };

     };

  };

};

&ldb {

  lvds-channel@0 {

    crtc = "ipu1-di0";

  };

};

&mxcfb1 {

  status = "okay";

};

&mxcfb2 {

  status = "okay";

};

Some relevant lines from the boot log:

ccm: ldb_di_sel already changed from reset value

failed to set parent of clk ldb_di0_sel to pll5_video_div: -38

failed to set parent of clk ldb_di1_sel to pll5_video_div: -38

failed to set parent of clk gpu2d_core_sel to pll2_pfd1_594m: -22

Switching to timer-based delay loop

sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655765682ns

Console: colour dummy device 80x30

Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)

pid_max: default: 32768 minimum: 301

...

mxc_sdc_fb fb.25: registered mxc display driver ldb

imx-ipuv3 2400000.ipu: IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)

Console: switching to colour frame buffer device 160x50

mxc_hdmi 20e0000.hdmi_video: Detected HDMI controller 0x13:0x1a:0xa0:0xc1

fbcvt: 1280x720@60: CVT Name - .921M9

mxc_sdc_fb fb.26: registered mxc display driver hdmi

imx_epdc_fb 20f4000.epdc: can't get/select pinctrl

Labels (1)
0 Kudos
1 Solution
1,061 Views
valts
Contributor II

Problem solved. I am not sure which clock was set as the LDB clock parent initially, but it clearly didn't have a high enough frequency to drive 2 screens. After adding the following lines to the device tree, the flickering stopped and performance became smooth:

&clks {

  fsl,ldb-di0-parent = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;

  fsl,ldb-di1-parent = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;

};

View solution in original post

0 Kudos
4 Replies
1,062 Views
valts
Contributor II

Problem solved. I am not sure which clock was set as the LDB clock parent initially, but it clearly didn't have a high enough frequency to drive 2 screens. After adding the following lines to the device tree, the flickering stopped and performance became smooth:

&clks {

  fsl,ldb-di0-parent = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;

  fsl,ldb-di1-parent = <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;

};

0 Kudos
1,061 Views
valts
Contributor II

Hi Igor,

Thanks for the quick help!

I tried using the settings in the user's guide you attached. In fact changing the HDMI mode to 1920x1080M@60 as suggested in the guide improved Android performance and reduced lag. It is still laggy and the refresh rate is slow, but at least it is usable.

However LVDS panel is still flickering when HDMI is connected.

I did an experiment and reduced the LVDS clock-frequency to 36Mhz in device tree. The result was that LVDS flickered the same way that it does when HDMI is plugged in, but even if HDMI is NOT plugged in. This suggests that when clock-frequency is set to 72Mhz as it should be, i.MX6 for some reason can't supply such a high frequency when HDMI is plugged in. Is there a max LVDS frequency when HDMI is plugged in?

Thank you!

Best Regards,

Valts

0 Kudos
1,061 Views
igorpadykov
NXP Employee
NXP Employee

Hi Valts

this may be performance issue, one can try with linux removing

all drivers except LVDS panel and HDMI.

Best regards

igor

0 Kudos
1,061 Views
igorpadykov
NXP Employee
NXP Employee

Hi Valts

one can try this configuration with nxp L3.14.52, it can be found on link

i.MX 6 Series Software and Development Tool|NXP

this kernel is used for Android 5.1.1, please refer to attached Linux Guide

p.25 "Specifying displays".

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos