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

Re: VGA666, KMS, and boot messages

Sun Jan 29, 2023 4:27 pm

(Sorry, I messed up in trying to split a topic off this thread and deleted the original post. Restored here as a quote)
hackbar wrote:Hi, I have a Pi 4 with the vga666 to drive an analog CRT. I'd like to get kernel modesetting working, including all the initial splash screen (rainbow), kernel boot message, and normal userspace.

My current setup gets valid video only after the vc4 framebuffer takes over. Before that, I'm not getting valid video.

Current config:
start_x=1
arm_64bit=1
dtparam=i2c_arm=off
dtparam=spi=off
disable_fw_kms_setup=1
dtoverlay=vc4-kms-v3d,noaudio,nohdmi
dtoverlay=vc4-kms-dpi-generic,hactive=320,hfp=19,hsync=43,hbp=36
dtparam=vactive=240,vfp=2,vsync=6,vbp=14
dtparam=clock-frequency=6400000,hsync-invert,vsync-invert,rgb666
enable_dpi_lcd=1
display_default_lcd=1
max_framebuffers=1
dpi_group=2
dpi_mode=87
dpi_timings=320 1 19 43 36 240 1 2 6 14 0 0 0 60 0 6400000 1

packages:
raspberrypi-bootloader: 1:1.20230106-1
raspberrypi-kernel: 1:1.20230106-1

So some questions:
Is there even a way to get the rainbow splash on the vga666? Can the firmware do this?

How can I get boot messages using KMS?

I'm using the vc4-kms-dpi-generic overlay because I couldn't figure out how to specify modelines to vc4-kms-vga666. How can I do that? I assume I should be using that driver?

Thanks for the help...

Code: Select all

enable_dpi_lcd=1
display_default_lcd=1
max_framebuffers=1
dpi_group=2
dpi_mode=87
dpi_timings=320 1 19 43 36 240 1 2 6 14 0 0 0 60 0 6400000 1
will all do nothing in configuring KMS, but will do 90% of the configuration for the firmware to drive a VGA666.

I think the only bit that is missing is configuring the GPIOs to the relevant alt function.

Code: Select all

gpio=2-21=a2
should do the relevant part.

vc4-kms-vga666 adds relatively little over vc4-kms-dpi-generic - they're both configuring a DPI display. The main option it does add is that if you add an I2C level shifter to GPIOs 0&1, the VGA666 can read the EDID of the display and automatically configure the resolutions supported.
Watch out if you have a premade VGA666 board though as a PCB design SNAFU means that VGA pins 4, 9, 11, 12, and 15 are all connected together - "NC" became a net instead of not connected. https://github.com/fenlogic/vga666/issues/15
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.

hackbar
Posts: 5
Joined: Thu Jul 21, 2022 5:51 pm

Re: VGA666, KMS, and boot messages

Sun Jan 29, 2023 7:54 pm

6by9 wrote: I think the only bit that is missing is configuring the GPIOs to the relevant alt function.

Code: Select all

gpio=2-21=a2
should do the relevant part.
Yes, perfect, that did the trick!

I do see a second of garbage as the framebuffer starts. Is there a way to tell the the vc4 fb drivers to not actually tell the chip to change modes, but just set up memory and such for the framebuffer? I'm not sure that would even work on the Pi's GPU, but it would be neat for a seamless transition.
6by9 wrote: vc4-kms-vga666 adds relatively little over vc4-kms-dpi-generic - they're both configuring a DPI display. The main option it does add is that if you add an I2C level shifter to GPIOs 0&1, the VGA666 can read the EDID of the display and automatically configure the resolutions supported.
Watch out if you have a premade VGA666 board though as a PCB design SNAFU means that VGA pins 4, 9, 11, 12, and 15 are all connected together - "NC" became a net instead of not connected. https://github.com/fenlogic/vga666/issues/15
Ah, makes sense. I'm driving displays with no EDID, so that wouldn't be useful to me. Is that why you can't specify a video mode manually, since it expects to get that from the EDID?

Thanks for the tip, but I'm using a Pi2Jamma board with VGA666 support, not a real one.

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

Re: VGA666, KMS, and boot messages

Sun Jan 29, 2023 8:13 pm

hackbar wrote:
Sun Jan 29, 2023 7:54 pm
6by9 wrote: I think the only bit that is missing is configuring the GPIOs to the relevant alt function.

Code: Select all

gpio=2-21=a2
should do the relevant part.
Yes, perfect, that did the trick!

I do see a second of garbage as the framebuffer starts. Is there a way to tell the the vc4 fb drivers to not actually tell the chip to change modes, but just set up memory and such for the framebuffer? I'm not sure that would even work on the Pi's GPU, but it would be neat for a seamless transition.
The handover shuts down the firmware and kicks off the kernel. There's no easy "mute" option to tell the display not to display anything, so no. (There is a data enable on GPIO0, but that is active per frame, and is not applicable for a VGA666 type device.
hackbar wrote:
6by9 wrote: vc4-kms-vga666 adds relatively little over vc4-kms-dpi-generic - they're both configuring a DPI display. The main option it does add is that if you add an I2C level shifter to GPIOs 0&1, the VGA666 can read the EDID of the display and automatically configure the resolutions supported.
Watch out if you have a premade VGA666 board though as a PCB design SNAFU means that VGA pins 4, 9, 11, 12, and 15 are all connected together - "NC" became a net instead of not connected. https://github.com/fenlogic/vga666/issues/15
Ah, makes sense. I'm driving displays with no EDID, so that wouldn't be useful to me. Is that why you can't specify a video mode manually, since it expects to get that from the EDID?
You can specify a video mode via the kernel command line, but not full timings. Add an entry along the lines of

Code: Select all

video=DPI-1:1024x768M@60
would produce 1024x768 @ 60Hz using the CVT timings algorithm.
See https://github.com/torvalds/linux/blob/ ... modedb.rst for more complete details.
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.

cleverca22
Posts: 7304
Joined: Sat Aug 18, 2012 2:33 pm

Re: VGA666, KMS, and boot messages

Sun Jan 29, 2023 8:21 pm

6by9 wrote:
Sun Jan 29, 2023 8:13 pm
There's no easy "mute" option to tell the display not to display anything
i had mis-configured DPI in interlaced mode once, one field was 1/60th of a second, the other field was 2 seconds!

from that i discovered, that my crt monitor would come out of standby, after just 2 vsync's with the right delay between them
but then after a long (didnt measure the limit) delay of no vsync, it went back into standby mode

and due to my mis-configuration, it was in a loop, waking and sleeping after every field

hackbar
Posts: 5
Joined: Thu Jul 21, 2022 5:51 pm

Re: VGA666, KMS, and boot messages

Mon Jan 30, 2023 12:09 am

cleverca22 wrote: from that i discovered, that my crt monitor would come out of standby, after just 2 vsync's with the right delay between them
but then after a long (didnt measure the limit) delay of no vsync, it went back into standby mode
[/quite]
I'm using all analog monitors, so I need it to not change the sync timing at all, otherwise I get jitter when the new sync starts.

Maybe I'll look at the VC4 sec and see if I can add hitless KMS takeover:)
6by9 wrote: You can specify a video mode via the kernel command line, but not full timings. Add an entry along the lines of

Code: Select all

video=DPI-1:1024x768M@60
would produce 1024x768 @ 60Hz using the CVT timings algorithm.
See https://github.com/torvalds/linux/blob/ ... modedb.rst for more complete details.
Ah, cool, thanks. I'm doing 320x240, so I'll try than see if it gives a stable picture. Might be cleaner config.

hackbar
Posts: 5
Joined: Thu Jul 21, 2022 5:51 pm

Re: VGA666, KMS, and boot messages

Mon Jan 30, 2023 3:57 am

6by9 wrote: You can specify a video mode via the kernel command line, but not full timings. Add an entry along the lines of

Code: Select all

video=DPI-1:1024x768M@60
would produce 1024x768 @ 60Hz using the CVT timings algorithm.
See https://github.com/torvalds/linux/blob/ ... modedb.rst for more complete details.
Hmm, I can't get this work for 320x240. Do you know if there's a minimum?

I've tried:

Code: Select all

video=DPI-1:320x240@60e
and

Code: Select all

video=DPI-1:320x240M@60e
with no difference. I think it's outputting 640x480, based on the artifacts I see on my monitor?

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

Re: VGA666, KMS, and boot messages

Mon Jan 30, 2023 7:32 am

Check with modetest or kmsprint what the name of the connector is. It may be VGA-1 instead of DPI-1 - I can't remember for certain.
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.

hackbar
Posts: 5
Joined: Thu Jul 21, 2022 5:51 pm

Re: VGA666, KMS, and boot messages

Tue Jan 31, 2023 12:37 am

6by9 wrote: Check with modetest or kmsprint what the name of the connector is. It may be VGA-1 instead of DPI-1 - I can't remember for certain.
Ah, thanks, using kmsprint it looks like the connector is named VGA-1:

Code: Select all

Connector 0 (32) VGA-1 (connected)
  Encoder 0 (31) DPI
    Crtc 1 (60) 320x240@60.05 5.263 320/65520/32/16/- 240/1/3/5/+ 60 (60.05) U 
      Plane 1 (50) fb-id: 283 (crtcs: 1) 0,0 320x240 -> 0,0 320x240 (XR24 AR24 AB24 XB24 RG16 BG16 AR15 XR15 RG24 BG24 YU16 YV16 YU12 YV12 NV12 NV21 NV16 NV61 P030 XR30 AR30 AB30 XB30 RGB8 BGR8 XR12 AR12 XB12 AB12 BX12 BA12 RX12 RA12)
        FB 283 320x240 RG16
It's working now. Thanks for the help!

Sobakin76
Posts: 4
Joined: Fri May 06, 2022 5:49 pm
Location: Ukraine

Re: VGA666, KMS, and boot messages

Sun Mar 26, 2023 5:44 pm

Just set up rpi3b's vga666 (for 15khz scart CRT TV) thru KMS driver thanks to new overlays, but is there some utilites like vcgencmd and fbset are (or will be) available to work with resolutions and timings online, and setting "virtual resolution" which fbset could do with legacy driver? Not using X desktop, just console.

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

Re: VGA666, KMS, and boot messages

Mon Mar 27, 2023 6:30 am

Sobakin76 wrote:
Sun Mar 26, 2023 5:44 pm
Just set up rpi3b's vga666 (for 15khz scart CRT TV) thru KMS driver thanks to new overlays, but is there some utilites like vcgencmd and fbset are (or will be) available to work with resolutions and timings online, and setting "virtual resolution" which fbset could do with legacy driver? Not using X desktop, just console.
The overlay will work for X and when booted to CLI. You might be better off in using vc4-kms-dpi-generic (as you most likely don't have any I2C signals to deal with).
Sorry, but what do you want to achieve?

Sobakin76
Posts: 4
Joined: Fri May 06, 2022 5:49 pm
Location: Ukraine

Re: VGA666, KMS, and boot messages

Mon Mar 27, 2023 9:23 am

aBUGSworstnightmare wrote:
Mon Mar 27, 2023 6:30 am
The overlay will work for X and when booted to CLI. You might be better off in using vc4-kms-dpi-generic (as you most likely don't have any I2C signals to deal with).
Sorry, but what do you want to achieve?
I'm already using vc4-kms-dpi-generic, with it I can setup VGA 15KHz resolution and timings as I wish (it just even don't need it, just picked up hdmi_timings from config.txt), but I want to be able change it on the fly, and this utilities don't wokr with full KMS.
Of course purpose is retrogaming, as anybody else with 15KHz CRTs :)
Different emulators - different resolutions, frequencies and timings.
It works okay with legacy driver, so really have no problems now, but I feel that it may be deprecated at the some time.
Last edited by Sobakin76 on Mon Mar 27, 2023 10:19 am, edited 1 time in total.

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

Re: VGA666, KMS, and boot messages

Mon Mar 27, 2023 9:30 am

Sobakin76 wrote:
Mon Mar 27, 2023 9:23 am
aBUGSworstnightmare wrote:
Mon Mar 27, 2023 6:30 am
The overlay will work for X and when booted to CLI. You might be better off in using vc4-kms-dpi-generic (as you most likely don't have any I2C signals to deal with).
Sorry, but what do you want to achieve?
I'm already using vc4-kms-dpi-generic, with it I can setup VGA 15KHz resolution and timings as I wish (it just even don't need it, just picked up hdmi_timings from config.txt), but I want to be able change it on the fly, and this utilities don't wokr with full KMS.
Of course purpose is retrogaming, as anybody else with 15KHz CRTs :)
Different emulators - different resolutions, frequencies and timings.
It works okay with legacy driver, so really have no problems now, but I feel that it might be deprecated at the some time.
you're running X and KMS --> you should be able to throw a new modeline on your screen, like shown here viewtopic.php?t=284866&start=25#p1953392
That's 'on-the-fly' and non-persistent

Sobakin76
Posts: 4
Joined: Fri May 06, 2022 5:49 pm
Location: Ukraine

Re: VGA666, KMS, and boot messages

Mon Mar 27, 2023 10:24 am

aBUGSworstnightmare wrote:
Mon Mar 27, 2023 9:30 am
you're running X and KMS --> you should be able to throw a new modeline on your screen, like shown here viewtopic.php?t=284866&start=25#p1953392
That's 'on-the-fly' and non-persistent
OK, thank You. Thought it's somehow possible without X

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

Re: VGA666, KMS, and boot messages

Mon Mar 27, 2023 10:30 am

Sobakin76 wrote:
Mon Mar 27, 2023 10:24 am
aBUGSworstnightmare wrote:
Mon Mar 27, 2023 9:30 am
you're running X and KMS --> you should be able to throw a new modeline on your screen, like shown here viewtopic.php?t=284866&start=25#p1953392
That's 'on-the-fly' and non-persistent
OK, thank You. Thought it's somehow possible without X
You can still use legacy if you're fine with that!
change your config.txt as below and you'll end up using legacy graphics driver (with all it's downsides)

Code: Select all

#dtoverlay=vc4-kms-v3d

Sobakin76
Posts: 4
Joined: Fri May 06, 2022 5:49 pm
Location: Ukraine

Re: VGA666, KMS, and boot messages

Mon Mar 27, 2023 10:59 am

aBUGSworstnightmare wrote:
Mon Mar 27, 2023 10:30 am
You can still use legacy if you're fine with that!
change your config.txt as below and you'll end up using legacy graphics driver (with all it's downsides)

Code: Select all

#dtoverlay=vc4-kms-v3d
Yes, that's I do. Know how to disable kms, thank You!

Return to “Advanced users”