EGL, EGLFS, Xcb and OpenGL ES in QT
-
Hi,
I have not had much success in getting a reply on this forum yet but since googling for EGL, EGLFS, Xcb and OpenGL ES for the past couple of days raised questions to which I can not find the answeres I am trying again. :) While much can be found on the subjects I am still unable to clear up the following:
-
When installing QT on an embedded Linux machine which has OpenGL capable graphic drivers, is configuring QT with only OpenGL ES enough to be able to make at least basic use of a display? I should mention that the Linux machine in question does not have an X server.
-
Does QT require a windowing system to be able to make use of a display? If I understand correctly then QT 5 does away with QWS in favor of QPAs. So where is a windowing system in QT5?
-
According to my understanding EGL is an interface between OpenGL ES and the underlying native platform windowing system and in fact enables programs wishing to use OpenGL to do so within a window provided by that windowing system. What if there is no windowing system? Then EGL is no longer needed?
-
According to QT's help EGLFS means EGL Full screen/Single surface. What exactly does that mean and what is the difference between EGL and EGLFS?
5)How does XCB fit into the picture? Is this only neccessary if X server is runing on the machine and has no other function otherwise? Who uses XCB if it is present?
-
Would building QT with OpenGLES support but without EGL, EGLFS and Xcb result in some widgets or functions not working or would QT applications not work at all? How about building it without even OpenGLES?
-
Perhaps the most important question for me: What of the above (EGL, EGLFS, Xcb and OpenGL ES) is dependent on what and what must be present for a display enabled Linux device utilizing QT?
Thank you in advance for all your help.
-
-
I don't know the answers to most of your questions. Will try with remaining ones.
[quote author="Casper" date="1359405973"]
2) Does QT require a windowing system to be able to make use of a display? If I understand correctly then QT 5 does away with QWS in favor of QPAs. So where is a windowing system in QT5?[/quote]
There is none (although you could check out framebuffer QPA plugin). Qt5 expects windowing to be there (QPA in Qt5 handles platform interaction, including drawing. Qt code itself has been made mostly platform independent), or at least some other drawing options to be present (you can hook up QPA to custom drawing routines if you have some special hardware/ software).[quote]
5)How does XCB fit into the picture? Is this only neccessary if X server is runing on the machine and has no other function otherwise? Who uses XCB if it is present?[/quote]
XCB is now used as platform plugin for X.org - it's API is used to connect platform-independent Qt code to a real machine. Last question is a bit vague, so my answer will be similar - everybody (probably around 99% of linux users of Qt5 will be using xcb plugin).[quote]
6) Would building QT with OpenGLES support but without EGL, EGLFS and Xcb result in some widgets or functions not working or would QT applications not work at all? How about building it without even OpenGLES?[/quote]
OpenGL is now a hard dependency for QtGui, although it is not used to draw QtWidgets. QtCore and several other modules can be built without OpenGL.
[/quote] -
Thank you for your explanations sierdzio. I do hawe some follow-up questions:
- If I have an embedded device running Linux without any windowing system (in my particular case it is a Beaglebone) then QT will not be able to use the display I have plugged onto it unless I provide a windowing system, correct? Or ..... (see next question)
- In case I do not have a windowing system I can build QT for my embedded device with Linux Framebuffer and DirectFB support (which as far as I know are built by deault) and thigns should work. Am I correct?
- I see here: http://qt.gitorious.org/qt/qt/trees/4.8/src/plugins/platforms that framebuffer and directfb are actually platform plugins. So they are part of the QPA, correct? (I realize the link is for QT 4 but I see QT 5's structure is similar.)
- So if I will be using DirectFB is XCB still in play then? No X server.
- Could you please help me understand what a platform plugin is? In the source tree I see generic plugins, printsupport plugins, imageformats plugins and so on. Amongst them are also platform plugins. I find the names of most plugins pretty much self explanatory but can not figure out how platform plugins fit in. Why for example is DirectFB a platform plugin?
Thank you again for helping out.
-
In days of Qt4, code included many ifdefs and special methods for Linux, Windows, Mac. For Qt5, large parts of Qt code were rewritten to be 100% platform independent - they simply hook into a unified API of a platform plugin. The plugin has platform-dependent calls that OS requires. This way, it's easier to add new supported platforms, as well as it is easier to maintain Qt code. You can learn more about QPA in this great presentation from last year's DevDays: "link":http://qt-project.org/videos/watch/qpa-the-qt-platform-abstraction.
If you decide on DirectFB, you don't need XCB anymore. XCB platform plugin is a QPA plugin for X.org, not for Linux/ Unix in general. There is wayland plugin available, too.
-
what is the difference between EGL and EGLFS
EGL is a Khronos API implemented by the GPU HW vendor. EGLFS is a term used in Qt5 to represent a plugin using EGL to implement a rendering system with user input.How about building it without even OpenGLES
Dont try it.where is a windowing system in QT5?
The rendering system is provided by the platform plugin, but there is no window manager specific to Qt5. Qt5 asks the platform plugin to create a window surface, and draws to it. Whether you use same windowsurface, or create multiple window surfaces, or contexts, upto your plugin.
will not be able to use the display I have plugged onto it unless I provide a windowing system
In your case, it would be LinuxFB that comes closest. Check the latest thread at,
http://lists.qt-project.org/pipermail/interest/2013-January/005830.html
For building on Beaglebone/SGX based platforms check out http://qt-project.org/wiki/TI
What of the above (EGL, EGLFS, Xcb and OpenGL ES) is dependent on what
EGL and OpenGL ES ==> Khronos APIs provided by GPU vendor
EGLFS ==> Dependent on EGL API
Xcb ==> Dependent on Xcb on your target system -
Let's add on another question related to the same topic. What are the display options if I have an embedded Linux on ARM but no GPU (graphics processing unit)?
- So I suppose QT5 needs to be configured without opengl, right?
- LinuxFb would work in theory but it seems to be broken in Qt5?
- XCB would work if there was a port of X11 for embedded Linux/ARM?
- Any other options?
Qt5 documentation related to embedded platforms seems to be quite minimal.
-
[quote author="DrMuppe" date="1373352315"]Let's add on another question related to the same topic. What are the display options if I have an embedded Linux on ARM but no GPU (graphics processing unit)?
- So I suppose QT5 needs to be configured without opengl, right?
- LinuxFb would work in theory but it seems to be broken in Qt5?
- XCB would work if there was a port of X11 for embedded Linux/ARM?
- Any other options?
.[/quote]
I'm also very interested in this question.
-
i think "Mesa" is one important keyword
It should be possible to use opengl with mesa( SW rendered). -
another keyword is "wayland"
Using QT with the qtwayland platform plugin should be possible.
I compiled a "mini-webbroser" based on QT5.3, QML, QtQuick 2 and QtWebKit 3:
Running this browser on the beaglebone black (with GPU/SGX) with "platform eglfs" works fine.I don't understand how to run this browser on a target without GPU.
I use yocto to create a distro with mesa instead of "libgles-omap3".
Which platform plugin do i have to use to start my browser (directfb, eglfs, linuxfb)?What would be the "best browser solution" for a ARM CPU without GPU?
Chromium with X11, QTwebkit Browser with directfb, QTwebkit Browser with wayland?