2

I use Yocto (Krogoth) to build my imx6 images and toolchains, however it's a bit heavy and slow for working on kernel drivers. As such my dev cycle is to build the kernel on its own, just using the output of a "do_patch" run in yocto as the source tree base and sourcing the toolchain environment.

This is normally not a problem, as mostly I'm focussed at that end of the s/w stack. However, I now need to be able to run a Qt application (running under eglfs) on top of my continually updated kernel, for a bug hunt. To do this, I need the imx6 graphics driver working, so I get the galcore source from git://github.com/Freescale/kernel-module-imx-gpu-viv.git export my kernel build directory, make it and deploy it. That module loads perfectly. However running the working application that has already been built with Yocto causes a crash, somewhere in libQt5EglDeviceIntegration.so.5. All the libs etc. are part of the original working image, the same place I took my kernel source from.

What do I need to do to make this work? Is there some part of Qt tied to the graphics driver that's going to force me to rebuild the entire library? What's the relationship between galcore.ko and Qt? Is there now a weird dependency between my application and the linux kernel?!


EDIT: PEBCAK. I'm an idiot. I didn't check out from the right SHA1 (that listed in the recipe) for the galcore driver. Still, the answer below is instructive, so I'd like to keep this question.

Joe
  • 7,378
  • 4
  • 37
  • 54

1 Answers1

2

What do I need to do to make this work?

No idea. Maybe your self-built galcore.ko is incompatible with the binary blob OpenGL libraries from Freescale somehow? Does the original galcore.ko work correctly? How does the backtrace look?

Is there some part of Qt tied to the graphics driver that's going to force me to rebuild the entire library?

No need to rebuild Qt. While Qt is linked against the OpenGL library, the OpenGL ABI/API is stable and therefore a Qt rebuild isn't needed. Besides that, you aren't changing the OpenGL libraries.

What's the relationship between galcore.ko and Qt?

Qt uses OpenGL for rendering when using QtQuick. The OpenGL library (libGL.so and a few variants like libGLes2.so) is provided by Freescale as a binary blob. The OpenGL library makes syscalls that end up in the galcore.ko kernel module.

libQt5EglDeviceIntegration.so.5 is the part in Qt that does the first OpenGL calls to initialize OpenGL.

Is there now a weird dependency between my application and the linux kernel?!

Well, yes, indirectly via Qt -> libGL.so -> kernel [galcore.ko]

Thomas McGuire
  • 5,308
  • 26
  • 45
  • The original galcore (as built by yocto) works. My kernel & galcore built outside of yocto but with the same toolchain does not work. In theory there is no difference between these two builds, unless Yocto does some magic that I'm unaware of. It's that magic I'm trying to track down... – Joe Apr 11 '18 at 08:04
  • Got my problem. I'm an idiot. I'm accepting this answer though, as it does answer my direct questions. – Joe Apr 11 '18 at 09:43
  • Glad you found your problem. Now don't leave us hanging, what was the difference between your own galcore.ko and the standard one? – Thomas McGuire Apr 11 '18 at 12:10
  • 1
    I don't know. I just realised that the two files were different sizes, which they shouldn't have been. So then I checked my Yocto recipe and checked out the SHA1 there. The diff between HEAD of master and that was large, so I assumed that was my problem. I rebuilt the module from that point and all was good. I'm not actually working on that driver, so that's good enough for me. – Joe Apr 11 '18 at 14:50