Unable to change LCD parameters

Hello all,

I am a software engineer for aeronautic ( cabin entertainement and control ) and I have started a new project that require to use yocto.
First, I never worked with yocto before, I am learning to use this platform so maybe I could have some “weird” questions.

Here is my problem :

We have already worked with toradex since 2010 , and we have a product that use colibri T20 ( tegra 2 ) , and it works well. But we used this product with WinCE and now, WinCE is almost deprecated , and we want to upgrade our products with a new card and a new embedded system.

The upgrade has to be done in 2 steps :

  • one step without ( if possible ) hw modification , that’s why we choose colibri imx8x because it fits pin to pin to our actual carrier board.

  • another step with hw modification, and maybe apalis imx8m because we want to be 4k compatible. But it will be later.

Let’s talk about the first step.

Currently, I have only one colibri-imx8x card ( difficult to have one ) , and I don’t have any eval board ( did not received yet )

So my setup test for the moment is my old product , I plugged colibri-imx8x instead of colibri-T20 and all seems working well ( network, usb, serial ) except the LCD display ( the one with X1 connector “LCD RGB” ). Not all the picture is displayed, I have only 2/3 of the picture that is displayed. I wonder that the screen is 90° rotated.

Here a photo to understand the problem : https://i.imgur.com/dm0eneJ.jpg

On the photo, I have done the rotation with weston ( output DP-1 , transform 90, inside /etc/xdg/weston/weston.ini ) but only the picture has been rotated, not the screen aera.

The display is a 480x800 display ( 12TLM043 ortustech : https://www.data-modul.com/sites/default/files/products/COM%2043H4M85ULC_specification_CA10113.pdf ) , so by default in portrait mode

Here is an extract of the timing characteristics of the display: https://i.imgur.com/8buuIxb.jpg

On colibri-T20, to change the orientation of the display, we can use vidargs parameter in u-boot. But , it seems not available with colibri-imx8x ( see post : Set vidargs on colibri-imx8x's u-boot - Technical Support - Toradex Community ).

After reading the documentation :

I have identified that I have to change the display section of the file imx8qxp-colibri-eval-v3.dtsi ( arch/arm64/boot/dts/freescale/ ) to put my own display timing.

I have done this, but it seems not working, no change after apply new parameters. The image is still cropped.

What I have done ( I don’t know how to create a meta and recipes to apply a patch on the kernel - I am new beginner with yocto - so I have done the modifications directly into build directory to test the patch ):

  • I have identified the place of the file to be modified : build/tmp/work-shared/colibri-imx8/kernel-source/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtsi

  • I have modified this file like this : imx8qxp-colibri-eval-v3.dtsi - Pastebin.com ( patch file : patch_lvds_param.patch - Pastebin.com )

  • I have rebuilt the kernel with these commands :
    bitbake -c compile -f virtual/kernel ( to verify if it compiles, -f to force , if not it does not anything )
    bitbake -f virtual/kernel to force to rebuild kernel
    bitbake -k tdx-reference-multimedia-image , to rebuild the entire image

  • then , the image is shared on my own toradex easy installer website, and I deployed it on my board ( with toradex easy installer )

  • then I boot, and nothing changed. The file /boot/imx8qxp-colibri-eval-v3.dtb has changed ( I wonder the new parameters I put are inside the file ) but no effect.

Now, I don’t know what to do.

  • is the imx8qxp-colibri-eval-v3.dtsi file the right place to configure my display ? Or Am I wrong ?
  • is it an hw issue / incompatibility ( regarding the picture of the board above ) ?

Hello,

some investigations, but no result :frowning:

What I have found :

  • If I change the value fsl,interface-pixx-fmt from rgb666 to rgb565 inside file arch/arm64/boot/dts/freescale/imx8qxp-colibri.dtsi , it changes the pixel format. see photo : https://i.imgur.com/OPq1Iii.jpg

I guess it is the right place to change something, but what to do exactly to rotate and/or change the mode ?

  • in /sys/class/drm/card0/device/graphics/fb0
    Default values are :
    rotate = 0 , if I change to 90 / 180/ 270 , the screen flickers quickly but no rotation
    virtual_size = 800,480 , I can change the value, the screen flickers but no effect

  • with modetest, I am able to put a test pattern. Here is the result of modetest : modetest.log - Pastebin.com

There is only one mode ( connector id 90 , crtc 67 ) :
800x480 60 800 840 968 1056 480 490 491 524 33230 flags: ; type: preferred, driver

I don’t know from where comes this mode, and how to change this. The issue is that the mode is 800x480 ( landscape ) while my display is 480x800 ( portrait ). And the timings are incorrect.

  • the result of fbset is :

     mode "800x480-0"
     # D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
     geometry 800 480 800 480 16
     timings 0 0 0 0 0 0 0
     accel true
     rgba 5/11,6/5,5/0,0/0
     endmode
    

The mode seems invalid ( timing = 0 ), I don’t know where it comes from ( /etc/fb.modes does not exist ), and I cannot change or add a mode.

The modeline I should have is like this ( calculated with this : Video timing calculator and with the timing parameter of the screen )
Modeline “480x800” 25 480 495 505 515 800 803 806 809 -hsync -vsync

Could you please specify which BSP version you are using as a base for your build?

Hello,

After one week of investigation, I finally found how to change display parameters. This is not well documented, I should have done reverse engineering on kernel source to understand how it works.

First, the toradex documentation noticed that for the parallel display LCD, the drm driver is mxsfb-drm , but it is not , only the imx-drm driver is loaded and operationnal. ( I don’t know why ).
So my first investigation in drivers/video/fbdev/mxc/ is useless.

Second, I searched into directory drivers/gpu/drm/imx and drivers/gpu/imx/ and I discovered inside driver/gpu/drm/panel/panel-simple.c that there is exactly my display , line 2584 to 2508 : ortustech_com43h4m85ulc_mode with exacts timings.

Now, how to apply this mode ?

in the same file line 3471, there is : .compatible = “ortustech,com43h4m85ulc”
and after google search ( drm/drm - DRM kernel graphics driver development tree ) I understood that I have to put the string “ortustech,com43h4m85ulc” into variable “compatible” inside my dts.

So, I have created a device tree overlay, and overwrite variable “compatible” with “ortustech,com43h4m85ulc” inside section panel_dpi , and load the overlay with /boot/overlays.txt and now the display is correct.

I guess BSP 5.0.0 :

repo init -u Index of /toradex-manifest.git -b dunfell-5.x.y -m tdxref/default.xml
from Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center

Glad you were able to resolve your issue. For future reference what you did was fine as I believe it forces the timings to whatever ortustech,com43h4m85ulc is defined as in the kernel. However another way to do this would be to keep the compatible string as is. Then modify the timings in the panel_dpi node directly. This is helpful for when there is no compatible option that matches your display exactly.

For manipulating the panel_dpi node you can take one of our reference device tree overlays like: display-lt161010_overlay.dts « overlays - device-tree-overlays.git - Sources for Device Tree Overlays

And just swap the values for whatever your specific display’s timings are.

Best Regards,
Jeremias

thank you for the answer , I will check this :slight_smile:

You are welcome.