CakeLover_44
Posts: 5
Joined: Tue Sep 19, 2023 9:58 pm

Display on CM4 DSI0 test

Tue Sep 19, 2023 11:09 pm

Hi!

I'm trying to enable DSI0 to work with Waveshare 4inch display on my CM4. So far, I was able to make it running with DSI1 by applying vc4-kms-dsi-7inch. Then I tried to change targets in dts for dsi0 and i2c_vc, so it should use I2C0 instead of I2C1. But nothing happend. I2cdetect commands shows device at address 0x45 on i2c-10 bus, so my assumption is that the controller is available, but how can I actually test it?

Additionally, when dt-blob.bin for dsi0 only is applied I can see output of U-boot properly, but kernel prints are small and blurry. I'm running it on kernel 5.15. I have seen that there are some issues related to dsi0, but I guess that even though I should be able at least to see something.

In my config.txt I got i2c_vc turned on and vc4-kms enabled. Is it possible to see what is sent on i2c bus for dsi1 and check it manually by sending it over i2c0 with the help of i2c tools?

aBUGSworstnightmare
Posts: 8444
Joined: Tue Jun 30, 2015 1:35 pm

Re: Display on CM4 DSI0 test

Wed Sep 20, 2023 5:28 am

If you need support for waveshare products ask them!

Make a custom overlay for the DSI screen and compile it. DSI0 is not recommended for use atm https://github.com/raspberrypi/linux/issues/4946
btw .. I2C interface on DSI0 on a CM4IO is i2c0! No need to enable I2c_vc in config.txt as your overlay will do that for you.

sounds pretty much like viewtopic.php?p=2135231#p2135231 with a new user name.

CakeLover_44
Posts: 5
Joined: Tue Sep 19, 2023 9:58 pm

Re: Display on CM4 DSI0 test

Wed Sep 20, 2023 10:56 am

aBUGSworstnightmare wrote:
Wed Sep 20, 2023 5:28 am
If you need support for waveshare products ask them!
Display is working fine with DSI1 but I can't use it anyway, I need DSI0, so problem is not with the display but with configuration.
aBUGSworstnightmare wrote:
Wed Sep 20, 2023 5:28 am
Make a custom overlay for the DSI screen and compile it. DSI0 is not recommended for use atm https://github.com/raspberrypi/linux/issues/4946
btw .. I2C interface on DSI0 on a CM4IO is i2c0! No need to enable I2c_vc in config.txt as your overlay will do that for you.
I tried that as well, without success. In overlays README I found that ic_vc is just alias for i2c0. I have seen on forum discussion about whether use i2c0 or i2c_vc. I tried both, both have no impact on display. On the other hand, dt-blob uses i2c0 (pins 0 and 1) and I can see bootloader logs on display and deformated kernel logs. What I'm curious is why firmware can controll display almost correctly on the same bus with same pins but kernel driver cant even with that bus being accessible, is it because driver is not supporting DSI0 at all? I tried both cases, with dt-blob and without (but with custom overlay), in second case, display produced no output.

Other question is if it is possible to send some simple data to the panel by using i2c tools and check its output?
aBUGSworstnightmare wrote:
Wed Sep 20, 2023 5:28 am
sounds pretty much like viewtopic.php?p=2135231#p2135231 with a new user name.
No, its not similar. I'm not interested in camera interface at all, what interested me the most was the fact that firmware can use DSI0 and I can even see bootloader logs on display, but kernel driver can't

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 15329
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Display on CM4 DSI0 test

Wed Sep 20, 2023 11:46 am

The issue with DSI0 is that it isn't shutting down cleanly.
The firmware will only ever start the DSI interface up once at boot and then always leaves it active.
The kernel drivers enable and disable all display interfaces at will, hence not shutting down cleanly is a problem as it can leave stuck values in the pipeline. These result in the colour channels shifting when restarted.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aBUGSworstnightmare
Posts: 8444
Joined: Tue Jun 30, 2015 1:35 pm

Re: Display on CM4 DSI0 test

Wed Sep 20, 2023 1:13 pm

CakeLover_44 wrote: Display is working fine with DSI1 but I can't use it anyway, I need DSI0, so problem is not with the display but with configuration.
As said, write a custom overlay and you can use DSI0. You have been warned on it's restrictions.
here is an example of what can happen -> color shift (note the FFC connected to DSI0! on a CM4IO)
Image
CakeLover_44 wrote: Other question is if it is possible to send some simple data to the panel by using i2c tools and check its output?
No, as the display can't accept data via I2C interface!

CakeLover_44
Posts: 5
Joined: Tue Sep 19, 2023 9:58 pm

Re: Display on CM4 DSI0 test

Wed Sep 20, 2023 11:11 pm

Thanks for replies.

I modified arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts the same way as this:
https://github.com/6by9/linux/commit/39 ... 31a97fb6ee

I'm not adding anything special to config.txt, no overlay for i2c0 since it should be enabled by fragment@2. Then still I can't see anything on display, its not even turned on, completely black screen.

When I run

Code: Select all

i2cdetect -y 0
there is nothing present on the bus. I'm not using IO board for CM4, I got custom PCB and I'm wondering why firmware can use the same pins without any issues but kernel can't.

aBUGSworstnightmare
Posts: 8444
Joined: Tue Jun 30, 2015 1:35 pm

Re: Display on CM4 DSI0 test

Thu Sep 21, 2023 4:37 am

Post the entire overlay source code.

Without the overlay active, but the screen connected, enable the I2C interface and scan it.

You should test on a CM4IO first and then check your custom PCB. Your custom PCB might be the root cause, i.e. because of missing/incorrect pull-ups on the I2C bus used.

As I don't have any details on your custom PCB, nor I'm willing to provide support for waveshare products and knowing that there is an issue with DSI0 which you will be unable to solve I will leave the further testing with you.

CakeLover_44
Posts: 5
Joined: Tue Sep 19, 2023 9:58 pm

Re: Display on CM4 DSI0 test

Fri Sep 29, 2023 5:47 pm

Thanks for yours replies and advices. I found the problem which was Yocto configuration, my changes were not applied unfortunately. It is working now, but I decided to switch vc4-fkms instead of vc4-kms, at least display is not deformed. Even touch is working fine.

aBUGSworstnightmare
Posts: 8444
Joined: Tue Jun 30, 2015 1:35 pm

Re: Display on CM4 DSI0 test

Sat Sep 30, 2023 5:32 am

CakeLover_44 wrote:
Fri Sep 29, 2023 5:47 pm
Thanks for yours replies and advices. I found the problem which was Yocto configuration, my changes were not applied unfortunately. It is working now, but I decided to switch vc4-fkms instead of vc4-kms, at least display is not deformed. Even touch is working fine.
you realy should try to get your display working on KMS..

CakeLover_44
Posts: 5
Joined: Tue Sep 19, 2023 9:58 pm

Re: Display on CM4 DSI0 test

Sat Sep 30, 2023 1:13 pm

aBUGSworstnightmare wrote:
Sat Sep 30, 2023 5:32 am
CakeLover_44 wrote:
Fri Sep 29, 2023 5:47 pm
Thanks for yours replies and advices. I found the problem which was Yocto configuration, my changes were not applied unfortunately. It is working now, but I decided to switch vc4-fkms instead of vc4-kms, at least display is not deformed. Even touch is working fine.
you realy should try to get your display working on KMS..
Why is that? With KMS screen is deformed, with fkms everything seems to work fine. I have read that fkms is deprecated and some features are only available when kms is used.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 32878
Joined: Sat Jul 30, 2011 7:41 pm

Re: Display on CM4 DSI0 test

Sat Sep 30, 2023 1:27 pm

CakeLover_44 wrote:
Sat Sep 30, 2023 1:13 pm
aBUGSworstnightmare wrote:
Sat Sep 30, 2023 5:32 am
CakeLover_44 wrote:
Fri Sep 29, 2023 5:47 pm
Thanks for yours replies and advices. I found the problem which was Yocto configuration, my changes were not applied unfortunately. It is working now, but I decided to switch vc4-fkms instead of vc4-kms, at least display is not deformed. Even touch is working fine.
you realy should try to get your display working on KMS..
Why is that? With KMS screen is deformed, with fkms everything seems to work fine. I have read that fkms is deprecated and some features are only available when kms is used.
FKMS is deprecated, does not get any bug fixes or improvements, and doesn't work on Pi5.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Return to “Graphics, sound and multimedia”