Configuration of display settings and timings on IMX6

Hello,

I have the following u-boot commandline:

setenv vidargs video=mxcfb0:dev=lcd,480x854M@60,if=RGB24,bpp=32,outputen=1,pixclockpol=0 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M 

Does setting outputen and pixclockpol like this also work for imx6?

Further, I have the following device-tree configuration. But after boot, fbset has / comes up with wrong settings. Is the mode_str wrong? Why does the kernel not take the settings for timings and mode_str? Maybe outputen and pixclockpol is also wrong then? Btw. fw_printenv shows the correct settings…

lcd: lcd@0 {
	compatible = "fsl,lcd";
	ipu_id = <0>;
	disp_id = <1>;
	default_ifmt = "RGB24";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ipu1_lcdif>;
	status = "disabled";
};

mxcfb1: fb@0 {
	compatible = "fsl,mxc_sdc_fb";
	disp_dev = "lcd";
	interface_pix_fmt = "RGB24";
	mode_str ="480x854M@60";
	default_bpp = <32>;
	int_clk = <0>;
	late_init = <0>;
	status = "disabled";
};


&lcd {
	status = "okay";

	 display = <&display0>;
  

    display0: lcd-display {
        bits-per-pixel = <32>;
        bus-width = <32>;

        display-timings {
            native-mode = <&timing_densitron>;

           
            timing_densitron: 480x854{
                clock-frequency = <26503680>;
                hactive = <480>;
                vactive = <854>;
                hback-porch = <5>;
                hfront-porch = <6>;
                vback-porch = <14>;
                vfront-porch = <14>;
                hsync-len = <2>;
                vsync-len = <2>;

                de-active = <1>;
                hsync-active = <0>;
                vsync-active = <0>;
                pixelclk-active = <0>;
            };
        };
    };
};
&mxcfb1 {
	status = "okay";
};

I can set the display timings via xrandr. But the display is flickering and colors are wrong.

Regards,
M. Kock

hi @mkock

Welcome to the Toradex Community!!!

Could you provide the datasheet of the display? Please share also the dmesg log in a file.

Thanks and best regards, Jaski

link to the log files and datasheets

Hello,
the display needs to be initialized via SPI, video data is transfered via RGB. The SPI initialization code directly comes from densitron (SPI.cpp). The functions write_command(0x21) and write_data(0x03) set data enable (DE) to active high and clock polarity to falling time for RGB signal (see page 184 in IL9806E.pdf)

This should match the settings in Dts and u-boot command line:

outputen=1,pixclockpol=0

de-active = <1>;
                hsync-active = <0>;
                vsync-active = <0>;
                pixelclk-active = <0>;

Bootparam+Vesa.txt contains the complete u-boot params. However after boot, the system comes up with wrong settings. xrandr commands need to be executed to set the right timings. The problem is: After running the SPI initialization code and setting the timings the display shows an image, but is flickering and colors are wrong. Text is not clear.

Regards,
Matthias Kock

hi @mkock

Thanks for the files. The settings seems to be correct. Just one question, in vertical the active pixels should be 864 to get a 9:4 format, instead of 854. Could you also send/upload the schematic showing the connection of the display to the carrier board? Please send also a picture of the screen showing the wrong colours. Thanks.

foto
schematic

I have set screen_height = 864 in my Matlab Script and calculated the following modeline: name 26.444520 480 486 488 493 864 878 880 894 -hsync -vsync

Not much change however (see screenshot).
The background is indeed green, the upper half of the screen is flickering. The mouse leaves back trails.

Regards

Thanks for the schematic and test picture.
Could you change the pixclockpol and check how the image on the display is changed?

Additionally could you show these two pictures on the screen and send a picture of the screen: TestPic1 and TestPic2.

Best regards

Setting pixclockpol=1 does not change the picture

 fw_printenv  |grep vidargs=
vidargs=video=mxcfb0:dev=lcd,480x864M@60,if=RGB24,bpp=32,outputen=1,pixclockpol=1 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

The following pictures were taken with pixclockpol=0:
link to photos

Please note that the text on the screen is not readable, the photos show this correctly.

For completeness: I am currently using the following display timings:
screen_width = 480;
hsync_start = 644;
hsync_end = 654;
h_total = 743;
screen_height = 854;
vsync_start = 864;
vsync_end = 874;
v_total = 897;
pixelcolck = 29.85

Linux modeline: 29.85 480 644 654 743 854 864 874 897

Best regards

These values confirm to:

screen_width = 480;
screen_height = 854;
HLW = 10;
HBP = 89; 
HFP = 164;

VLW = 10;
VBP = 23; 
VFP = 10; 
refresh_rate = 44.79;

I also tried with screen_height = 864 and refresh_rate = 60.
But I guess the problem lies somewhere else.

Regards

Dear @mkock

The test pictures show us, that you have a mismatch in the transfer of the data bits. The fact that there is a four time repetition in the gradient test picture indicates, that you are certainly using 18-bit on the display side instead of 24 bit.

In your SPI.cpp on line 426 and 427 you write 0x60 to the register 0x3A (called Interface Pixel Format, page 164 in the datasheet). This set 18-bit per pixel, while the used settings in the device tree sends 24-bit per pixel. Using 24 bit on the Apalis module is recommended, that’s ok. But could you please set 0x70 to this register and enable 24-bit?

write_command(0x3A);      
write_data(0x70); 

If it is not working like this, please repeat the test with the test-pictures.
Best regards
Diego

Dear @diego_b.tx,
thank you very much! I have overlooked that.

I have changed SPI.cpp accordingly and the gradient test picture now looks good:

[upload|9LE98GfLvBomzC9EhdbLxH7IhME=]

Also the other test image looks fine:
[upload|6p7TZFKeF01Im+ARnbhKWUN5NMI=]

The desktop background color however still does not look right:
[upload|iDupVWob3gIDi5XmwDWCA4AOaDE=]

The destroyed black areas on the screen (“mouse trails”), as can be seen in the first picture, only occur after having used the rotate function of X (The display is mounted in landscape mode).

Best regards,
mkock

The image is always the same, either booting with:

video=mxcfb0:dev=lcd,480x864M@60,if=RGB24,bpp=32,outputen=1,pixclockpol=0 
or
vidargs=video=mxcfb0:dev=lcd,480x864M@60,if=RGB24,bpp=24,outputen=1,pixclockpol=0 


&lcd {
	status = "okay";


	 display = <&display0>;
    /*status = "okay";*/

    display0: lcd-display {
        bits-per-pixel = <24>; //also tried with 32 here, no diffierence...
        bus-width = <32>;

Hi @mkock

The desktop background color however still does not look right: alt text
The destroyed black areas on the screen (“mouse trails”), as can be seen in the first picture, only occur after having used the rotate function of X (The display is mounted in landscape mode).

Could you post pictures for this?
Thanks.

What difference do you expect? The display cannot show more than 24bit per pixel.

The desktop background color however
still does not look right

red and blue were mixed. I could “fix” it by setting DefaultDepth 16
in /etc/X11/xorg.conf

So, is the issue solved?

The image looks good, but after rotating with xrandr -o left, the X-server seems to have problems. See this video.

Another question is still why after reboot the system does not take the display timings from the device tree, so that xrandr needs to be executed to apply the correct settings. In the meantime I have changed
the the first entry in the fb_videomode struct in drivers/video/fbdev/mxc/mxc_lcdif.c but I don’t think that this is actually the right approach.

Regards

The image looks good, but after rotating with xrandr -o left, the X-server seems to have problems. See this video.

Please have a look on these two posts: 1 and 2.

Another question is still why after reboot the system does not take the display timings from the device tree, so that xrandr needs to be executed to apply the correct settings. In the meantime I have changed the the first entry in the fb_videomode struct in drivers/video/fbdev/mxc/mxc_lcdif.c but I don’t think that this is actually the right approach.

You should not change the driver. Try deleting all the other display settings and only having your settings in the device tree files.

Thanks for the links.

Our application will run in a browser (full screen). So doing the rotation of 90 deg by the user application is not really an option. I have tried to rotate the website by JS, but the performance was even much worse than doing the rotation with X-server.
We know that doing the rotation with the X-Server will decrease performance, but it is still good enough.

The problem is, that the mouse cursor is not drawn correctly (see video above).

Currently in /etc/X11/xorg.conf there is Option “HWCursor” “false”

From what I have found on the net I don’t think that there is a working Kernel driver for imx6 available to do the rotation of 90 deg.

What do you think could be the best way trying to solve this issue?

Regards

I am also experiencing another issue:
There seems to be a “color dependent” flicker problem.

The following colors are always represented without flicker:

  • white
  • black
  • red
  • green
  • blue
  • purple(#FF00FF)
  • (#00FFFF)

Grey and dark grey is flickering the most. Sometimes more, sometimes less.

What could be the cause of that?
Regards

Could you make a test photo of just grey and dark grey and show the flickering?