Yocto opengl

Hello,

I’m trying to make an image with Qt5 in opengl mode but even if I put

DISTRO_FEATURES_append = " opengl"

in my local.conf I can’t get libgl.so compiled so Qt detection failed.
Which package or virtual/libgl provider should be used (I have sometimes conflits telling that virtual/opengl is furnished by 2 recipes) to get hardware accelerated opengl

hi,

can you please be more specific about which layers and which branches you are using? If you are using meta-qcom, you should be using the dragonboard-410c machine defined there, in which the virtual/* are set:

I recently did a Qt5 build with wayland backend and it worked fine.

Hello ndec,

This is the layer we used (meta-qcom) with the exact same dragonboard.conf.
We tried to build Qt5 using the core-image-minimal and rpb-desktop-image recipes but it failed
Could you tell us how you configured your local.conf or else to build QT5 + wayland?

We definetly miss something here.

Thanks,

Jerome.

the Yocto + Qt5 + Wayland build i was referring to is this one:

http://lists.linuxfoundation.org/pipermail/automotive-discussions/2016-April/001880.html

Hello,

I tried to compile with the thread you provide.
Qtbase is compiling with a wayland backend but is software rendered so 50% cpu doing nothing and just stuck when trying to do something :). libGL.so is neither generated and I’m needing it :s

In fact I’m trying to compile Qt with opengl backend only (no need of a window manager) and libGL is needed in this case
I get the same pb with the yocto repo mentionned in the wiki (using rpb-console-image to get a try).
trying to add :

DISTRO_FEATURES_remove = " x11"  #Qt5 can't compile in yocto with x11 support (-no-accessibility pb)
DISTRO_FEATURES_append = " opengl" #try to use opengl backend
IMAGE_INSTALL_append = " qtbase" #add just qtbase for the compilation try

… rerunning from scratch with the wiki repo at the moment …

hi,

hmm. i thought i had tried/checked the AGL image… but i don’t have it running now anymore. i will need to check that again. Unfortunately, i am going away for the next few days… so I won’t be able to look into that and help until next week…

and it’s been a while since i’ve used qt5… a long time ago i had a working Qt5+EGLFS+GLES on freedreno/mesa using this branch:

https://git.linaro.org/people/nicolas.dechesne/meta-qualcomm.git/shortlog/refs/heads/qt5-eglfs

It’s a very old meta-qcom layer, so don’t use it, but you can check the top most commits. I am fairly sure it used to work, and we had a qtbase bbappend there. I am not sure if it’s still needed , since i haven’t followed meta-qt5 since at least 1 year…

if the problem is still there next week, i can try to setup the environment to reproduce the problem and help more… let me know if you get anything in between

I’ll take a look at what you done in this branch and try to use eglfs backend rather than opengl (I don’t know which should be more efficient)

Which component is in charge of opengl hadware acceleration? Is it mesa, freedreno or other? I think pb com’s from the component is charge of hardware acceleration which doesn’t provide all shared object

For the AGL I flashed it and it starts but the mesa included is the sofware one so, as it, it is unusable

not really familiar w/ the yocto or qt side of things, but opengl/opengles is provided by mesa (there is a freedreno gallium driver in the mesa git tree)… both desktop opengl3.1 (w/ mesa >= 11.1) and opengles3.0 (w/ mesa >= 11.0, iirc) should work.

Yes you’re right, deep searching let me figure out that freedreno should create the opengl library I need but this doesn’t seems to be the case with the yocto project I get when I want it to build over dri to avoid the X managment system. I can’t see any build of the hardware drivers, only mesa includes are present

Hello Ndec,

Since we have opened this ticket have you tried, by any chance, to rebuild rpb_console_image + QT(opengl) over wayland(backend)?

So far the build only works with X11(backend). Our aim is to make QT work with eglfs backend but as soon as I remove X11 from the Distro (DISTRO_FEATURES_remove = " x11") QT build is missing “-lGl” (wayland backend or not). Quite sure that I missing a mesa lib but not able to figure out which one and how to add it (without conflict).

Thanks for your help,

Jérôme.

Hello,

Success : I finally fixed my issue by forcing the meta-qt5 to link with opengl es2 and not opengl desktop (by default). I then faces 2 new problem of link and compiling (from freedreno ressources) that I fixed that way:
Link:
xf86drm.h and xf86drmmode.h is including drm.h that is located in a subfolder drm/drm.h
When I check the github of freedreno (https://github.com/freedreno/libdrm) it looks like there are currently moving pieces in there and some files changes (drm/drm.h to drm.h) so I don’t how it is link now but.
To skip this error I moved drm.h one folder upper to resume my build.

Compiling:
drm.h seems to not have the fix from 2010 that manage the variable name “virtual” and which doesn’t work of course with a c++ compilator. (This problem has been quoted here :http://stackoverflow.com/questions/19034688/extern-c-with-variable-name-virtual)
Anyway to fix this, I change the code following last freedreno github drm.h.

After what I successfully built my image with Qt(opengl) and without X11 neither wayland. I will try now to run a QT demo on the db but this is an other story…

Jérôme.

hi @jtis, could I ask you to post your changes to meta-qt5 layer- or any other of the meta layers that you had to modify - in case other users would need to replicate? thanks!

Hello @Jorge,

So to clarify :
I build the rpb-weston-image for the machine db-410c.
This is what I have added to the local.conf file:
PACKAGECONFIG_GL_pn-qtbase = “gles2 eglfs”
IMAGE_INSTALL_append = “qtbase qtwayland cinematicexperience”

  • The patch during the process I explain in my previous post.

I’m sorry by advance if I missed some option as I did that few months ago already and I have not this conf anymore.

Jérôme.

@jtis,
thanks Jerome!. will give it a go as soon as I can. I am currently having issues building the krogoth branch but will try this as soon as I can build again.

hi @jtis, yes, I hit your first issue when compiling eglfs (btw I disabled X11 and Wayland).
I 'll generate the necessary patches when done so this can be configured properly

Hello @Jorge,

Glad to here that you will fix that.
I was trying to build the image with wayland + weston. But this isn’t mandatory indeed to reproduce the problems I encountered.

Jérôme.

@jtis, yes it seems that the issue is that qt5

  1. doesnt have /usr/include/libdrm in the path when building the eglfs plugins (so drm.h is not found)
  2. somehow during the build process it also brings an old drm.h from libc headers (so missing the 6 year old “virtual” keyword fix that you also mentioned).

@jtis: the issues have been fixed in the master branch of meta-rpb.

If you still need to create a Qt5 only image with no X11/Wayland, you can check the following pull request (under review but functional on the db410c)

Hello @Jorge,

Thanks for your time ! Glad that we fixed that.

Jérôme.