DAveShillito
Posts: 10
Joined: Sun Jun 17, 2012 9:43 pm

Pi4: Official Display + 2 HDMI Monitors

Mon Sep 21, 2020 12:25 am

TLDR; Can I have a Pi 4 4GB with two hdmi monitors attached and also an official touch screen display working as a display and an input device?

I have a Pi 4 4GB attached to 2 HDMI monitors.
These monitors are shared with my work PC.

I have Node Red running on the Pi for home automation things and can access this via the web interface... but looking at my setup thought... it would be so cool to just have the Pi touch screen sitting on my desk to control stuff, and then see the full pi interface when I switched the monitor inputs. This would also allow me to access the pi via a touch keyboard, and access the command line without needing to switch video inputs.

Following the threads in this forum and online I'm inclined to believe this is not possible, but there were a few links like this...
https://www.youtube.com/watch?v=trY4hLSOpjw (in 2016) which led me think maybe it was sort of possible way, way back in 2016 when the concept of multiple HDMI monitors on a pi was madness, so is it maybe possible now when we have Pi4' with two HDMI outputs?

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

Re: Pi4: Official Display + 2 HDMI Monitors

Mon Sep 21, 2020 4:35 am

Sorry, but what is your target?
The video linked in your post shows a DPI display, with the Pi playing 4 videos on that screen.

You're asking possibility to connect 2 HDMI display "shared with yoi PC"; sorry, but please explain! Where are they connected to: RPi or PC?

Theoretically it should be possible to drive three displays from a single Pi (from the HW POV), but only dual-Display is supported.

Btw: thought of using VNC for accessing the Pi desktop from your PC?

DAveShillito
Posts: 10
Joined: Sun Jun 17, 2012 9:43 pm

Re: Pi4: Official Display + 2 HDMI Monitors

Tue Sep 22, 2020 11:09 am

Sorry, that video may have been misleading, I linked to it since I thought it showed multiple frame buffers in use, which I thought was the issue preventing use of the HDMI and touch screen originally.

To clarify, I have 2 monitors attached to my PC on HDMI input 1 on each monitor. I have one Pi4 connected to both of the monitors on HDMI input 2. Generally I am on the PC, but if I want to switch to the Pi I change the monitor inputs.

It just struck me if I had the Official Display as well I could both use this as a touchscreen and console to use the Pi without switching monitor inputs.

VNC is a good suggestion to be able to use the Pi from the PC (i.e. without switching monitor inputs), and I can access the node-red UI via a browser, and the console via SSH. I was thinking of being able to just glance down and get another view without additional windows open on my PC.

Also the question is generally "is this possible"? rather than specifically for my use case.
I can see other uses for this such as using the touch screen as an input device and two screens for display for an art installation. Also in our current times it would be easier to us an on-screen keyboard on the touchscreen and wipe this down rather than clean a physical keyboard.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Wed Sep 23, 2020 4:40 am

Multiple - namely two ! - framebuffers can be seen in this video https://youtu.be/HFYg63suLoM, showing a CM3 which has two WXGA displays connected.
The video shows the legacy driver, FKMS will only have 1 framebuffer, regardless of no of displays by default.

As said already: only two (!) displays at a time are supported.
So, why not only connect the 7in display to DSI and then use VNC to access it from your PC? If the 800x480pixels resolution is insufficient simply use VNC in virtual desktop mode with the resolution of your choice.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Wed Sep 23, 2020 8:08 am

DAveShillito wrote:
Tue Sep 22, 2020 11:09 am
It just struck me if I had the Official Display as well I could both use this as a touchscreen and console to use the Pi without switching monitor inputs.

VNC is a good suggestion to be able to use the Pi from the PC (i.e. without switching monitor inputs), and I can access the node-red UI via a browser, and the console via SSH. I was thinking of being able to just glance down and get another view without additional windows open on my PC.

Also the question is generally "is this possible"? rather than specifically for my use case.
I can see other uses for this such as using the touch screen as an input device and two screens for display for an art installation. Also in our current times it would be easier to us an on-screen keyboard on the touchscreen and wipe this down rather than clean a physical keyboard.
I'm not clear if you're wanting to use the touchscreen effectively as a trackpad for the mouse pointer on the main displays, or actually put an image on the touchscreen. The former case breaks the hand/eye coordination as normally touching the touchscreen counts as a mouse click because you know where it will click because you're over the right part of the screen. That doesn't work if it's sending input events for a different screen.

Currently there is no way to run 3 screens simultaneously on the Pi. Almost any combination of 2 will work, but not a 3rd.
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.

DAveShillito
Posts: 10
Joined: Sun Jun 17, 2012 9:43 pm

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 1:51 pm

6by9 wrote:
Wed Sep 23, 2020 8:08 am
I'm not clear if you're wanting to use the touchscreen effectively as a trackpad for the mouse pointer on the main displays, or actually put an image on the touchscreen.

It was the latter - in my case to see a browser or console on the touch screen, in the installation example I gave, to see a keyboard,
Currently there is no way to run 3 screens simultaneously on the Pi. Almost any combination of 2 will work, but not a 3rd.

That's cool, I just wanted to know if it was even possible before I spent the time investigating it. :D

Personally I think this would be handy, but I can understand there are many more important things than this edge case. :D

Thanks for your reply.

DAve

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

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 2:19 pm

6by9 wrote:
Wed Sep 23, 2020 8:08 am
Currently there is no way to run 3 screens simultaneously on the Pi. Almost any combination of 2 will work, but not a 3rd.
Having written that all of 30 hours ago, I've just had dual HDMI and DPI displays running simultaneously under the latest full KMS driver (vc4-kms-v3d) on Pi4. There is no way to do it with the firmware drivers (legacy of FKMS).

Dual HDMI and DSI should also follow, but it's a bit more involved to get DSI working under KMS.
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: 2277
Joined: Tue Jun 30, 2015 1:35 pm

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 3:58 pm

6by9 wrote:
Thu Sep 24, 2020 2:19 pm
6by9 wrote:
Wed Sep 23, 2020 8:08 am
Currently there is no way to run 3 screens simultaneously on the Pi. Almost any combination of 2 will work, but not a 3rd.
Having written that all of 30 hours ago, I've just had dual HDMI and DPI displays running simultaneously under the latest full KMS driver (vc4-kms-v3d) on Pi4. There is no way to do it with the firmware drivers (legacy of FKMS).

Dual HDMI and DSI should also follow, but it's a bit more involved to get DSI working under KMS.
which OS version are your running? Would like to test this as well
Max Desktop resolution is 7680x7680? Screen configuration Editor can be used?

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

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 6:11 pm

aBUGSworstnightmare wrote:
Thu Sep 24, 2020 3:58 pm
6by9 wrote:
Thu Sep 24, 2020 2:19 pm
Having written that all of 30 hours ago, I've just had dual HDMI and DPI displays running simultaneously under the latest full KMS driver (vc4-kms-v3d) on Pi4. There is no way to do it with the firmware drivers (legacy of FKMS).

Dual HDMI and DSI should also follow, but it's a bit more involved to get DSI working under KMS.
which OS version are your running? Would like to test this as well
Max Desktop resolution is 7680x7680? Screen configuration Editor can be used?
RaspiOS 32bit but with 5.9 kernel and a pr that hasn't been merged yet.
Yes, xrandr and the screen config app to set it up.
Max render target is still the same at 7680x7680 as that is part of v3d rather than kms. At some point we might try to get that up to the expected 8192x8192, but it's not a priority.
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: 2277
Joined: Tue Jun 30, 2015 1:35 pm

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 6:19 pm

Thanks!
Would like to hear when it's available for a public test.
Also very interrested in KMS DSI support (as I halted driver development for some MIPI displays arm)

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

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 7:39 pm

aBUGSworstnightmare wrote:
Thu Sep 24, 2020 6:19 pm
Thanks!
Would like to hear when it's available for a public test.
Also very interrested in KMS DSI support (as I halted driver development for some MIPI displays arm)
Well the rpi-5.9.y branch is there, you just need to add https://github.com/raspberrypi/linux/pull/3859 on top (I'm expecting that to be merged in the next day or so, just watching for further review comments upstream first).

One dodgy photo from this morning
https://drive.google.com/file/d/1c8TAcA ... sp=sharing
Sorry for the editing to remove things you shouldn't be seeing.
Top left is a 1366x768 monitor running at 1280x800 (1366x768 not being supported). Middle is a Dell 4k monitor at 1080p as my eyesight isn't good enough otherwise. Bottom is an Adafruit 7" 800x480 panel connected via a Kippah, showing the Screen Configuration app.

Running the 4k monitor at 4k30 results in UI lag. I suspect it's trying to render everything at 60fps for the other displays, so it all just gets a bit much for GL to keep up.

I hope to be looking at DSI next week, but I've been bogged down in codecs for a while.
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.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Thu Sep 24, 2020 8:07 pm

6by9 wrote:
Thu Sep 24, 2020 6:11 pm
RaspiOS 32bit but with 5.9 kernel and a pr that hasn't been merged yet.
Yes, xrandr and the screen config app to set it up.
Max render target is still the same at 7680x7680 as that is part of v3d rather than kms. At some point we might try to get that up to the expected 8192x8192, but it's not a priority.
is there a need for v3d to be in the loop?

given that the x/y/w/h coords in the HVS are all 16bit, it feels like you would have a hardware limit of 65536x65536 per-screen
but obviously, hdmi cant go that high, and the fps would be crap if you tried to drive DPI that high as well

but i dont see any real limit against the sum of the screen sizes, other then what kms/xorg may add into the mix

ignoring the limitations of kms for a moment, lets say i had a pair of 3840 × 2160 hdmi outputs, and an 800x600 DPI output
if i just blindly malloc a framebuffer that was 3840 + 3840 + 800 pixels wide, and 24bpp, that would give a stride of 25440, which i believe the HVS could handle

you could then configure each HVS channel to render a vertical slice of that framebuffer, by using a different starting position and the same stride

but i think kms requires that each output get its own independent framebuffer? and then xorg would deal with the border between outputs?

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 4:30 am

6by9 wrote:
Thu Sep 24, 2020 7:39 pm
aBUGSworstnightmare wrote:
Thu Sep 24, 2020 6:19 pm
Thanks!
Would like to hear when it's available for a public test.
Also very interrested in KMS DSI support (as I halted driver development for some MIPI displays arm)
Well the rpi-5.9.y branch is there, you just need to add https://github.com/raspberrypi/linux/pull/3859 on top (I'm expecting that to be merged in the next day or so, just watching for further review comments upstream first).

One dodgy photo from this morning
https://drive.google.com/file/d/1c8TAcA ... sp=sharing
Sorry for the editing to remove things you shouldn't be seeing.
Top left is a 1366x768 monitor running at 1280x800 (1366x768 not being supported). Middle is a Dell 4k monitor at 1080p as my eyesight isn't good enough otherwise. Bottom is an Adafruit 7" 800x480 panel connected via a Kippah, showing the Screen Configuration app.

Running the 4k monitor at 4k30 results in UI lag. I suspect it's trying to render everything at 60fps for the other displays, so it all just gets a bit much for GL to keep up.

I hope to be looking at DSI next week, but I've been bogged down in codecs for a while.
thanks for sharing!

Well, what I've wanted to test with is 3 FHD displays (2 HDMI 'monitors' , namely 5.9in Manga screen 2) and a 18.5in LCD connected to DPI. Then, swap the 18.5 against 13.3in 1366x768pixels as I haven't tested that recently (but should be o.k. As DPI could always handle this resolution). I have the Adafruit 5in as well but only use it when needed (i.e. For giving you guys possibility to cross-check things on DPi) as I now fully relay on my LVDS4PI Evo when connecting a display to DPI.

DSI with KMS is what I'm mainly interrested in atm, as I have 2 nice MIPi dual-lane displays and a 4-lane MIPI bridge which needs to be worked on (driver development) as I'm also eagerly waiting for CM4 release...

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 8:12 am

cleverca22 wrote:
Thu Sep 24, 2020 8:07 pm
6by9 wrote:
Thu Sep 24, 2020 6:11 pm
RaspiOS 32bit but with 5.9 kernel and a pr that hasn't been merged yet.
Yes, xrandr and the screen config app to set it up.
Max render target is still the same at 7680x7680 as that is part of v3d rather than kms. At some point we might try to get that up to the expected 8192x8192, but it's not a priority.
is there a need for v3d to be in the loop?
If you're running X, then that's the way that X does things.
cleverca22 wrote:given that the x/y/w/h coords in the HVS are all 16bit, it feels like you would have a hardware limit of 65536x65536 per-screen
but obviously, hdmi cant go that high, and the fps would be crap if you tried to drive DPI that high as well
Pixel rate will be the limit for DPI. Only the HDMI PVs are 2 pixels/clock and therefore able to cope with 4k60.

I thought when I last looked there were several values in the display list that were 12 to 14 bit, so max 4095 / 8191 / 16383 - eg SCALER5_POS0_START_X, SCALER5_POS0_START_Y, SCALER5_POS1_SCL_WIDTH, SCALER5_POS1_SCL_HEIGHT. Those are only used for non-unity composition - you may get away with it for unity, but that limits use cases in a very odd way.
Memory says someone wanted to use one of the extra wide displays at 5120x2160, and we concluded it wasn't possible.

The pitch fields are 16bit, but they have to be at least 4 times (2 bits) larger than X&Y widths to allow for 32bpp of RGBA formats.
cleverca22 wrote:but i dont see any real limit against the sum of the screen sizes, other then what kms/xorg may add into the mix

ignoring the limitations of kms for a moment, lets say i had a pair of 3840 × 2160 hdmi outputs, and an 800x600 DPI output
if i just blindly malloc a framebuffer that was 3840 + 3840 + 800 pixels wide, and 24bpp, that would give a stride of 25440, which i believe the HVS could handle

you could then configure each HVS channel to render a vertical slice of that framebuffer, by using a different starting position and the same stride

but i think kms requires that each output get its own independent framebuffer? and then xorg would deal with the border between outputs?
As above, I don't believe the HVS can't go wide enough.

KMS is quite happy to take a 7680x2160 buffer from X, and render 0,0 to 3839,2159 on HDMI-1, and 3840,0 to 7679,2159 on HDMI-2. That's what dual 4k will do in X. It only adds in additional framebuffers if you choose to rotate a display (or even flip IIRC, even though KMS tells it that it can do flips)
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.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 11:21 am

6by9 wrote:
Fri Sep 25, 2020 8:12 am
If you're running X, then that's the way that X does things.
ahhh, that explains why v3d comes into play
6by9 wrote:
Fri Sep 25, 2020 8:12 am
Pixel rate will be the limit for DPI. Only the HDMI PVs are 2 pixels/clock and therefore able to cope with 4k60.
i was thinking along the lines of keeping the pixel rate static, so higher resolution means more time per frame, and lower fps, until you violate the timings of the display
6by9 wrote:
Fri Sep 25, 2020 8:12 am
I thought when I last looked there were several values in the display list that were 12 to 14 bit, so max 4095 / 8191 / 16383 - eg SCALER5_POS0_START_X, SCALER5_POS0_START_Y, SCALER5_POS1_SCL_WIDTH, SCALER5_POS1_SCL_HEIGHT. Those are only used for non-unity composition - you may get away with it for unity, but that limits use cases in a very odd way.
Memory says someone wanted to use one of the extra wide displays at 5120x2160, and we concluded it wasn't possible.
ahh, i havent looked into the scaling options yet, but i do also remember there being bandwidth issues there too, from somebody trying to scale 16 1080 video feeds into a 4x4 grid. so the HVS had to fetch 4x as many pixels per scanline
6by9 wrote:
Fri Sep 25, 2020 8:12 am
The pitch fields are 16bit, but they have to be at least 4 times (2 bits) larger than X&Y widths to allow for 32bpp of RGBA formats.

As above, I don't believe the HVS can't go wide enough.
yeah, so if you try to blindly use one massive framebuffer, it will reach a point where the HVS cant stride over the non-visible part anymore, and then you need to use multiple framebuffers
6by9 wrote:
Fri Sep 25, 2020 8:12 am
KMS is quite happy to take a 7680x2160 buffer from X, and render 0,0 to 3839,2159 on HDMI-1, and 3840,0 to 7679,2159 on HDMI-2. That's what dual 4k will do in X. It only adds in additional framebuffers if you choose to rotate a display (or even flip IIRC, even though KMS tells it that it can do flips)
definitely sounds like a place where something like wayland may function a lot better
ive not used it yet, but it feels like it could create a dedicated framebuffer per application, and then the stride only has to deal with the size of 1 window
then its just the upper limits of the various output PHY's

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 11:42 am

cleverca22 wrote:
Fri Sep 25, 2020 11:21 am
6by9 wrote:
Fri Sep 25, 2020 8:12 am
I thought when I last looked there were several values in the display list that were 12 to 14 bit, so max 4095 / 8191 / 16383 - eg SCALER5_POS0_START_X, SCALER5_POS0_START_Y, SCALER5_POS1_SCL_WIDTH, SCALER5_POS1_SCL_HEIGHT. Those are only used for non-unity composition - you may get away with it for unity, but that limits use cases in a very odd way.
Memory says someone wanted to use one of the extra wide displays at 5120x2160, and we concluded it wasn't possible.
ahh, i havent looked into the scaling options yet, but i do also remember there being bandwidth issues there too, from somebody trying to scale 16 1080 video feeds into a 4x4 grid. so the HVS had to fetch 4x as many pixels per scanline
Even unscaled you fail. SCALER5_POS2_WIDTH and SCALER5_POS2_HEIGHT are both 13 bit, so max 8191.
The 7680 limit is because of an issue to be debugged in v3d rather than kms. There isn't an easy way to specify the limit from v3d though, so it's easier to do so in kms.

Any source x/y offsets on linear/raster formats are handled by modifying the start address(es) rather than explicitly telling the HVS about it, so you could chop up a bigger framebuffer that way. It doesn't work for T-format, UIF, or SAND though.
cleverca22 wrote:
6by9 wrote:
Fri Sep 25, 2020 8:12 am
The pitch fields are 16bit, but they have to be at least 4 times (2 bits) larger than X&Y widths to allow for 32bpp of RGBA formats.

As above, I don't believe the HVS can't go wide enough.
yeah, so if you try to blindly use one massive framebuffer, it will reach a point where the HVS cant stride over the non-visible part anymore, and then you need to use multiple framebuffers
6by9 wrote:
Fri Sep 25, 2020 8:12 am
KMS is quite happy to take a 7680x2160 buffer from X, and render 0,0 to 3839,2159 on HDMI-1, and 3840,0 to 7679,2159 on HDMI-2. That's what dual 4k will do in X. It only adds in additional framebuffers if you choose to rotate a display (or even flip IIRC, even though KMS tells it that it can do flips)
definitely sounds like a place where something like wayland may function a lot better
ive not used it yet, but it feels like it could create a dedicated framebuffer per application, and then the stride only has to deal with the size of 1 window
then its just the upper limits of the various output PHY's
Wayland composes each app independently, but I thought it still used GL for the final composition as well. Very few GPUs support a large number of planes as the HVS does. And actually DRM has a fairly hard limit at 32 planes per crtc - https://elixir.bootlin.com/linux/latest ... rtc.h#L210
Open a 33rd window and you now can't compose the screen :-(

X with a compositor doesn't do too badly, but it is still annoying that it misses out a couple of the simple optimisations (eg get KMS to do flips). If it weren't such a huge code base, it would be worth looking into.
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.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 11:49 am

6by9 wrote:
Fri Sep 25, 2020 11:42 am
Wayland composes each app independently, but I thought it still used GL for the final composition as well. Very few GPUs support a large number of planes as the HVS does. And actually DRM has a fairly hard limit at 32 planes per crtc - https://elixir.bootlin.com/linux/latest ... rtc.h#L210
Open a 33rd window and you now can't compose the screen :-(

X with a compositor doesn't do too badly, but it is still annoying that it misses out a couple of the simple optimisations (eg get KMS to do flips). If it weren't such a huge code base, it would be worth looking into.
ah, i feared that was true

the limitations of x86 GPU's have pushed wayland down a certain course, and now it cant take full advantage of the low-power composition on the pi, and has to spin up the entire 3d core
and kms itself wont even let you use the hvs fully, i think you could get ~580 unity images into HVS, if you completely fill the entire dlist memory
but half that if you want to be able to pre-write a 2nd list for page-flipping

32 planes per crtc is just crippling the possibilities

how would dispmanx handle the situation, if you try to render over 580 elements at once?

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 12:58 pm

cleverca22 wrote:
Fri Sep 25, 2020 11:49 am
32 planes per crtc is just crippling the possibilities
Actually it's worse than that. It's planes per card. That mask is of the card's planes that are being used by this crtc.

Each crtc has to have a primary and cursor plane. We now create 16 overlays that can be assigned to any of the crtcs. That number could be increased to make use of all 32 plane slots, but nothing from userspace currently uses it. (Kodi uses 3 planes - GUI, video, and cursor)
cleverca22 wrote:how would dispmanx handle the situation, if you try to render over 580 elements at once?
DispmanX splits the dlist memory into 6 to double buffer each of the 3 channels. I haven't worked out how long that means each dlist can be.
In theory you could ask it to render as many elements a would fit in that memory. Main restrictions would be not to scale any of them or you'll run out of LBM, and preferably don't overlap them.
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.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 1:06 pm

6by9 wrote:
Fri Sep 25, 2020 12:58 pm
Actually it's worse than that. It's planes per card. That mask is of the card's planes that are being used by this crtc.

Each crtc has to have a primary and cursor plane. We now create 16 overlays that can be assigned to any of the crtcs. That number could be increased to make use of all 32 plane slots, but nothing from userspace currently uses it. (Kodi uses 3 planes - GUI, video, and cursor)
ouch!!
sounds like using dispmanx in combination with fkms is the only way to push the hardware to its limits, while avoiding v3d
6by9 wrote:
Fri Sep 25, 2020 12:58 pm
DispmanX splits the dlist memory into 6 to double buffer each of the 3 channels. I haven't worked out how long that means each dlist can be.
In theory you could ask it to render as many elements a would fit in that memory. Main restrictions would be not to scale any of them or you'll run out of LBM, and preferably don't overlap them.
i think the dlist memory can hold 4096 32bit ints?
and a single unity plane is 7 ints
so 4096/7/6 gives you ~97 planes per channel with full double-buffering

for the HVS driver ive been writing in LK, i was thinking of just treating dlist memory like a giant ringbuffer
just append each new list to the end, and reset to the start when you get close to the end
and also keep track of which sections are still in use, and copy them ahead when you run into some in-use stuff again, like a log based filesystem on flash

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 2:25 pm

cleverca22 wrote:
Fri Sep 25, 2020 1:06 pm
6by9 wrote:
Fri Sep 25, 2020 12:58 pm
Actually it's worse than that. It's planes per card. That mask is of the card's planes that are being used by this crtc.

Each crtc has to have a primary and cursor plane. We now create 16 overlays that can be assigned to any of the crtcs. That number could be increased to make use of all 32 plane slots, but nothing from userspace currently uses it. (Kodi uses 3 planes - GUI, video, and cursor)
ouch!!
sounds like using dispmanx in combination with fkms is the only way to push the hardware to its limits, while avoiding v3d
Don't expect triple headed support then.
cleverca22 wrote:
6by9 wrote:
Fri Sep 25, 2020 12:58 pm
DispmanX splits the dlist memory into 6 to double buffer each of the 3 channels. I haven't worked out how long that means each dlist can be.
In theory you could ask it to render as many elements a would fit in that memory. Main restrictions would be not to scale any of them or you'll run out of LBM, and preferably don't overlap them.
i think the dlist memory can hold 4096 32bit ints?
and a single unity plane is 7 ints
so 4096/7/6 gives you ~97 planes per channel with full double-buffering

for the HVS driver ive been writing in LK, i was thinking of just treating dlist memory like a giant ringbuffer
just append each new list to the end, and reset to the start when you get close to the end
and also keep track of which sections are still in use, and copy them ahead when you run into some in-use stuff again, like a log based filesystem on flash
It depends on how efficiently you want the dlist creation to be. LBM usage also comes into play as each complete dlist needs each entry to have the in-use LBM entry to be inserted.
DispmanX does a ping-pong between the two halves, accumulating updates and processing them just before the end of the frame.
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.

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 2:30 pm

6by9 wrote:
Fri Sep 25, 2020 2:25 pm
It depends on how efficiently you want the dlist creation to be. LBM usage also comes into play as each complete dlist needs each entry to have the in-use LBM entry to be inserted.
DispmanX does a ping-pong between the two halves, accumulating updates and processing them just before the end of the frame.
LBM usage?

i'm also curious, is the dlist memory some kind of dual-port ram? or does it just wait its turn and use the axi to schedule and stall things?

i have noticed that the dlist ram isnt even accessible (external abort on read) if the enable bit in the main HVS control reg is cleared, which implies some internal powergating within the HVS itself

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

Re: Pi4: Official Display + 2 HDMI Monitors

Fri Sep 25, 2020 3:05 pm

cleverca22 wrote:
Fri Sep 25, 2020 2:30 pm
LBM usage?
Line Buffer Memory. Required for context whenever vertically scaling.
cleverca22 wrote: i'm also curious, is the dlist memory some kind of dual-port ram? or does it just wait its turn and use the axi to schedule and stall things?

i have noticed that the dlist ram isnt even accessible (external abort on read) if the enable bit in the main HVS control reg is cleared, which implies some internal powergating within the HVS itself
It's a context memory within the HVS block. Pass as to how the hardware is implemented.
Your setup routine will be memcpying or similar into the register address space of the HVS that is assigned for the display lists, and then the dlist parser does the business as it processes the frame.
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.

DAveShillito
Posts: 10
Joined: Sun Jun 17, 2012 9:43 pm

Re: Pi4: Official Display + 2 HDMI Monitors

Mon Sep 28, 2020 4:14 pm

Wow, I'd considered this wrapped up with the "No, it's not possible" on Thursday.
Then I check back in today and see this interesting, but totally over my head, discussion :D .

Being unable to contribute anything to the discussion I'll move the idea back into my mental "it may happen at some point" list, and keep my eyes out for any developments. :)

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

Re: Pi4: Official Display + 2 HDMI Monitors

Mon Oct 19, 2020 10:03 am

IMG_2148.jpg
IMG_2148.jpg (147.31 KiB) Viewed 509 times
KMS is working on RPi4 --> time to connect 3 display to it (HDMI0 + HDMI1 + DPI). Both HDMI 'monitors' are FHD, DPI display is WXGA (1280x800) 8-)

Return to “Official Foundation Display”