UberDoefus
Posts: 21
Joined: Tue May 04, 2021 8:28 am

DSI interfacing to TI SN65DSI8[3|4|5]

Tue May 04, 2021 9:12 am

[Split off viewtopic.php?f=98&t=282974 as it's easier if different displays are kept to separate thread]

@6by9

You seem to be very knowledgeable about getting DSI1 to run a custom panel. We're working on a product for a customer where we combine a CM4 with an DSI->LVDS bridge (SN65DSI84) to a Full-HD display. We've been reading though this thread and are using your fork of the RPi linux kernel with that bridge but still are struggling to get stuff to work.
We're following your footsteps, adding our own display to the panel-simple.c, changing the DTS to our gpio and pwm pins but still I'm not seeing any vc4 activity.
Is this something you could assist us with, either through this forum or via DM?

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

Re: VC4 Video Driver dont start DSI Interface

Tue May 04, 2021 2:20 pm

UberDoefus wrote:
Tue May 04, 2021 9:12 am
@6by9

You seem to be very knowledgeable about getting DSI1 to run a custom panel. We're working on a product for a customer where we combine a CM4 with an DSI->LVDS bridge (SN65DSI84) to a Full-HD display. We've been reading though this thread and are using your fork of the RPi linux kernel with that bridge but still are struggling to get stuff to work.
We're following your footsteps, adding our own display to the panel-simple.c, changing the DTS to our gpio and pwm pins but still I'm not seeing any vc4 activity.
Is this something you could assist us with, either through this forum or via DM?
If you do a quick search on the forums for SN65DSI83 or SN65DSI84 you would have seen the other couple of threads relating to those bridge chips, particularly viewtopic.php?f=44&t=305690
aBUGSworstnightmare has been trying to take the SN65DSI8x driver that is being reviewed upstream and trying to get it to work. It's believed to work on other platforms, but I have no first-hand experience of that.

We aren't really set up for providing effectively consultation as there is enough going on to keep us all busy, and it's not helped that the majority of us are working from home so don't have direct access to lab equipment.
I do need to go into the office this week, so I'll see if I have time to take the SN65DSI8x tree that I have and have a look on an oscilloscope with nothing connected. It's about the best I can do with no hardware to test against, and I'm certainly not the best person to be analysing 3rd party hardware for implementation issues.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

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

Re: VC4 Video Driver dont start DSI Interface

Tue May 04, 2021 3:19 pm

6by9 wrote:
Tue May 04, 2021 2:20 pm
UberDoefus wrote:
Tue May 04, 2021 9:12 am
@6by9

You seem to be very knowledgeable about getting DSI1 to run a custom panel. We're working on a product for a customer where we combine a CM4 with an DSI->LVDS bridge (SN65DSI84) to a Full-HD display. We've been reading though this thread and are using your fork of the RPi linux kernel with that bridge but still are struggling to get stuff to work.
We're following your footsteps, adding our own display to the panel-simple.c, changing the DTS to our gpio and pwm pins but still I'm not seeing any vc4 activity.
Is this something you could assist us with, either through this forum or via DM?
If you do a quick search on the forums for SN65DSI83 or SN65DSI84 you would have seen the other couple of threads relating to those bridge chips, particularly viewtopic.php?f=44&t=305690
aBUGSworstnightmare has been trying to take the SN65DSI8x driver that is being reviewed upstream and trying to get it to work. It's believed to work on other platforms, but I have no first-hand experience of that.

We aren't really set up for providing effectively consultation as there is enough going on to keep us all busy, and it's not helped that the majority of us are working from home so don't have direct access to lab equipment.
I do need to go into the office this week, so I'll see if I have time to take the SN65DSI8x tree that I have and have a look on an oscilloscope with nothing connected. It's about the best I can do with no hardware to test against, and I'm certainly not the best person to be analysing 3rd party hardware for implementation issues.
@6by9: appreciate your support for looking into this issue. The driver seems to be working, registers looking as expected - as said in the other thread - but DSI is not working.
As I still don't know if it's the overlay or related to DSI clock (clock is running as test pattern shows up, but I don't know if certain restrictions to 'valid' DSI clock settings apply, because on the Pi the DSI block seeems to be driven from an integer divider off a PLL, thus it can only achieve particular DSI bus
speeds most likely.. There seems to be some fix in vc4_dsi_encoder_mode_fixup but this causes that displays are (to my understanding) always driven in some kind of DSI's burst mode. Non-burst - if required - seems not achievable (at least I think that's my conclusion from working with the 6.8in MIPi display which uses the Synaptics TCON)).
I would like to hear your feedback if DSI fires up. Maybe you have some spare time to test with different no of lanes (as there might be an issue as well, no of lanes asks for lower/higher clock divider).

138bit
Posts: 1
Joined: Wed May 05, 2021 10:20 am

Re: VC4 Video Driver dont start DSI Interface

Wed May 05, 2021 10:57 am

I agree that @6by9 has been very helpful :-)

I'm also using a custom board with a SN65DSI85 chip and I too have the same problem. From all of my tries I was able to get a drm_panel (the non-dsi from panel-simple.c) into the system and have the bridge register as drm_bridge. I also see that the mipi_dsi_host is probed (dsi1) and that the bridge is probed as a mipi_dsi_device.

I expect that the VC4 system would recognize my bridge and start the encoder in which the clock is set, but it somehow doesn't reach the codec enable[1]

In another post I've found out that 6by9 has the branch rpi-5.10.y-sn65dsi8x on git://github.com/6by9/linux.git. On the forum tread milo246 got the test mode working on the SN65DSI83 with the same driver[2]. Therefore enabling DSI on the CM4 must be possible.

I've tried drivers from digi.com as well [3] and here it registers a video mode. From my understanding the drivers basically do the same _except_ that the latter doesn't need a simple panel. Here it does complain 1 times less about missing crtcs, but with both drivers the VC4 is still complaining:
[ 3.009913] [drm] No displays found. Consider forcing hotplug if HDMI is attached
[ 3.017539] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops)
[ 3.024250] ------------[ cut here ]------------
[ 3.029010] Bogus possible_crtcs: [ENCODER:31:DSI-31] possible_crtcs=0x0 (full crtc mask=0x0)
[ 3.037831] WARNING: CPU: 2 PID: 74 at drivers/gpu/drm/drm_mode_config.c:617 drm_mode_config_validate+0x1b8/0x270

I don't have the full error by hand, but will upload the differences if requested.

@aBUGSworstnightmare: did you notice that the simple panels are based on simple-dpi? The official 7" Raspberry Pi screen makes use of a DSI to DPI bridge, thus basically differs than an DSI to LVDS bridge I would say.


[1] https://elixir.bootlin.com/linux/v5.10. ... dsi.c#L821
[2] viewtopic.php?f=44&t=305690&start=25#p1837567
[3] https://www.digi.com/resources/document ... o-lvds_8mn

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

Re: VC4 Video Driver dont start DSI Interface

Wed May 05, 2021 7:23 pm

138bit wrote:
Wed May 05, 2021 10:57 am
I agree that @6by9 has been very helpful :-)

I'm also using a custom board with a SN65DSI85 chip and I too have the same problem. From all of my tries I was able to get a drm_panel (the non-dsi from panel-simple.c) into the system and have the bridge register as drm_bridge. I also see that the mipi_dsi_host is probed (dsi1) and that the bridge is probed as a mipi_dsi_device.

I expect that the VC4 system would recognize my bridge and start the encoder in which the clock is set, but it somehow doesn't reach the codec enable[1]

In another post I've found out that 6by9 has the branch rpi-5.10.y-sn65dsi8x on git://github.com/6by9/linux.git. On the forum tread milo246 got the test mode working on the SN65DSI83 with the same driver[2]. Therefore enabling DSI on the CM4 must be possible.

I've tried drivers from digi.com as well [3] and here it registers a video mode. From my understanding the drivers basically do the same _except_ that the latter doesn't need a simple panel. Here it does complain 1 times less about missing crtcs, but with both drivers the VC4 is still complaining:
[ 3.009913] [drm] No displays found. Consider forcing hotplug if HDMI is attached
[ 3.017539] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops)
[ 3.024250] ------------[ cut here ]------------
[ 3.029010] Bogus possible_crtcs: [ENCODER:31:DSI-31] possible_crtcs=0x0 (full crtc mask=0x0)
[ 3.037831] WARNING: CPU: 2 PID: 74 at drivers/gpu/drm/drm_mode_config.c:617 drm_mode_config_validate+0x1b8/0x270

I don't have the full error by hand, but will upload the differences if requested.

@aBUGSworstnightmare: did you notice that the simple panels are based on simple-dpi? The official 7" Raspberry Pi screen makes use of a DSI to DPI bridge, thus basically differs than an DSI to LVDS bridge I would say.


[1] https://elixir.bootlin.com/linux/v5.10. ... dsi.c#L821
[2] viewtopic.php?f=44&t=305690&start=25#p1837567
[3] https://www.digi.com/resources/document ... o-lvds_8mn
need to look for simple-dpi, is there a special reason for it? Right now I prefer to make use of panel- simple.
Yes, official 7in uses a Toshiba DSI to RGB bridge which is announced EOL, so makes no sense to consider for something new.

UberDoefus
Posts: 21
Joined: Tue May 04, 2021 8:28 am

Re: VC4 Video Driver dont start DSI Interface

Wed May 05, 2021 7:34 pm

@6by9

I applied a patch on top of your fork that initially didn't work, as I didn't see the binding of the hvs, txp and the pixelvalve. I checked the config.txt and it correctly had the overlay for the vc4-kms-v3d in it.
Then I decided to dump the devicetree `dtc -I fs /proc/device-tree` and noticed that the status of these hvs,txp and pixelvalve all were disabled, as if the overlay wasn't applied. This made me place parts of the vc4-kms-v3d-overlay.dts into the sn65dsi8x-overlay.dts, removed the vc4-kms-v3d overlay from the config.txt and presto, I see the binding of the hvs, txp and pixelvalve.

[ 3.015801] vc4-drm gpu: bound fe700000.dsi (ops vc4_dsi_ops)
[ 3.021922] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[ 3.028054] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
[ 3.034254] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
[ 3.041085] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
[ 3.043461] mmc0: new DDR MMC card at address 0001
[ 3.047918] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
[ 3.053498] mmcblk0: mmc0:0001 AJTD4R 14.6 GiB
[ 3.059218] [drm] No displays found. Consider forcing hotplug if HDMI is attached
[ 3.064066] mmcblk0boot0: mmc0:0001 AJTD4R partition 1 4.00 MiB
[ 3.071248] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops)

No clue why the original overlay didn't work but now I reached the point where the probing, binding and enabling of the graphics pipeline is done.

Still I see the

[ 3.029010] Bogus possible_crtcs: [ENCODER:31:DSI-31] possible_crtcs=0x0 (full crtc mask=0x0)
[ 3.037831] WARNING: CPU: 2 PID: 74 at drivers/gpu/drm/drm_mode_config.c:617 drm_mode_config_validate+0x1b8/0x270

and

[ 13.789260] [drm:drm_atomic_helper_wait_for_flip_done] *ERROR* [CRTC:74:crtc-2] flip_done timed out
[ 24.029257] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:74:crtc-2] flip_done timed out
[ 34.269255] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:47:LVDS-1] flip_done timed out
[ 44.509254] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:68:plane-2] flip_done timed out

but I will attempt to activate the test-pattern tomorrow. I'll keep you guys posted...

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

Re: VC4 Video Driver dont start DSI Interface

Wed May 05, 2021 7:42 pm

UberDoefus wrote:
Wed May 05, 2021 7:34 pm
[ 3.071248] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops)
You have dtoverlay=vc4-fkms-v3d in config.txt which is still trying to use the firmware drivers. That will just mess everything up.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

UberDoefus
Posts: 21
Joined: Tue May 04, 2021 8:28 am

Re: VC4 Video Driver dont start DSI Interface

Thu May 06, 2021 4:02 pm

Alright,

all, thanks for the support so far. Today I have managed to get the testpattern running on our display. Just in time for our sprint-review session tomorrow :D . Next step will be to get the DSI data lines running, I haven't tried yet but will continue the endeavour. As I understand, this is where most people are stuck on, let's see if I can get it to run.

Keep U posted...

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

Re: DSI interfacing to TI SN65DSI8[3|4|5]

Thu May 06, 2021 5:08 pm

You should follow/post in this thread viewtopic.php?f=44&p=1861301&sid=01b606 ... d#p1861301
As it has the most comprehensive summary of problems /current status of DSI8x.

Which display you connect doesn't matter as the methologie will be the same (i.e. Details added to panel-simple or your dt overlay).
Every bit of info related to this topic is essential atm as we need to figure out where the remaing issue is.
Getting test pattern shown only tells your your LVDS HW/settings are correct. Good to know but not solving any DSI related issue...

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

Re: DSI interfacing to TI SN65DSI8[3|4|5]

Sat May 08, 2021 5:19 am

Image

looks like we are on the right track.Thanks to milo246 there is now a driver that brings the SN65DSI8x to life (a DSI84 is mounted on my MIPI2LVDS, the black board on the picture) and another driver is worked on for upstream (most likely).
I've posted the DT overlay in use as well as a template.

So, once again, letme suggest to follow the existing thread.

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

Re: DSI interfacing to TI SN65DSI8[3|4|5]

Sat May 08, 2021 8:48 am

Agreed that the other thread is more useful for sn65dsi8x, so locking.
(Resolving the issue with loading fkms here at least kept that confusion clear of the more useful thread)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Compute Module”