Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
well thats an eye opener.
#1
I've been doing it wrong.....

Since I started coding on Raspberries, I've been using a simple framework that displayed my OpenGL content using DispmanX systems, that worked great.
When I tried to use other SBC's it turned out they didn't have DispmanX, so I discovered they used X11 to display.. I thought that Raspberry's DispmanX was a replacement for X11

I was totally and utterly wrong, and its taken 3 years and a confusing thread on the Raspberrypi.org forums to make the clear.

Raspbian does use X11, it ALSO uses DispmanX I guess as a way to draw bitmaps faster, it may indeed be a bit faster than X11, but I would have to do some tests.

The DispmanX stuff is still fine, when all said an done, all we are doing is working on a framebuffer and depending on the system to display it. Both X11 and DispmanX do that, while we are busy working away behind it, not really caring how it gets on screen.

But it does mean, that in principle at least it should be possible to get all Raspberries to render with the same X11 systems as the other SBC's... mind you my first attempts to do that are failing, so for now keep DispmanX until I work out why I'm unable to create a surface despite opening X11 windows and displays and EGL contexts....more research is needed. But it might result in a much cleaner config.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#2
After some experimentation, and a lot of wtf and other colourful scottish vocabulary, I've concluded that its waaay too much effort trying to render on an older Raspberry with X11. Using the onboard libs, it crashes out with a segmentation error trying to create an EGL surface. I can find no reason for it, or means to fix it, and there seems to be little research on line about it (unlikely to be now that the 4 is here).
Maybe newer than Jessie drivers controlled by the new static ones can't handle X11? However using mesa libs (back to non static versions) it does work, but it emulates...very very slowly, I don't have a Jessie version of Raspbian around and tbh, feel it would be a waste of time to set one up just to confirm my theory.. the fix is simply to treat the older systems as DispmanX displays, besides, the older Raspberries keep their drivers in different dirs as well.

So..while X11 may indeed be possible, and it would be cool to have a single config for all SBC's including Raspberry, I think its best to maintain the 2 config system of DispmanX display for Rpi0,1,2,3,3+ and X11 on Rpi4 and other SBC.

I'll be posting a new graphics class and simple demo, containing init systems for these 2 variations based on an OLDRASP preprocessor label very soon.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#3
I suppose it's a fair compromise.

Looking at some of your posts on the Raspberry Pi forums, I am still a bit confused as to whether or not if DispmanX should work with the RasPi 4 or not. Seems like most of the conversations there just go sideways.

What would be nice is if there was just one option for all of the boards.
Reply
#4
yeah, is pretty standard posting on linux or raspbery forums, though the advice I was given was not actually the advice I asked for it did lead me to ask question that helped me to get my eyes opened, I'm not following convention, and they simply don't understand why I would want to be doing OpenGLES when they've done a prefectly good OpenGL and SDL, QT and whatever libs are around...which no one appreciates I don't use... And good as their OpenGL is, its not 100% compliant and has performance issues in some situations. I will only do OpenGL on fully compliant systems otherwise I just focus on getting the best out of the systems, ie OpenGLES2

It does seem everytime I post on those forums, there's a combination of why do you want to do that, and no, you need to do this, and some noob comments. But hey, thats why I'm here Big Grin

DispmanX does not work on Pi4, that much I have worked out some time ago, its now intended to be only for X11 or other display systems, I'm not sure it even works now? The issue mainly is that depending on what you want to do, and what system yo have you need to use different drivers.. but its not documented at all well. X11 on any version, needs mesa libs... DispmanX needs the onboard static libs and Pi4 only runs X11 (at the moment), so the onboard libs it has are useless. Also you need to set the raspi-config to default libs for OpenGLES, or KMS libs for OpenGL/x11 on rasp.
And on Pi, use the KMS libs, but use Mesa and either OpenGLES or openGL....

yeah... not confusing at all.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)