Same Image with different dtb

Hello Community,

I am working with Apalis iMX8 in dunfell version. My primary applications is LCD displays where we will use different types of LCDs. Each LCD has it’s own characteristics like frequency, dimming frequency and resolution. So i want to build same image all these LCDs with different dtb for each LCD panel with it’s specification. What is the procedure to do that and how can i choose the dtb for specific LCD panel.

Thank You.
Muthyam D.

Hi @Muthyam,

I believe you can use device tree overlay for different timings for different different display. Please check below link

Best Regards
Ritesh Kumar

Hello @ritesh.tx ,
I have written a overlay as

Custum_Overlay_Apalis_IMX8.dts (277 Bytes) (the intended functionality of overlay is to change default brightness as 2) ,and converted it into dtbo using
dtc -@ -I dts -O dtb -o Custum_Overlay_Apalis_IMX8.dtbo Custum_Overlay_Apalis_IMX8.dts .
Then i got following .dtbo file
Custum_Overlay_Apalis_IMX8.dtbo (285 Bytes)
I copied this into /boot/overlays/ and in overlays.txt file i appended this .dtbo file. Then i rebooted the system. In boot data it is showing as
Applying Overlay: Custum_Overlay_Apalis_IMX8.dtbo
285 bytes read in 42 ms (5.9 KiB/s)
overlay_boot.txt (39.4 KB)

But when i check the brightness level it is unaltered.
Where i am doing wrong, Help me with this.
Thank You,
Muthyam D.

Hi @Muthyam,
There is no need to modify device tree to change the brightness.
You can update the value of brightness at /sys/class/backlight/backlight/brightness.
Please refer to this article for more detail.

Hello @sahil.tx ,

My intention is to apply overlay, primarily for different LCD display types(i.e include LCD parameters and frequencies). We have to deal with different types of LCD displays which have different dimensions. So for that each LCD display i have to create each overlay.

Before that i want to have clear understanding of overlay, i took brightness as an example for better understanding of overlay.

So now you help me with this. What i am doing wrong here.

Thank You,
Muthyam D.

Hi @Muthyam ,
There is no need to do device tree modification for brightness.
I understand you point that you want to test whether lcd settings can be applied via overlays or not.
The easiest way is to change the display resolution (Cx and Cy) in the overlays according to your display settings and test. There are already pre-built overlays available, you can test with that as well.

Hello @sahil.tx,

I wanted to discuss my requirement regarding LCD displays with you. As I mentioned earlier, my primary application involves using different types of LCDs, each with its own unique characteristics such as frequency, dimming frequency, and resolution. Instead of building a new image for each LCD type, I’m exploring the option of using overlays.

My idea is to create overlays for specific LCDs, where I can include the properties related to that particular display. This way, I can choose the appropriate overlay based on the available LCD display while using the same base image.

I followed the instructions provided in the Toradex documentation on device tree overlays to create a test overlay. In this test overlay, I included brightness-related settings. However, despite the overlay being applied during boot, it doesn’t seem to have any effect on the actual brightness value.

As I’m new to the concept of overlays, I would appreciate your guidance on where I might be going wrong and how I can ensure that the overlay settings are properly applied.

Thank you for your assistance.

Best regards,
Muthyam D.

Hello @sahil.tx , @ritesh.tx
Waiting for your response,
Ideally i want have overlay like
Custum_Overlay_Apalis_IMX8.dts (707 Bytes)
which is for applying different panel-timings and backlight pwm configurations. The above overlay i created and compiled into dtbo. I copied that dtbo to /boot/overlays/ folder in the final image, and applied that by adding that in overlay.txt file.
I observed that during booting that overlay is applied, but when i am reading the panel-timings overlay has no effect on that (in that overlay i rewritten the panel-timings).

Where i am doing wrong, guide me.

thanks ,
Muthyam D.

Hi @Muthyam,

Please use the below additional steps to change the brightness using overlays(BSP 5.7).

  1. vi /lib/systemd/system/systemd-backlight@.service
  2. Edit to below parameter as
    DefaultDependencies=yes
  3. reboot the system and use overlays to change the brightness levels.
    eg. &backlight {
    default-brightness-level=<1>;
    status = “okay”;
    };

Hello @sahil.tx ,
I want to overlay for different panel timings and dimming frequency. Not to change brightness levels. Cause i am new to this overlay concept, i took brightness changing using overlay as a practice. Ideally i want that to apply different panel-timings like resolution and frequency.
I know i can change brightness after login in path, /sys/class/backlight/backlight/brightness .

Similarly i can’t change the panel-timings after login, for that either i have to entire image with different panel-timings i want or take one common image and build an overlays with different panel-timings as per my need. And apply them based on requirement during boot time.

But creation of an overlay has some problem, I have created an overlay and applied, but that does not shows any difference in actual panel-timings.

for better understanding

panel_lvds: panel-lvds {
	compatible = "panel-lvds";
	backlight = <&backlight>;
            status = "okay";
            data-mapping = "vesa-24";
	width-mm = <919>;
        height-mm = <139>;
	primary;
	panel-timing {
			clock-frequency = <148500000>;
			hactive = <1920>;
			vactive = <1080>;
			hback-porch = <60>;
			hfront-porch = <60>;
			vback-porch = <20>;
			vfront-porch = <20>;
			hsync-len = <20>;
			vsync-len = <5>;
			hsync-active = <0>;
			vsync-active = <0>;
			de-active = <1>;
			pixelclk-active = <0>;
	       };


	port {
		panel_lvds_in: endpoint {
			remote-endpoint = <&lvds1_out>;
		};
	};
};

in the above nodes, i want to rewrite the width-mm, height-mm, hactive, vactive and clock-frequency. i want to achieve that using a overlay.

Hope you understood the requirement.

Thanks & Regards,
Muthyam D.

Hi @Muthyam ,
How you are testing that the timings used in the overlays are not getting applied?

Hello @sahil.tx ,
to check those values, after login i am checking fbset , Usually it will give resolution details.
like this
root@apalis-imx8-14727753:~# fbset

mode “1920x1080”
geometry 1920 1080 1920 1080 16
timings 0 0 0 0 0 0 0
accel true
rgba 5/11,6/5,5/0,0/0
endmode

Thanks ,
Muthyam D.

Hi @Muthyam ,
Can you share the datasheet of the display that you are trying to use?
Is it the same display that you mentioned on your different post.
Also, you main concern was to test whether you are able to see changes using overlays and for that you took backlight as an example. Since backlight is working , now you want to try adjust other timing parameters like horizontal and vertical resolution, right?
So, do you mean when you use some other resolution like 960x1080, it is not getting reflected?

Hello @sahil.tx ,
The Display is same as in other post, for some other displays that we have, there is different data-timings that is not effected after applying is overlay.

So, do you mean when you use some other resolution like 960x1080, it is not getting reflected?
Yes. The changes are not reflected.

Thank You,
Muthyam D.

Hi @Muthyam ,
I tested it again by changing the resolution through overlays and it is getting reflected.
Please tell me about your issue exactly.
In the patch I can see you have applied 1920x1080 and the fbset outputs the same.
Please debug again and update us about your issue

Hello @sahil.tx ,
Can you share your dts file that you applied as overlay.
Can you give details like, dts creation and conversion of that to dtbo.

In my case this is the dts file
Custum_Overlay_Apalis_IMX8.dts (691 Bytes)

dtc -@ -I dts -O dtb -o Custum_Overlay_Apalis_IMX8.dtbo Custum_Overlay_Apalis_IMX8.dts

I am using the above command to convert dts to dtbo.

And this is the generated dtbo
Custum_Overlay_Apalis_IMX8.dtbo (1015 Bytes)

In patch the resolution is 1920x1080 only, but in overlay that is changed to 960x1080.
After applying the patch, i am testing with fbset. It is giving 1920x1080.

Thank You,
Muthyam D.

Hi @Muthyam,
Please get a clear understanding of device tree concept from here.
Please use overlays(dtbo) since you need to apply and test different settings.
I tested using and modifying the below overlays (for lvds output).
display-lt170410_overlay.dtbo : It is present inside the module by default in overlays folder. The dts file is present inside the device tree overlay source code.
For your ease, I have attached these files here.
You need to copy dtbo files on your modules inside /boot/overlays and update the/boot/overlays.txt file with the overlay names

Hello @sahil.tx ,

i have taken display-lt170410_overlay.dts file and renamed it to Custum_Overlay_Apalis_IMX8.dts

medha@C2680:~/Desktop/Overlays_iMx8$ cat Custum_Overlay_Apalis_IMX8.dts
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*

  • Copyright 2020-2021 Toradex
    */

// LT170410 LVDS display (10 inch) with a resolution of 1280x800 pixel. This display can be ordered at Toradex.

/dts-v1/;
/plugin/;

/ {
compatible = “toradex,apalis_imx6q”,
“toradex,apalis-imx8”,
“toradex,apalis-imx8x”,
“toradex,verdin-imx8mp”;
};

&{/panel-lvds} {
status = “okay”;

data-mapping = "vesa-24";
width-mm = <217>;
height-mm = <136>;

panel-timing {
	clock-frequency = <68930000>;
	hactive = <1200>;
	vactive = <800>;
	hback-porch = <64>;
	hfront-porch = <64>;
	vback-porch = <5>;
	vfront-porch = <5>;
	hsync-len = <40>;
	vsync-len = <6>;
	hsync-active = <0>;
	vsync-active = <0>;
	pixelclk-active = <0>;
};

};
medha@C2680:~/Desktop/Overlays_iMx8$ dtc -@ -I dts -O dtb -o Custum_Overlay_Apalis_IMX8.dtbo Custum_Overlay_Apalis_IMX8.dts
Error: Custum_Overlay_Apalis_IMX8.dts:18.1-15 Label or path /panel-lvds not found
FATAL ERROR: Syntax error parsing input tree

May be the command that i am using to convert dts to dtbo is wrong, Can you suggest me correct command to convert dts to dtbo.

Thank You,
Muthyam D.

Hi @Muthyam ,
I have already attached dtbo files for testing along with dts.
Please use make to compile overlays as mentioned here.

.